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.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://monitoring.$UNIVERSE_DOMAIN$/"
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.
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
#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.
40 41 42 |
# File 'lib/google/apis/monitoring_v1/service.rb', line 40 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.
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.
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', ) 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).
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', ) 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.
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}', ) 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).
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}', ) 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.
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}', ) 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.
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}', ) 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).
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}', ) 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.
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', ) 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.
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', ) 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).
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', ) 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.
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', ) 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).
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}', ) 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,
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', ) 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.
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', ) 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.
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', ) 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.
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', ) 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.
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', ) 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 |