google-cloud-monitoring-v3 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +1 -1
  4. data/lib/google/cloud/monitoring/v3/alert_policy_service/client.rb +52 -56
  5. data/lib/google/cloud/monitoring/v3/alert_policy_service/paths.rb +14 -0
  6. data/lib/google/cloud/monitoring/v3/group_service/client.rb +58 -66
  7. data/lib/google/cloud/monitoring/v3/group_service/paths.rb +14 -0
  8. data/lib/google/cloud/monitoring/v3/metric_service/client.rb +72 -77
  9. data/lib/google/cloud/monitoring/v3/notification_channel_service/client.rb +75 -79
  10. data/lib/google/cloud/monitoring/v3/notification_channel_service/paths.rb +14 -0
  11. data/lib/google/cloud/monitoring/v3/query_service/client.rb +35 -39
  12. data/lib/google/cloud/monitoring/v3/service_monitoring_service/client.rb +70 -73
  13. data/lib/google/cloud/monitoring/v3/service_monitoring_service/paths.rb +14 -0
  14. data/lib/google/cloud/monitoring/v3/uptime_check_service/client.rb +56 -61
  15. data/lib/google/cloud/monitoring/v3/uptime_check_service/paths.rb +14 -0
  16. data/lib/google/cloud/monitoring/v3/version.rb +1 -1
  17. data/lib/google/monitoring/v3/alert_pb.rb +15 -0
  18. data/lib/google/monitoring/v3/common_pb.rb +0 -6
  19. data/lib/google/monitoring/v3/notification_pb.rb +0 -2
  20. data/lib/google/monitoring/v3/service_pb.rb +2 -0
  21. data/lib/google/monitoring/v3/uptime_service_pb.rb +1 -0
  22. data/proto_docs/google/api/distribution.rb +2 -2
  23. data/proto_docs/google/api/field_behavior.rb +7 -1
  24. data/proto_docs/google/api/launch_stage.rb +7 -1
  25. data/proto_docs/google/api/metric.rb +109 -36
  26. data/proto_docs/google/api/monitored_resource.rb +7 -6
  27. data/proto_docs/google/longrunning/operations.rb +164 -0
  28. data/proto_docs/google/monitoring/v3/alert.rb +66 -1
  29. data/proto_docs/google/monitoring/v3/alert_service.rb +4 -2
  30. data/proto_docs/google/monitoring/v3/common.rb +1 -13
  31. data/proto_docs/google/monitoring/v3/group_service.rb +4 -2
  32. data/proto_docs/google/monitoring/v3/metric.rb +3 -1
  33. data/proto_docs/google/monitoring/v3/metric_service.rb +13 -8
  34. data/proto_docs/google/monitoring/v3/notification.rb +0 -4
  35. data/proto_docs/google/monitoring/v3/notification_service.rb +8 -4
  36. data/proto_docs/google/monitoring/v3/service.rb +38 -6
  37. data/proto_docs/google/monitoring/v3/service_service.rb +4 -2
  38. data/proto_docs/google/monitoring/v3/span_context.rb +2 -2
  39. data/proto_docs/google/monitoring/v3/uptime.rb +5 -2
  40. data/proto_docs/google/monitoring/v3/uptime_service.rb +4 -2
  41. metadata +14 -7
@@ -156,6 +156,20 @@ module Google
156
156
  "organizations/#{organization}"
157
157
  end
158
158
 
159
+ ##
160
+ # Create a fully-qualified Project resource string.
161
+ #
162
+ # The resource will be in the following format:
163
+ #
164
+ # `projects/{project}`
165
+ #
166
+ # @param project [String]
167
+ #
168
+ # @return [::String]
169
+ def project_path project:
170
+ "projects/#{project}"
171
+ end
172
+
159
173
  ##
160
174
  # Create a fully-qualified Workspace resource string.
161
175
  #
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Monitoring::V3::QueryService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all QueryService clients:
47
- #
48
- # ::Google::Cloud::Monitoring::V3::QueryService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all QueryService clients
47
+ # ::Google::Cloud::Monitoring::V3::QueryService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -94,19 +93,15 @@ module Google
94
93
  ##
95
94
  # Create a new QueryService client object.
96
95
  #
97
- # ## Examples
98
- #
99
- # To create a new QueryService client with the default
100
- # configuration:
96
+ # @example
101
97
  #
