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

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

Overview

Cloud Monitoring API

Manages your Cloud Monitoring data and configurations.

Examples:

require 'google/apis/monitoring_v1'

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

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://monitoring.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMonitoringService

Returns a new instance of MonitoringService.



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

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-monitoring_v1',
        client_version: Google::Apis::MonitoringV1::GEM_VERSION)
  @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.



40
41
42
# File 'lib/google/apis/monitoring_v1/service.rb', line 40

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.



45
46
47
# File 'lib/google/apis/monitoring_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#create_location_global_metrics_scope_project(parent, monitored_project_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::Operation

Adds a MonitoredProject with the given project ID to the specified Metrics Scope.

Parameters:

  • parent (String)

    Required. The resource name of the existing Metrics Scope that will monitor this project. Example: locations/global/metricsScopes/ SCOPING_PROJECT_ID_OR_NUMBER

  • monitored_project_object (Google::Apis::MonitoringV1::MonitoredProject) (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



143
144
145
146
147
148
149
150
151
152
153
# File 'lib/google/apis/monitoring_v1/service.rb', line 143

def create_location_global_metrics_scope_project(parent, monitored_project_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/projects', options)
  command.request_representation = Google::Apis::MonitoringV1::MonitoredProject::Representation
  command.request_object = monitored_project_object
  command.response_representation = Google::Apis::MonitoringV1::Operation::Representation
  command.response_class = Google::Apis::MonitoringV1::Operation
  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

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

Creates a new custom dashboard. For examples on how you can use this API to create dashboards, see Managing dashboards by API (https://cloud.google.com/ monitoring/dashboards/api-dashboard). This method requires the monitoring. dashboards.create permission on the specified project. For more information about permissions, see Cloud Identity and Access Management (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)
  • validate_only (Boolean) (defaults to: nil)

    If set, validate the request and preview the review, but do not actually save it.

  • 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



251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/google/apis/monitoring_v1/service.rb', line 251

def create_project_dashboard(parent, dashboard_object = nil, validate_only: 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['validateOnly'] = validate_only unless validate_only.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_location_global_metrics_scope_project(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::Operation

Deletes a MonitoredProject from the specified Metrics Scope.

Parameters:

  • name (String)

    Required. The resource name of the MonitoredProject. Example: locations/global/ metricsScopes/SCOPING_PROJECT_ID_OR_NUMBER/projects/ MONITORED_PROJECT_ID_OR_NUMBERAuthorization requires the following Google IAM (https://cloud.google.com/iam) permissions on both the Metrics Scope and on the MonitoredProject: monitoring.metricsScopes.link

  • 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



179
180
181
182
183
184
185
186
187
# File 'lib/google/apis/monitoring_v1/service.rb', line 179

def delete_location_global_metrics_scope_project(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::MonitoringV1::Operation::Representation
  command.response_class = Google::Apis::MonitoringV1::Operation
  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

#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 Cloud Identity and Access Management (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



287
288
289
290
291
292
293
294
295
# File 'lib/google/apis/monitoring_v1/service.rb', line 287

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_location_global_metrics_scope(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::MetricsScope

Returns a specific Metrics Scope, including the list of projects monitored by the specified Metrics Scope.

Parameters:

  • name (String)

    Required. The resource name of the Metrics Scope. Example: locations/global/ metricsScopes/SCOPING_PROJECT_ID_OR_NUMBER

  • 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



76
77
78
79
80
81
82
83
84
# File 'lib/google/apis/monitoring_v1/service.rb', line 76

def get_location_global_metrics_scope(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::MonitoringV1::MetricsScope::Representation
  command.response_class = Google::Apis::MonitoringV1::MetricsScope
  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_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::Operation

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters:

  • name (String)

    The name of the operation resource.

  • 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



210
211
212
213
214
215
216
217
218
# File 'lib/google/apis/monitoring_v1/service.rb', line 210

def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::MonitoringV1::Operation::Representation
  command.response_class = Google::Apis::MonitoringV1::Operation
  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 Cloud Identity and Access Management (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



321
322
323
324
325
326
327
328
329
# File 'lib/google/apis/monitoring_v1/service.rb', line 321

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

#labels_project_location_prometheu_api_v1(name, location, query_labels_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::HttpBody

Lists labels for metrics.

Parameters:

  • name (String)

    The workspace on which to execute the request. It is not part of the open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine. The format is: projects/ PROJECT_ID_OR_NUMBER.

  • location (String)

    Location of the resource information. Has to be "global" now.

  • query_labels_request_object (Google::Apis::MonitoringV1::QueryLabelsRequest) (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



439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/google/apis/monitoring_v1/service.rb', line 439

def labels_project_location_prometheu_api_v1(name, location, query_labels_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}/location/{location}/prometheus/api/v1/labels', options)
  command.request_representation = Google::Apis::MonitoringV1::QueryLabelsRequest::Representation
  command.request_object = query_labels_request_object
  command.response_representation = Google::Apis::MonitoringV1::HttpBody::Representation
  command.response_class = Google::Apis::MonitoringV1::HttpBody
  command.params['name'] = name unless name.nil?
  command.params['location'] = location unless location.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_location_global_metrics_scope_metrics_scopes_by_monitored_project(monitored_resource_container: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::ListMetricsScopesByMonitoredProjectResponse

Returns a list of every Metrics Scope that a specific MonitoredProject has been added to. The metrics scope representing the specified monitored project will always be the first entry in the response.

Parameters:

  • monitored_resource_container (String) (defaults to: nil)

    Required. The resource name of the Monitored Project being requested. Example: projects/MONITORED_PROJECT_ID_OR_NUMBER

  • 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



109
110
111
112
113
114
115
116
117
# File 'lib/google/apis/monitoring_v1/service.rb', line 109

def list_location_global_metrics_scope_metrics_scopes_by_monitored_project(monitored_resource_container: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/locations/global/metricsScopes:listMetricsScopesByMonitoredProject', options)
  command.response_representation = Google::Apis::MonitoringV1::ListMetricsScopesByMonitoredProjectResponse::Representation
  command.response_class = Google::Apis::MonitoringV1::ListMetricsScopesByMonitoredProjectResponse
  command.query['monitoredResourceContainer'] = monitored_resource_container unless monitored_resource_container.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 Cloud Identity and Access Management (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)

    Optional. 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



361
362
363
364
365
366
367
368
369
370
371
# File 'lib/google/apis/monitoring_v1/service.rb', line 361

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

#list_project_location_prometheu_api_v1_metadata(name, location, limit: nil, metric: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::HttpBody

Lists metadata for metrics.

Parameters:

  • name (String)

    Required. The workspace on which to execute the request. It is not part of the open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.

  • location (String)

    Location of the resource information. Has to be "global" for now.

  • limit (Fixnum) (defaults to: nil)

    Maximum number of metrics to return.

  • metric (String) (defaults to: nil)

    The metric name for which to query metadata. If unset, all metric metadata is returned.

  • 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



689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/google/apis/monitoring_v1/service.rb', line 689

def (name, location, limit: nil, metric: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}/location/{location}/prometheus/api/v1/metadata', options)
  command.response_representation = Google::Apis::MonitoringV1::HttpBody::Representation
  command.response_class = Google::Apis::MonitoringV1::HttpBody
  command.params['name'] = name unless name.nil?
  command.params['location'] = location unless location.nil?
  command.query['limit'] = limit unless limit.nil?
  command.query['metric'] = metric unless metric.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, validate_only: 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 Cloud Identity and Access Management ( https://cloud.google.com/iam).

Parameters:

  • name (String)

    Identifier. The resource name of the dashboard.

  • dashboard_object (Google::Apis::MonitoringV1::Dashboard) (defaults to: nil)
  • validate_only (Boolean) (defaults to: nil)

    If set, validate the request and preview the review, but do not actually save it.

  • 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



400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/google/apis/monitoring_v1/service.rb', line 400

def patch_project_dashboard(name, dashboard_object = nil, validate_only: 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['validateOnly'] = validate_only unless validate_only.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#query_v1_exemplars(name, location, query_exemplars_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::HttpBody

Lists exemplars relevant to a given PromQL query,

Parameters:

  • name (String)

    The project on which to execute the request. Data associcated with the project' s workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine.

  • location (String)

    Location of the resource information. Has to be "global" now.

  • query_exemplars_request_object (Google::Apis::MonitoringV1::QueryExemplarsRequest) (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



517
518
519
520
521
522
523
524
525
526
527
528
# File 'lib/google/apis/monitoring_v1/service.rb', line 517

def query_v1_exemplars(name, location, query_exemplars_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}/location/{location}/prometheus/api/v1/query_exemplars', options)
  command.request_representation = Google::Apis::MonitoringV1::QueryExemplarsRequest::Representation
  command.request_object = query_exemplars_request_object
  command.response_representation = Google::Apis::MonitoringV1::HttpBody::Representation
  command.response_class = Google::Apis::MonitoringV1::HttpBody
  command.params['name'] = name unless name.nil?
  command.params['location'] = location unless location.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#query_v1_instant(name, location, query_instant_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::HttpBody

Evaluate a PromQL query at a single point in time.

Parameters:

  • name (String)

    The project on which to execute the request. Data associcated with the project' s workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine.

  • location (String)

    Location of the resource information. Has to be "global" now.

  • query_instant_request_object (Google::Apis::MonitoringV1::QueryInstantRequest) (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



478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/google/apis/monitoring_v1/service.rb', line 478

def query_v1_instant(name, location, query_instant_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}/location/{location}/prometheus/api/v1/query', options)
  command.request_representation = Google::Apis::MonitoringV1::QueryInstantRequest::Representation
  command.request_object = query_instant_request_object
  command.response_representation = Google::Apis::MonitoringV1::HttpBody::Representation
  command.response_class = Google::Apis::MonitoringV1::HttpBody
  command.params['name'] = name unless name.nil?
  command.params['location'] = location unless location.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#query_v1_range(name, location, query_range_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::HttpBody

Evaluate a PromQL query with start, end time range.

Parameters:

  • name (String)

    The project on which to execute the request. Data associcated with the project' s workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine.

  • location (String)

    Location of the resource information. Has to be "global" now.

  • query_range_request_object (Google::Apis::MonitoringV1::QueryRangeRequest) (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



556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/google/apis/monitoring_v1/service.rb', line 556

def query_v1_range(name, location, query_range_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}/location/{location}/prometheus/api/v1/query_range', options)
  command.request_representation = Google::Apis::MonitoringV1::QueryRangeRequest::Representation
  command.request_object = query_range_request_object
  command.response_representation = Google::Apis::MonitoringV1::HttpBody::Representation
  command.response_class = Google::Apis::MonitoringV1::HttpBody
  command.params['name'] = name unless name.nil?
  command.params['location'] = location unless location.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#series_project_location_prometheu_api_v1(name, location, query_series_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::HttpBody

Lists metadata for metrics.

Parameters:

  • name (String)

    Required. The workspace on which to execute the request. It is not part of the open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.

  • location (String)

    Location of the resource information. Has to be "global" for now.

  • query_series_request_object (Google::Apis::MonitoringV1::QuerySeriesRequest) (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



595
596
597
598
599
600
601
602
603
604
605
606
# File 'lib/google/apis/monitoring_v1/service.rb', line 595

def series_project_location_prometheu_api_v1(name, location, query_series_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}/location/{location}/prometheus/api/v1/series', options)
  command.request_representation = Google::Apis::MonitoringV1::QuerySeriesRequest::Representation
  command.request_object = query_series_request_object
  command.response_representation = Google::Apis::MonitoringV1::HttpBody::Representation
  command.response_class = Google::Apis::MonitoringV1::HttpBody
  command.params['name'] = name unless name.nil?
  command.params['location'] = location unless location.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#values_project_location_prometheu_api_v1_label(name, location, label, end_: nil, match: nil, start: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MonitoringV1::HttpBody

Lists possible values for a given label name.

Parameters:

  • name (String)

    The workspace on which to execute the request. It is not part of the open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine. The format is: projects/ PROJECT_ID_OR_NUMBER.

  • location (String)

    Location of the resource information. Has to be "global" now.

  • label (String)

    The label name for which values are queried.

  • end_ (String) (defaults to: nil)

    The end time to evaluate the query for. Either floating point UNIX seconds or RFC3339 formatted timestamp.

  • match (String) (defaults to: nil)

    A list of matchers encoded in the Prometheus label matcher format to constrain the values to series that satisfy them.

  • start (String) (defaults to: nil)

    The start time to evaluate the query for. Either floating point UNIX seconds or RFC3339 formatted timestamp.

  • 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



644
645
646
647
648
649
650
651
652
653
654
655
656
657
# File 'lib/google/apis/monitoring_v1/service.rb', line 644

def values_project_location_prometheu_api_v1_label(name, location, label, end_: nil, match: nil, start: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}/location/{location}/prometheus/api/v1/label/{label}/values', options)
  command.response_representation = Google::Apis::MonitoringV1::HttpBody::Representation
  command.response_class = Google::Apis::MonitoringV1::HttpBody
  command.params['name'] = name unless name.nil?
  command.params['location'] = location unless location.nil?
  command.params['label'] = label unless label.nil?
  command.query['end'] = end_ unless end_.nil?
  command.query['match'] = match unless match.nil?
  command.query['start'] = start unless start.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end