google-cloud-monitoring-v3 0.4.2 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/cloud/monitoring/v3/alert_policy_service/client.rb +157 -61
- data/lib/google/cloud/monitoring/v3/group_service/client.rb +189 -68
- data/lib/google/cloud/monitoring/v3/metric_service/client.rb +360 -80
- data/lib/google/cloud/monitoring/v3/notification_channel_service/client.rb +286 -87
- data/lib/google/cloud/monitoring/v3/query_service/client.rb +60 -41
- data/lib/google/cloud/monitoring/v3/service_monitoring_service/client.rb +281 -84
- data/lib/google/cloud/monitoring/v3/uptime_check_service/client.rb +182 -63
- data/lib/google/cloud/monitoring/v3/version.rb +1 -1
- data/lib/google/monitoring/v3/alert_pb.rb +17 -2
- data/lib/google/monitoring/v3/alert_service_pb.rb +2 -2
- data/lib/google/monitoring/v3/alert_service_services_pb.rb +1 -1
- data/lib/google/monitoring/v3/common_pb.rb +2 -2
- data/lib/google/monitoring/v3/group_pb.rb +1 -1
- data/lib/google/monitoring/v3/group_service_pb.rb +2 -2
- data/lib/google/monitoring/v3/group_service_services_pb.rb +1 -1
- data/lib/google/monitoring/v3/metric_pb.rb +2 -2
- data/lib/google/monitoring/v3/metric_service_pb.rb +2 -2
- data/lib/google/monitoring/v3/metric_service_services_pb.rb +13 -1
- data/lib/google/monitoring/v3/mutation_record_pb.rb +1 -1
- data/lib/google/monitoring/v3/notification_pb.rb +2 -2
- data/lib/google/monitoring/v3/notification_service_pb.rb +2 -2
- data/lib/google/monitoring/v3/notification_service_services_pb.rb +1 -1
- data/lib/google/monitoring/v3/query_service_pb.rb +2 -2
- data/lib/google/monitoring/v3/query_service_services_pb.rb +1 -1
- data/lib/google/monitoring/v3/service_pb.rb +5 -2
- data/lib/google/monitoring/v3/service_service_pb.rb +2 -2
- data/lib/google/monitoring/v3/service_service_services_pb.rb +1 -1
- data/lib/google/monitoring/v3/uptime_pb.rb +2 -2
- data/lib/google/monitoring/v3/uptime_service_pb.rb +3 -2
- data/lib/google/monitoring/v3/uptime_service_services_pb.rb +1 -1
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/monitoring/v3/alert.rb +68 -3
- data/proto_docs/google/monitoring/v3/alert_service.rb +4 -2
- data/proto_docs/google/monitoring/v3/common.rb +17 -5
- data/proto_docs/google/monitoring/v3/group_service.rb +4 -2
- data/proto_docs/google/monitoring/v3/metric.rb +3 -1
- data/proto_docs/google/monitoring/v3/metric_service.rb +13 -8
- data/proto_docs/google/monitoring/v3/notification_service.rb +8 -4
- data/proto_docs/google/monitoring/v3/service.rb +38 -6
- data/proto_docs/google/monitoring/v3/service_service.rb +4 -2
- data/proto_docs/google/monitoring/v3/span_context.rb +2 -2
- data/proto_docs/google/monitoring/v3/uptime.rb +5 -2
- data/proto_docs/google/monitoring/v3/uptime_service.rb +4 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 135c4d1afadbf4c699971b07032372bd90c61c0848ab176ff5efdd5f294a1d01
|
4
|
+
data.tar.gz: 1a162a3e4b27d3d843b9348568ce58dcadb76a201af38fd419ecbae73c4d88e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d9c448175505c545653338caa4b45bf09b0bb572b353b8b1a6b450bc603475991c750d284b0ffa17bd7b2fee219c8bbf67179bfa3795e36b8e1df4ba4300cb
|
7
|
+
data.tar.gz: '087d61b21d791ffdd7e21739a4160825d80eaa642ee2b60e714963283c2e67f9a9916724c7753de98ea4f8c28ed2bf40c1f22bc7a1940987c4938275e9b2b49d'
|
@@ -49,13 +49,12 @@ module Google
|
|
49
49
|
# See {::Google::Cloud::Monitoring::V3::AlertPolicyService::Client::Configuration}
|
50
50
|
# for a description of the configuration fields.
|
51
51
|
#
|
52
|
-
#
|
52
|
+
# @example
|
53
53
|
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
# end
|
54
|
+
# # Modify the configuration for all AlertPolicyService clients
|
55
|
+
# ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.configure do |config|
|
56
|
+
# config.timeout = 10.0
|
57
|
+
# end
|
59
58
|
#
|
60
59
|
# @yield [config] Configure the Client client.
|
61
60
|
# @yieldparam config [Client::Configuration]
|
@@ -75,19 +74,19 @@ module Google
|
|
75
74
|
|
76
75
|
default_config.rpcs.list_alert_policies.timeout = 30.0
|
77
76
|
default_config.rpcs.list_alert_policies.retry_policy = {
|
78
|
-
initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [
|
77
|
+
initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
|
79
78
|
}
|
80
79
|
|
81
80
|
default_config.rpcs.get_alert_policy.timeout = 30.0
|
82
81
|
default_config.rpcs.get_alert_policy.retry_policy = {
|
83
|
-
initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [
|
82
|
+
initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
|
84
83
|
}
|
85
84
|
|
86
85
|
default_config.rpcs.create_alert_policy.timeout = 30.0
|
87
86
|
|
88
87
|
default_config.rpcs.delete_alert_policy.timeout = 30.0
|
89
88
|
default_config.rpcs.delete_alert_policy.retry_policy = {
|
90
|
-
initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [
|
89
|
+
initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
|
91
90
|
}
|
92
91
|
|
93
92
|
default_config.rpcs.update_alert_policy.timeout = 30.0
|
@@ -121,19 +120,15 @@ module Google
|
|
121
120
|
##
|
122
121
|
# Create a new AlertPolicyService client object.
|
123
122
|
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
# To create a new AlertPolicyService client with the default
|
127
|
-
# configuration:
|
128
|
-
#
|
129
|
-
# client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
123
|
+
# @example
|
130
124
|
#
|
131
|
-
#
|
132
|
-
#
|
125
|
+
# # Create a client using the default configuration
|
126
|
+
# client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
133
127
|
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
128
|
+
# # Create a client using a custom configuration
|
129
|
+
# client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config|
|
130
|
+
# config.timeout = 10.0
|
131
|
+
# end
|
137
132
|
#
|
138
133
|
# @yield [config] Configure the AlertPolicyService client.
|
139
134
|
# @yieldparam config [Client::Configuration]
|
@@ -153,10 +148,9 @@ module Google
|
|
153
148
|
|
154
149
|
# Create credentials
|
155
150
|
credentials = @config.credentials
|
156
|
-
# Use self-signed JWT if the
|
151
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
157
152
|
# but only if the default endpoint does not have a region prefix.
|
158
|
-
enable_self_signed_jwt = @config.
|
159
|
-
@config.endpoint == Client.configure.endpoint &&
|
153
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
160
154
|
!@config.endpoint.split(".").first.include?("-")
|
161
155
|
credentials ||= Credentials.default scope: @config.scope,
|
162
156
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -196,7 +190,8 @@ module Google
|
|
196
190
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
197
191
|
#
|
198
192
|
# @param name [::String]
|
199
|
-
# Required. The project
|
193
|
+
# Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name)
|
194
|
+
# whose alert policies are to be listed. The format is:
|
200
195
|
#
|
201
196
|
# projects/[PROJECT_ID_OR_NUMBER]
|
202
197
|
#
|
@@ -233,6 +228,27 @@ module Google
|
|
233
228
|
#
|
234
229
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
235
230
|
#
|
231
|
+
# @example Basic example
|
232
|
+
# require "google/cloud/monitoring/v3"
|
233
|
+
#
|
234
|
+
# # Create a client object. The client can be reused for multiple calls.
|
235
|
+
# client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
236
|
+
#
|
237
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
238
|
+
# request = Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest.new
|
239
|
+
#
|
240
|
+
# # Call the list_alert_policies method.
|
241
|
+
# result = client.list_alert_policies request
|
242
|
+
#
|
243
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
244
|
+
# # iterate over all elements by calling #each, and the enumerable
|
245
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
246
|
+
# # methods are also available for managing paging directly.
|
247
|
+
# result.each do |response|
|
248
|
+
# # Each element is of type ::Google::Cloud::Monitoring::V3::AlertPolicy.
|
249
|
+
# p response
|
250
|
+
# end
|
251
|
+
#
|
236
252
|
def list_alert_policies request, options = nil
|
237
253
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
238
254
|
|
@@ -250,16 +266,20 @@ module Google
|
|
250
266
|
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
251
267
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
252
268
|
|
253
|
-
header_params = {
|
254
|
-
|
255
|
-
|
269
|
+
header_params = {}
|
270
|
+
if request.name
|
271
|
+
header_params["name"] = request.name
|
272
|
+
end
|
273
|
+
|
256
274
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
257
275
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
258
276
|
|
259
277
|
options.apply_defaults timeout: @config.rpcs.list_alert_policies.timeout,
|
260
278
|
metadata: metadata,
|
261
279
|
retry_policy: @config.rpcs.list_alert_policies.retry_policy
|
262
|
-
|
280
|
+
|
281
|
+
options.apply_defaults timeout: @config.timeout,
|
282
|
+
metadata: @config.metadata,
|
263
283
|
retry_policy: @config.retry_policy
|
264
284
|
|
265
285
|
@alert_policy_service_stub.call_rpc :list_alert_policies, request, options: options do |response, operation|
|
@@ -302,6 +322,21 @@ module Google
|
|
302
322
|
#
|
303
323
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
304
324
|
#
|
325
|
+
# @example Basic example
|
326
|
+
# require "google/cloud/monitoring/v3"
|
327
|
+
#
|
328
|
+
# # Create a client object. The client can be reused for multiple calls.
|
329
|
+
# client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
330
|
+
#
|
331
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
332
|
+
# request = Google::Cloud::Monitoring::V3::GetAlertPolicyRequest.new
|
333
|
+
#
|
334
|
+
# # Call the get_alert_policy method.
|
335
|
+
# result = client.get_alert_policy request
|
336
|
+
#
|
337
|
+
# # The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy.
|
338
|
+
# p result
|
339
|
+
#
|
305
340
|
def get_alert_policy request, options = nil
|
306
341
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
307
342
|
|
@@ -319,16 +354,20 @@ module Google
|
|
319
354
|
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
320
355
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
321
356
|
|
322
|
-
header_params = {
|
323
|
-
|
324
|
-
|
357
|
+
header_params = {}
|
358
|
+
if request.name
|
359
|
+
header_params["name"] = request.name
|
360
|
+
end
|
361
|
+
|
325
362
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
326
363
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
327
364
|
|
328
365
|
options.apply_defaults timeout: @config.rpcs.get_alert_policy.timeout,
|
329
366
|
metadata: metadata,
|
330
367
|
retry_policy: @config.rpcs.get_alert_policy.retry_policy
|
331
|
-
|
368
|
+
|
369
|
+
options.apply_defaults timeout: @config.timeout,
|
370
|
+
metadata: @config.metadata,
|
332
371
|
retry_policy: @config.retry_policy
|
333
372
|
|
334
373
|
@alert_policy_service_stub.call_rpc :get_alert_policy, request, options: options do |response, operation|
|
@@ -358,7 +397,8 @@ module Google
|
|
358
397
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
359
398
|
#
|
360
399
|
# @param name [::String]
|
361
|
-
# Required. The project in
|
400
|
+
# Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) in
|
401
|
+
# which to create the alerting policy. The format is:
|
362
402
|
#
|
363
403
|
# projects/[PROJECT_ID_OR_NUMBER]
|
364
404
|
#
|
@@ -382,6 +422,21 @@ module Google
|
|
382
422
|
#
|
383
423
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
384
424
|
#
|
425
|
+
# @example Basic example
|
426
|
+
# require "google/cloud/monitoring/v3"
|
427
|
+
#
|
428
|
+
# # Create a client object. The client can be reused for multiple calls.
|
429
|
+
# client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
430
|
+
#
|
431
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
432
|
+
# request = Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest.new
|
433
|
+
#
|
434
|
+
# # Call the create_alert_policy method.
|
435
|
+
# result = client.create_alert_policy request
|
436
|
+
#
|
437
|
+
# # The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy.
|
438
|
+
# p result
|
439
|
+
#
|
385
440
|
def create_alert_policy request, options = nil
|
386
441
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
387
442
|
|
@@ -399,16 +454,20 @@ module Google
|
|
399
454
|
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
400
455
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
401
456
|
|
402
|
-
header_params = {
|
403
|
-
|
404
|
-
|
457
|
+
header_params = {}
|
458
|
+
if request.name
|
459
|
+
header_params["name"] = request.name
|
460
|
+
end
|
461
|
+
|
405
462
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
406
463
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
407
464
|
|
408
465
|
options.apply_defaults timeout: @config.rpcs.create_alert_policy.timeout,
|
409
466
|
metadata: metadata,
|
410
467
|
retry_policy: @config.rpcs.create_alert_policy.retry_policy
|
411
|
-
|
468
|
+
|
469
|
+
options.apply_defaults timeout: @config.timeout,
|
470
|
+
metadata: @config.metadata,
|
412
471
|
retry_policy: @config.retry_policy
|
413
472
|
|
414
473
|
@alert_policy_service_stub.call_rpc :create_alert_policy, request, options: options do |response, operation|
|
@@ -452,6 +511,21 @@ module Google
|
|
452
511
|
#
|
453
512
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
454
513
|
#
|
514
|
+
# @example Basic example
|
515
|
+
# require "google/cloud/monitoring/v3"
|
516
|
+
#
|
517
|
+
# # Create a client object. The client can be reused for multiple calls.
|
518
|
+
# client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
519
|
+
#
|
520
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
521
|
+
# request = Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest.new
|
522
|
+
#
|
523
|
+
# # Call the delete_alert_policy method.
|
524
|
+
# result = client.delete_alert_policy request
|
525
|
+
#
|
526
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
527
|
+
# p result
|
528
|
+
#
|
455
529
|
def delete_alert_policy request, options = nil
|
456
530
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
457
531
|
|
@@ -469,16 +543,20 @@ module Google
|
|
469
543
|
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
470
544
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
471
545
|
|
472
|
-
header_params = {
|
473
|
-
|
474
|
-
|
546
|
+
header_params = {}
|
547
|
+
if request.name
|
548
|
+
header_params["name"] = request.name
|
549
|
+
end
|
550
|
+
|
475
551
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
476
552
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
477
553
|
|
478
554
|
options.apply_defaults timeout: @config.rpcs.delete_alert_policy.timeout,
|
479
555
|
metadata: metadata,
|
480
556
|
retry_policy: @config.rpcs.delete_alert_policy.retry_policy
|
481
|
-
|
557
|
+
|
558
|
+
options.apply_defaults timeout: @config.timeout,
|
559
|
+
metadata: @config.metadata,
|
482
560
|
retry_policy: @config.retry_policy
|
483
561
|
|
484
562
|
@alert_policy_service_stub.call_rpc :delete_alert_policy, request, options: options do |response, operation|
|
@@ -546,6 +624,21 @@ module Google
|
|
546
624
|
#
|
547
625
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
548
626
|
#
|
627
|
+
# @example Basic example
|
628
|
+
# require "google/cloud/monitoring/v3"
|
629
|
+
#
|
630
|
+
# # Create a client object. The client can be reused for multiple calls.
|
631
|
+
# client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new
|
632
|
+
#
|
633
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
634
|
+
# request = Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest.new
|
635
|
+
#
|
636
|
+
# # Call the update_alert_policy method.
|
637
|
+
# result = client.update_alert_policy request
|
638
|
+
#
|
639
|
+
# # The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy.
|
640
|
+
# p result
|
641
|
+
#
|
549
642
|
def update_alert_policy request, options = nil
|
550
643
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
551
644
|
|
@@ -563,16 +656,20 @@ module Google
|
|
563
656
|
gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
|
564
657
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
565
658
|
|
566
|
-
header_params = {
|
567
|
-
|
568
|
-
|
659
|
+
header_params = {}
|
660
|
+
if request.alert_policy&.name
|
661
|
+
header_params["alert_policy.name"] = request.alert_policy.name
|
662
|
+
end
|
663
|
+
|
569
664
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
570
665
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
571
666
|
|
572
667
|
options.apply_defaults timeout: @config.rpcs.update_alert_policy.timeout,
|
573
668
|
metadata: metadata,
|
574
669
|
retry_policy: @config.rpcs.update_alert_policy.retry_policy
|
575
|
-
|
670
|
+
|
671
|
+
options.apply_defaults timeout: @config.timeout,
|
672
|
+
metadata: @config.metadata,
|
576
673
|
retry_policy: @config.retry_policy
|
577
674
|
|
578
675
|
@alert_policy_service_stub.call_rpc :update_alert_policy, request, options: options do |response, operation|
|
@@ -596,22 +693,21 @@ module Google
|
|
596
693
|
# Configuration can be applied globally to all clients, or to a single client
|
597
694
|
# on construction.
|
598
695
|
#
|
599
|
-
#
|
600
|
-
#
|
601
|
-
#
|
602
|
-
# to 20 seconds,
|
603
|
-
#
|
604
|
-
#
|
605
|
-
#
|
606
|
-
#
|
607
|
-
#
|
608
|
-
#
|
609
|
-
#
|
610
|
-
#
|
611
|
-
#
|
612
|
-
#
|
613
|
-
#
|
614
|
-
# end
|
696
|
+
# @example
|
697
|
+
#
|
698
|
+
# # Modify the global config, setting the timeout for
|
699
|
+
# # list_alert_policies to 20 seconds,
|
700
|
+
# # and all remaining timeouts to 10 seconds.
|
701
|
+
# ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.configure do |config|
|
702
|
+
# config.timeout = 10.0
|
703
|
+
# config.rpcs.list_alert_policies.timeout = 20.0
|
704
|
+
# end
|
705
|
+
#
|
706
|
+
# # Apply the above configuration only to a new client.
|
707
|
+
# client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new do |config|
|
708
|
+
# config.timeout = 10.0
|
709
|
+
# config.rpcs.list_alert_policies.timeout = 20.0
|
710
|
+
# end
|
615
711
|
#
|
616
712
|
# @!attribute [rw] endpoint
|
617
713
|
# The hostname or hostname:port of the service endpoint.
|