102
- # client = ::Google::Cloud::Monitoring::V3::QueryService::Client.new
98
+ # # Create a client using the default configuration
99
+ # client = ::Google::Cloud::Monitoring::V3::QueryService::Client.new
103
100
  #
104
- # To create a new QueryService client with a custom
105
- # configuration:
106
- #
107
- # client = ::Google::Cloud::Monitoring::V3::QueryService::Client.new do |config|
108
- # config.timeout = 10.0
109
- # end
101
+ # # Create a client using a custom configuration
102
+ # client = ::Google::Cloud::Monitoring::V3::QueryService::Client.new do |config|
103
+ # config.timeout = 10.0
104
+ # end
110
105
  #
111
106
  # @yield [config] Configure the QueryService client.
112
107
  # @yieldparam config [Client::Configuration]
@@ -126,14 +121,13 @@ module Google
126
121
 
127
122
  # Create credentials
128
123
  credentials = @config.credentials
129
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
124
+ # Use self-signed JWT if the endpoint is unchanged from default,
130
125
  # but only if the default endpoint does not have a region prefix.
131
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
132
- @config.endpoint == Client.configure.endpoint &&
126
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
133
127
  !@config.endpoint.split(".").first.include?("-")
134
128
  credentials ||= Credentials.default scope: @config.scope,
135
129
  enable_self_signed_jwt: enable_self_signed_jwt
136
- if credentials.is_a?(String) || credentials.is_a?(Hash)
130
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
137
131
  credentials = Credentials.new credentials, scope: @config.scope
138
132
  end
139
133
  @quota_project_id = @config.quota_project
@@ -169,7 +163,8 @@ module Google
169
163
  # the default parameter values, pass an empty Hash as a request object (see above).
170
164
  #
171
165
  # @param name [::String]
172
- # Required. The project on which to execute the request. The format is:
166
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
167
+ # which to execute the request. The format is:
173
168
  #
174
169
  # projects/[PROJECT_ID_OR_NUMBER]
175
170
  # @param query [::String]
@@ -217,7 +212,9 @@ module Google
217
212
  options.apply_defaults timeout: @config.rpcs.query_time_series.timeout,
218
213
  metadata: metadata,
219
214
  retry_policy: @config.rpcs.query_time_series.retry_policy
220
- options.apply_defaults metadata: @config.metadata,
215
+
216
+ options.apply_defaults timeout: @config.timeout,
217
+ metadata: @config.metadata,
221
218
  retry_policy: @config.retry_policy
222
219
 
223
220
  @query_service_stub.call_rpc :query_time_series, request, options: options do |response, operation|
@@ -242,22 +239,21 @@ module Google
242
239
  # Configuration can be applied globally to all clients, or to a single client
243
240
  # on construction.
244
241
  #
245
- # # Examples
246
- #
247
- # To modify the global config, setting the timeout for query_time_series
248
- # to 20 seconds, and all remaining timeouts to 10 seconds:
249
- #
250
- # ::Google::Cloud::Monitoring::V3::QueryService::Client.configure do |config|
251
- # config.timeout = 10.0
252
- # config.rpcs.query_time_series.timeout = 20.0
253
- # end
254
- #
255
- # To apply the above configuration only to a new client:
256
- #
257
- # client = ::Google::Cloud::Monitoring::V3::QueryService::Client.new do |config|
258
- # config.timeout = 10.0
259
- # config.rpcs.query_time_series.timeout = 20.0
260
- # end
242
+ # @example
243
+ #
244
+ # # Modify the global config, setting the timeout for
245
+ # # query_time_series to 20 seconds,
246
+ # # and all remaining timeouts to 10 seconds.
247
+ # ::Google::Cloud::Monitoring::V3::QueryService::Client.configure do |config|
248
+ # config.timeout = 10.0
249
+ # config.rpcs.query_time_series.timeout = 20.0
250
+ # end
251
+ #
252
+ # # Apply the above configuration only to a new client.
253
+ # client = ::Google::Cloud::Monitoring::V3::QueryService::Client.new do |config|
254
+ # config.timeout = 10.0
255
+ # config.rpcs.query_time_series.timeout = 20.0
256
+ # end
261
257
  #
262
258
  # @!attribute [rw] endpoint
263
259
  # The hostname or hostname:port of the service endpoint.
@@ -44,13 +44,12 @@ module Google
44
44
  # See {::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client::Configuration}
45
45
  # for a description of the configuration fields.
46
46
  #
47
- # ## Example
47
+ # @example
48
48
  #
