Class: Google::Apis::MonitoringV1::MonitoringService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/monitoring_v1/service.rb

Overview

Stackdriver Monitoring API

Manages your Stackdriver Monitoring data and configurations. Most projects must be associated with a Stackdriver account, with a few exceptions as noted on the individual method pages. The table entries below are presented in alphabetical order, not in order of common use. For explanations of the concepts found in the table entries, read the Stackdriver Monitoring documentation.

Examples:

require 'google/apis/monitoring_v1'

Monitoring = Google::Apis::MonitoringV1 # Alias the module
service = Monitoring::MonitoringService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeMonitoringService

Returns a new instance of MonitoringService.


50
51
52
53
# File 'generated/google/apis/monitoring_v1/service.rb', line 50

def initialize
  super('https://monitoring.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.


43
44
45
# File 'generated/google/apis/monitoring_v1/service.rb', line 43

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.


48
49
50
# File 'generated/google/apis/monitoring_v1/service.rb', line 48

def quota_user
  @quota_user
end

Instance Method Details

#create_project_dashboard(parent, dashboard_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::Dashboard

Creates a new custom dashboard.This method requires the monitoring.dashboards. create permission on the specified project. For more information, see Google Cloud IAM (https://cloud.google.com/iam).

Parameters:

  • parent (String)

    Required. The project on which to execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER] The [PROJECT_ID_OR_NUMBER] must match the dashboard resource name.

  • dashboard_object (Google::Apis::MonitoringV1::Dashboard) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


80
81
82
83
84
85
86
87
88
89
90
# File 'generated/google/apis/monitoring_v1/service.rb', line 80

def create_project_dashboard(parent, dashboard_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/dashboards', options)
  command.request_representation = Google::Apis::MonitoringV1::Dashboard::Representation
  command.request_object = dashboard_object
  command.response_representation = Google::Apis::MonitoringV1::Dashboard::Representation
  command.response_class = Google::Apis::MonitoringV1::Dashboard
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_dashboard(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::Empty

Deletes an existing custom dashboard.This method requires the monitoring. dashboards.delete permission on the specified dashboard. For more information, see Google Cloud IAM (https://cloud.google.com/iam).

Parameters:

  • name (String)

    Required. The resource name of the Dashboard. The format is: projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


115
116
117
118
119
120
121
122
123
# File 'generated/google/apis/monitoring_v1/service.rb', line 115

def delete_project_dashboard(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::MonitoringV1::Empty::Representation
  command.response_class = Google::Apis::MonitoringV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_dashboard(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::Dashboard

Fetches a specific dashboard.This method requires the monitoring.dashboards. get permission on the specified dashboard. For more information, see Google Cloud IAM (https://cloud.google.com/iam).

Parameters:

  • name (String)

    Required. The resource name of the Dashboard. The format is one of: dashboards/DASHBOARD_ID projects/[PROJECT_ID_OR_NUMBER]/dashboards/DASHBOARD_ID.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


150
151
152
153
154
155
156
157
158
# File 'generated/google/apis/monitoring_v1/service.rb', line 150

def get_project_dashboard(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::MonitoringV1::Dashboard::Representation
  command.response_class = Google::Apis::MonitoringV1::Dashboard
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_dashboards(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::ListDashboardsResponse

Lists the existing dashboards.This method requires the monitoring.dashboards. list permission on the specified project. For more information, see Google Cloud IAM (https://cloud.google.com/iam).

Parameters:

  • parent (String)

    Required. The scope of the dashboards to list. The format is: projects/[PROJECT_ID_OR_NUMBER]

  • page_size (Fixnum) (defaults to: nil)

    A positive number that is the maximum number of results to return. If unspecified, a default of 1000 is used.

  • page_token (String) (defaults to: nil)

    If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


190
191
192
193
194
195
196
197
198
199
200
# File 'generated/google/apis/monitoring_v1/service.rb', line 190

def list_project_dashboards(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/dashboards', options)
  command.response_representation = Google::Apis::MonitoringV1::ListDashboardsResponse::Representation
  command.response_class = Google::Apis::MonitoringV1::ListDashboardsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_dashboard(name, dashboard_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::Dashboard

Replaces an existing custom dashboard with a new definition.This method requires the monitoring.dashboards.update permission on the specified dashboard. For more information, see Google Cloud IAM (https://cloud.google. com/iam).

Parameters:

  • name (String)

    The resource name of the dashboard.

  • dashboard_object (Google::Apis::MonitoringV1::Dashboard) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


226
227
228
229
230
231
232
233
234
235
236
# File 'generated/google/apis/monitoring_v1/service.rb', line 226

def patch_project_dashboard(name, dashboard_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::MonitoringV1::Dashboard::Representation
  command.request_object = dashboard_object
  command.response_representation = Google::Apis::MonitoringV1::Dashboard::Representation
  command.response_class = Google::Apis::MonitoringV1::Dashboard
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end