Class: Google::Apis::MonitoringV1::MonitoringService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::MonitoringV1::MonitoringService
- Defined in:
- lib/google/apis/monitoring_v1/service.rb
Overview
Cloud Monitoring API
Manages your Cloud Monitoring data and configurations.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#initialize ⇒ MonitoringService
constructor
A new instance of MonitoringService.
-
#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.
-
#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.
-
#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_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.
-
#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.
-
#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,.
-
#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.
-
#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.
-
#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.
-
#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.
Constructor Details
#initialize ⇒ MonitoringService
Returns a new instance of MonitoringService.
45 46 47 48 49 50 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 45 def initialize super('https://monitoring.googleapis.com/', '', client_name: 'google-apis-monitoring_v1', client_version: Google::Apis::MonitoringV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
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.
38 39 40 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 38 def key @key end |
#quota_user ⇒ String
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.
43 44 45 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 43 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.
141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 141 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', ) 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).
249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 249 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', ) 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.
177 178 179 180 181 182 183 184 185 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 177 def delete_location_global_metrics_scope_project(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) 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).
285 286 287 288 289 290 291 292 293 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 285 def delete_project_dashboard(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) 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.
74 75 76 77 78 79 80 81 82 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 74 def get_location_global_metrics_scope(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) 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.
208 209 210 211 212 213 214 215 216 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 208 def get_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) 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).
319 320 321 322 323 324 325 326 327 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 319 def get_project_dashboard(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) 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.
437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 437 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', ) 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.
107 108 109 110 111 112 113 114 115 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 107 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', ) 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).
359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 359 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', ) 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.
687 688 689 690 691 692 693 694 695 696 697 698 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 687 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', ) 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).
398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 398 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}', ) 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,
515 516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 515 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', ) 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.
476 477 478 479 480 481 482 483 484 485 486 487 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 476 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', ) 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.
554 555 556 557 558 559 560 561 562 563 564 565 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 554 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', ) 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.
593 594 595 596 597 598 599 600 601 602 603 604 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 593 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', ) 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.
642 643 644 645 646 647 648 649 650 651 652 653 654 655 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 642 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', ) 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 |