49
- # To modify the configuration for all ServiceMonitoringService clients:
50
- #
51
- # ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.configure do |config|
52
- # config.timeout = 10.0
53
- # end
49
+ # # Modify the configuration for all ServiceMonitoringService clients
50
+ # ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
54
53
  #
55
54
  # @yield [config] Configure the Client client.
56
55
  # @yieldparam config [Client::Configuration]
@@ -72,56 +71,38 @@ module Google
72
71
 
73
72
  default_config.rpcs.get_service.timeout = 30.0
74
73
  default_config.rpcs.get_service.retry_policy = {
75
- initial_delay: 0.1,
76
- max_delay: 30.0,
77
- multiplier: 1.3,
78
- retry_codes: [4, 14]
74
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
79
75
  }
80
76
 
81
77
  default_config.rpcs.list_services.timeout = 30.0
82
78
  default_config.rpcs.list_services.retry_policy = {
83
- initial_delay: 0.1,
84
- max_delay: 30.0,
85
- multiplier: 1.3,
86
- retry_codes: [4, 14]
79
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
87
80
  }
88
81
 
89
82
  default_config.rpcs.update_service.timeout = 30.0
90
83
 
91
84
  default_config.rpcs.delete_service.timeout = 30.0
92
85
  default_config.rpcs.delete_service.retry_policy = {
93
- initial_delay: 0.1,
94
- max_delay: 30.0,
95
- multiplier: 1.3,
96
- retry_codes: [4, 14]
86
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
97
87
  }
98
88
 
99
89
  default_config.rpcs.create_service_level_objective.timeout = 30.0
100
90
 
101
91
  default_config.rpcs.get_service_level_objective.timeout = 30.0
102
92
  default_config.rpcs.get_service_level_objective.retry_policy = {
103
- initial_delay: 0.1,
104
- max_delay: 30.0,
105
- multiplier: 1.3,
106
- retry_codes: [4, 14]
93
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
107
94
  }
108
95
 
109
96
  default_config.rpcs.list_service_level_objectives.timeout = 30.0
110
97
  default_config.rpcs.list_service_level_objectives.retry_policy = {
111
- initial_delay: 0.1,
112
- max_delay: 30.0,
113
- multiplier: 1.3,
114
- retry_codes: [4, 14]
98
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
115
99
  }
116
100
 
117
101
  default_config.rpcs.update_service_level_objective.timeout = 30.0
118
102
 
119
103
  default_config.rpcs.delete_service_level_objective.timeout = 30.0
120
104
  default_config.rpcs.delete_service_level_objective.retry_policy = {
121
- initial_delay: 0.1,
122
- max_delay: 30.0,
123
- multiplier: 1.3,
124
- retry_codes: [4, 14]
105
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
125
106
  }
126
107
 
127
108
  default_config
@@ -153,19 +134,15 @@ module Google
153
134
  ##
154
135
  # Create a new ServiceMonitoringService client object.
155
136
  #
156
- # ## Examples
157
- #
158
- # To create a new ServiceMonitoringService client with the default
159
- # configuration:
160
- #
161
- # client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new
137
+ # @example
162
138
  #
163
- # To create a new ServiceMonitoringService client with a custom
164
- # configuration:
139
+ # # Create a client using the default configuration
140
+ # client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new
165
141
  #
166
- # client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config|
167
- # config.timeout = 10.0
168
- # end
142
+ # # Create a client using a custom configuration
143
+ # client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config|
144
+ # config.timeout = 10.0
145
+ # end
169
146
  #
170
147
  # @yield [config] Configure the ServiceMonitoringService client.
171
148
  # @yieldparam config [Client::Configuration]
@@ -185,14 +162,13 @@ module Google
185
162
 
186
163
  # Create credentials
187
164
  credentials = @config.credentials
188
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
165
+ # Use self-signed JWT if the endpoint is unchanged from default,
189
166
  # but only if the default endpoint does not have a region prefix.
190
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
191
- @config.endpoint == Client.configure.endpoint &&
167
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
192
168
  !@config.endpoint.split(".").first.include?("-")
193
169
  credentials ||= Credentials.default scope: @config.scope,
194
170
  enable_self_signed_jwt: enable_self_signed_jwt
195
- if credentials.is_a?(String) || credentials.is_a?(Hash)
171
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
196
172
  credentials = Credentials.new credentials, scope: @config.scope
197
173
  end
198
174
  @quota_project_id = @config.quota_project
