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

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

Overview

Cloud Monitoring API

Manages your Cloud Monitoring data and configurations. Most projects must be associated with a Workspace, 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 Cloud 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

Instance Method Summary collapse

Constructor Details

#initializeMonitoringService

Returns a new instance of MonitoringService.



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

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.



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

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.



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

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:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

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:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

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:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

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:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

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)

    Immutable. 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:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

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