@@ -228,7 +204,8 @@ module Google
228
204
  # the default parameter values, pass an empty Hash as a request object (see above).
229
205
  #
230
206
  # @param parent [::String]
231
- # Required. Resource name of the parent workspace. The format is:
207
+ # Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of
208
+ # the parent workspace. The format is:
232
209
  #
233
210
  # projects/[PROJECT_ID_OR_NUMBER]
234
211
  # @param service_id [::String]
@@ -271,7 +248,9 @@ module Google
271
248
  options.apply_defaults timeout: @config.rpcs.create_service.timeout,
272
249
  metadata: metadata,
273
250
  retry_policy: @config.rpcs.create_service.retry_policy
274
- options.apply_defaults metadata: @config.metadata,
251
+
252
+ options.apply_defaults timeout: @config.timeout,
253
+ metadata: @config.metadata,
275
254
  retry_policy: @config.retry_policy
276
255
 
277
256
  @service_monitoring_service_stub.call_rpc :create_service, request, options: options do |response, operation|
@@ -339,7 +318,9 @@ module Google
339
318
  options.apply_defaults timeout: @config.rpcs.get_service.timeout,
340
319
  metadata: metadata,
341
320
  retry_policy: @config.rpcs.get_service.retry_policy
342
- options.apply_defaults metadata: @config.metadata,
321
+
322
+ options.apply_defaults timeout: @config.timeout,
323
+ metadata: @config.metadata,
343
324
  retry_policy: @config.retry_policy
344
325
 
345
326
  @service_monitoring_service_stub.call_rpc :get_service, request, options: options do |response, operation|
@@ -370,7 +351,8 @@ module Google
370
351
  #
371
352
  # @param parent [::String]
372
353
  # Required. Resource name of the parent containing the listed services, either a
373
- # project or a Monitoring Workspace. The formats are:
354
+ # [project](https://cloud.google.com/monitoring/api/v3#project_name) or a
355
+ # Monitoring Workspace. The formats are:
374
356
  #
375
357
  # projects/[PROJECT_ID_OR_NUMBER]
376
358
  # workspaces/[HOST_PROJECT_ID_OR_NUMBER]
@@ -436,7 +418,9 @@ module Google
436
418
  options.apply_defaults timeout: @config.rpcs.list_services.timeout,
437
419
  metadata: metadata,
438
420
  retry_policy: @config.rpcs.list_services.retry_policy
439
- options.apply_defaults metadata: @config.metadata,
421
+
422
+ options.apply_defaults timeout: @config.timeout,
423
+ metadata: @config.metadata,
440
424
  retry_policy: @config.retry_policy
441
425
 
442
426
  @service_monitoring_service_stub.call_rpc :list_services, request, options: options do |response, operation|
@@ -506,7 +490,9 @@ module Google
506
490
  options.apply_defaults timeout: @config.rpcs.update_service.timeout,
507
491
  metadata: metadata,
508
492
  retry_policy: @config.rpcs.update_service.retry_policy
509
- options.apply_defaults metadata: @config.metadata,
493
+
494
+ options.apply_defaults timeout: @config.timeout,
495
+ metadata: @config.metadata,
510
496
  retry_policy: @config.retry_policy
511
497
 
512
498
  @service_monitoring_service_stub.call_rpc :update_service, request, options: options do |response, operation|
@@ -574,7 +560,9 @@ module Google
574
560
  options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
575
561
  metadata: metadata,
576
562
  retry_policy: @config.rpcs.delete_service.retry_policy
577
- options.apply_defaults metadata: @config.metadata,
563
+
564
+ options.apply_defaults timeout: @config.timeout,
565
+ metadata: @config.metadata,
578
566
  retry_policy: @config.retry_policy
579
567
 
580
568
  @service_monitoring_service_stub.call_rpc :delete_service, request, options: options do |response, operation|
@@ -650,7 +638,9 @@ module Google
650
638
  options.apply_defaults timeout: @config.rpcs.create_service_level_objective.timeout,
651
639
  metadata: metadata,
652
640
  retry_policy: @config.rpcs.create_service_level_objective.retry_policy
653
- options.apply_defaults metadata: @config.metadata,
641
+
642
+ options.apply_defaults timeout: @config.timeout,
643
+ metadata: @config.metadata,
654
644
  retry_policy: @config.retry_policy
655
645
 
656
646
  @service_monitoring_service_stub.call_rpc :create_service_level_objective, request, options: options do |response, operation|
@@ -723,7 +713,9 @@ module Google
723
713
  options.apply_defaults timeout: @config.rpcs.get_service_level_objective.timeout,
724
714
  metadata: metadata,
725
715
  retry_policy: @config.rpcs.get_service_level_objective.retry_policy
726
- options.apply_defaults metadata: @config.metadata,
716
+
717
+ options.apply_defaults timeout: @config.timeout,
718
+ metadata: @config.metadata,
727
719
  retry_policy: @config.retry_policy
728
720
 
729
721
  @service_monitoring_service_stub.call_rpc :get_service_level_objective, request, options: options do |response, operation|
@@ -807,7 +799,9 @@ module Google
807
799
  options.apply_defaults timeout: @config.rpcs.list_service_level_objectives.timeout,
808
800
  metadata: metadata,
809
801
  retry_policy: @config.rpcs.list_service_level_objectives.retry_policy
810
- options.apply_defaults metadata: @config.metadata,
802
+
803
+ options.apply_defaults timeout: @config.timeout,
804
+ metadata: @config.metadata,
811
805
  retry_policy: @config.retry_policy
812
806
 
813
807
  @service_monitoring_service_stub.call_rpc :list_service_level_objectives, request, options: options do |response, operation|
@@ -877,7 +871,9 @@ module Google
877
871
  options.apply_defaults timeout: @config.rpcs.update_service_level_objective.timeout,
878
872
  metadata: metadata,
879
873
  retry_policy: @config.rpcs.update_service_level_objective.retry_policy
880
- options.apply_defaults metadata: @config.metadata,
874
+
875
+ options.apply_defaults timeout: @config.timeout,
876
+ metadata: @config.metadata,
881
877
  retry_policy: @config.retry_policy
882
878
 
883
879
  @service_monitoring_service_stub.call_rpc :update_service_level_objective, request, options: options do |response, operation|
@@ -945,7 +941,9 @@ module Google
945
941
  options.apply_defaults timeout: @config.rpcs.delete_service_level_objective.timeout,
946
942
  metadata: metadata,
947
943
  retry_policy: @config.rpcs.delete_service_level_objective.retry_policy
948
- options.apply_defaults metadata: @config.metadata,
944
+
945
+ options.apply_defaults timeout: @config.timeout,
946
+ metadata: @config.metadata,
949
947
  retry_policy: @config.retry_policy
950
948
 
951
949
  @service_monitoring_service_stub.call_rpc :delete_service_level_objective, request, options: options do |response, operation|
@@ -969,22 +967,21 @@ module Google
969
967
  # Configuration can be applied globally to all clients, or to a single client
970
968
  # on construction.
971
969
  #
972
- # # Examples
973
- #
974
- # To modify the global config, setting the timeout for create_service
975
- # to 20 seconds, and all remaining timeouts to 10 seconds:
976
- #
977
- # ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.configure do |config|
978
- # config.timeout = 10.0
979
- # config.rpcs.create_service.timeout = 20.0
980
- # end
981
- #
982
- # To apply the above configuration only to a new client:
983
- #
984
- # client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config|
985
- # config.timeout = 10.0
986
- # config.rpcs.create_service.timeout = 20.0
987
- # end
970
+ # @example
971
+ #
972
+ # # Modify the global config, setting the timeout for
973
+ # # create_service to 20 seconds,
974
+ # # and all remaining timeouts to 10 seconds.
975
+ # ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.configure do |config|
976
+ # config.timeout = 10.0
977
+ # config.rpcs.create_service.timeout = 20.0
978
+ # end
979
+ #
980
+ # # Apply the above configuration only to a new client.
981
+ # client = ::Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new do |config|
982
+ # config.timeout = 10.0
983
+ # config.rpcs.create_service.timeout = 20.0
984
+ # end
988
985
  #
989
986
  # @!attribute [rw] endpoint
990
987
  # The hostname or hostname:port of the service endpoint.
@@ -52,6 +52,20 @@ module Google
52
52
  "organizations/#{organization}"
53
53
  end
54
54
 
55
+ ##
56
+ # Create a fully-qualified Project resource string.
57
+ #
58
+ # The resource will be in the following format:
59
+ #
60
+ # `projects/{project}`
61
+ #
62
+ # @param project [String]
63
+ #
64
+ # @return [::String]
65
+ def project_path project:
66
+ "projects/#{project}"
67
+ end
68
+
55
69
  ##
56
70
  # Create a fully-qualified Service resource string.
57
71
  #