google-cloud-monitoring 0.38.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -54
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +361 -0
  6. data/README.md +34 -50
  7. data/lib/google-cloud-monitoring.rb +6 -5
  8. data/lib/google/cloud/monitoring.rb +255 -443
  9. data/lib/google/cloud/monitoring/dashboard.rb +88 -117
  10. data/lib/google/cloud/monitoring/{v3/doc/google/protobuf/wrappers.rb → dashboard/version.rb} +12 -9
  11. data/lib/google/cloud/monitoring/version.rb +6 -2
  12. metadata +71 -128
  13. data/LICENSE +0 -201
  14. data/lib/google/cloud/monitoring/dashboard/v1.rb +0 -148
  15. data/lib/google/cloud/monitoring/dashboard/v1/credentials.rb +0 -46
  16. data/lib/google/cloud/monitoring/dashboard/v1/dashboards_service_client.rb +0 -457
  17. data/lib/google/cloud/monitoring/dashboard/v1/dashboards_service_client_config.json +0 -51
  18. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/monitoring/dashboard/v1/common.rb +0 -394
  19. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/monitoring/dashboard/v1/dashboard.rb +0 -53
  20. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/monitoring/dashboard/v1/dashboards_service.rb +0 -82
  21. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/monitoring/dashboard/v1/layouts.rb +0 -71
  22. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/monitoring/dashboard/v1/metrics.rb +0 -151
  23. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/monitoring/dashboard/v1/scorecard.rb +0 -102
  24. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/monitoring/dashboard/v1/text.rb +0 -43
  25. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/monitoring/dashboard/v1/widget.rb +0 -41
  26. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/monitoring/dashboard/v1/xychart.rb +0 -141
  27. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/protobuf/duration.rb +0 -91
  28. data/lib/google/cloud/monitoring/dashboard/v1/doc/google/protobuf/empty.rb +0 -29
  29. data/lib/google/cloud/monitoring/v3.rb +0 -532
  30. data/lib/google/cloud/monitoring/v3/alert_policy_service_client.rb +0 -553
  31. data/lib/google/cloud/monitoring/v3/alert_policy_service_client_config.json +0 -51
  32. data/lib/google/cloud/monitoring/v3/credentials.rb +0 -44
  33. data/lib/google/cloud/monitoring/v3/doc/google/api/distribution.rb +0 -200
  34. data/lib/google/cloud/monitoring/v3/doc/google/api/label.rb +0 -42
  35. data/lib/google/cloud/monitoring/v3/doc/google/api/metric.rb +0 -245
  36. data/lib/google/cloud/monitoring/v3/doc/google/api/monitored_resource.rb +0 -108
  37. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/alert.rb +0 -344
  38. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/alert_service.rb +0 -138
  39. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/common.rb +0 -449
  40. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/group.rb +0 -75
  41. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/group_service.rb +0 -167
  42. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/metric.rb +0 -85
  43. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/metric_service.rb +0 -230
  44. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/mutation_record.rb +0 -29
  45. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/notification.rb +0 -156
  46. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/notification_service.rb +0 -221
  47. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/service.rb +0 -361
  48. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/service_service.rb +0 -197
  49. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/uptime.rb +0 -364
  50. data/lib/google/cloud/monitoring/v3/doc/google/monitoring/v3/uptime_service.rb +0 -136
  51. data/lib/google/cloud/monitoring/v3/doc/google/protobuf/any.rb +0 -131
  52. data/lib/google/cloud/monitoring/v3/doc/google/protobuf/duration.rb +0 -91
  53. data/lib/google/cloud/monitoring/v3/doc/google/protobuf/empty.rb +0 -29
  54. data/lib/google/cloud/monitoring/v3/doc/google/protobuf/field_mask.rb +0 -222
  55. data/lib/google/cloud/monitoring/v3/doc/google/protobuf/struct.rb +0 -74
  56. data/lib/google/cloud/monitoring/v3/doc/google/protobuf/timestamp.rb +0 -113
  57. data/lib/google/cloud/monitoring/v3/doc/google/rpc/status.rb +0 -39
  58. data/lib/google/cloud/monitoring/v3/group_service_client.rb +0 -606
  59. data/lib/google/cloud/monitoring/v3/group_service_client_config.json +0 -56
  60. data/lib/google/cloud/monitoring/v3/metric_service_client.rb +0 -750
  61. data/lib/google/cloud/monitoring/v3/metric_service_client_config.json +0 -66
  62. data/lib/google/cloud/monitoring/v3/notification_channel_service_client.rb +0 -811
  63. data/lib/google/cloud/monitoring/v3/notification_channel_service_client_config.json +0 -76
  64. data/lib/google/cloud/monitoring/v3/service_monitoring_service_client.rb +0 -788
  65. data/lib/google/cloud/monitoring/v3/service_monitoring_service_client_config.json +0 -76
  66. data/lib/google/cloud/monitoring/v3/uptime_check_service_client.rb +0 -550
  67. data/lib/google/cloud/monitoring/v3/uptime_check_service_client_config.json +0 -56
  68. data/lib/google/monitoring/dashboard/v1/common_pb.rb +0 -95
  69. data/lib/google/monitoring/dashboard/v1/dashboard_pb.rb +0 -29
  70. data/lib/google/monitoring/dashboard/v1/dashboards_service_pb.rb +0 -51
  71. data/lib/google/monitoring/dashboard/v1/dashboards_service_services_pb.rb +0 -76
  72. data/lib/google/monitoring/dashboard/v1/drilldowns_pb.rb +0 -17
  73. data/lib/google/monitoring/dashboard/v1/layouts_pb.rb +0 -41
  74. data/lib/google/monitoring/dashboard/v1/metrics_pb.rb +0 -76
  75. data/lib/google/monitoring/dashboard/v1/scorecard_pb.rb +0 -38
  76. data/lib/google/monitoring/dashboard/v1/service_pb.rb +0 -17
  77. data/lib/google/monitoring/dashboard/v1/text_pb.rb +0 -28
  78. data/lib/google/monitoring/dashboard/v1/widget_pb.rb +0 -32
  79. data/lib/google/monitoring/dashboard/v1/xychart_pb.rb +0 -66
  80. data/lib/google/monitoring/v3/alert_pb.rb +0 -87
  81. data/lib/google/monitoring/v3/alert_service_pb.rb +0 -53
  82. data/lib/google/monitoring/v3/alert_service_services_pb.rb +0 -63
  83. data/lib/google/monitoring/v3/common_pb.rb +0 -95
  84. data/lib/google/monitoring/v3/dropped_labels_pb.rb +0 -19
  85. data/lib/google/monitoring/v3/group_pb.rb +0 -24
  86. data/lib/google/monitoring/v3/group_service_pb.rb +0 -73
  87. data/lib/google/monitoring/v3/group_service_services_pb.rb +0 -66
  88. data/lib/google/monitoring/v3/metric_pb.rb +0 -82
  89. data/lib/google/monitoring/v3/metric_service_pb.rb +0 -130
  90. data/lib/google/monitoring/v3/metric_service_services_pb.rb +0 -66
  91. data/lib/google/monitoring/v3/mutation_record_pb.rb +0 -21
  92. data/lib/google/monitoring/v3/notification_pb.rb +0 -47
  93. data/lib/google/monitoring/v3/notification_service_pb.rb +0 -90
  94. data/lib/google/monitoring/v3/notification_service_services_pb.rb +0 -94
  95. data/lib/google/monitoring/v3/service_pb.rb +0 -149
  96. data/lib/google/monitoring/v3/service_service_pb.rb +0 -86
  97. data/lib/google/monitoring/v3/service_service_services_pb.rb +0 -65
  98. data/lib/google/monitoring/v3/span_context_pb.rb +0 -19
  99. data/lib/google/monitoring/v3/uptime_pb.rb +0 -123
  100. data/lib/google/monitoring/v3/uptime_service_pb.rb +0 -63
  101. data/lib/google/monitoring/v3/uptime_service_services_pb.rb +0 -67
@@ -1,76 +0,0 @@
1
- {
2
- "interfaces": {
3
- "google.monitoring.v3.ServiceMonitoringService": {
4
- "retry_codes": {
5
- "idempotent": [
6
- "DEADLINE_EXCEEDED",
7
- "UNAVAILABLE"
8
- ],
9
- "non_idempotent": []
10
- },
11
- "retry_params": {
12
- "default": {
13
- "initial_retry_delay_millis": 100,
14
- "retry_delay_multiplier": 1.3,
15
- "max_retry_delay_millis": 60000,
16
- "initial_rpc_timeout_millis": 20000,
17
- "rpc_timeout_multiplier": 1.0,
18
- "max_rpc_timeout_millis": 20000,
19
- "total_timeout_millis": 600000
20
- }
21
- },
22
- "methods": {
23
- "CreateService": {
24
- "timeout_millis": 60000,
25
- "retry_codes_name": "non_idempotent",
26
- "retry_params_name": "default"
27
- },
28
- "GetService": {
29
- "timeout_millis": 60000,
30
- "retry_codes_name": "idempotent",
31
- "retry_params_name": "default"
32
- },
33
- "ListServices": {
34
- "timeout_millis": 60000,
35
- "retry_codes_name": "idempotent",
36
- "retry_params_name": "default"
37
- },
38
- "UpdateService": {
39
- "timeout_millis": 60000,
40
- "retry_codes_name": "non_idempotent",
41
- "retry_params_name": "default"
42
- },
43
- "DeleteService": {
44
- "timeout_millis": 60000,
45
- "retry_codes_name": "idempotent",
46
- "retry_params_name": "default"
47
- },
48
- "CreateServiceLevelObjective": {
49
- "timeout_millis": 60000,
50
- "retry_codes_name": "non_idempotent",
51
- "retry_params_name": "default"
52
- },
53
- "GetServiceLevelObjective": {
54
- "timeout_millis": 60000,
55
- "retry_codes_name": "idempotent",
56
- "retry_params_name": "default"
57
- },
58
- "ListServiceLevelObjectives": {
59
- "timeout_millis": 60000,
60
- "retry_codes_name": "idempotent",
61
- "retry_params_name": "default"
62
- },
63
- "UpdateServiceLevelObjective": {
64
- "timeout_millis": 60000,
65
- "retry_codes_name": "non_idempotent",
66
- "retry_params_name": "default"
67
- },
68
- "DeleteServiceLevelObjective": {
69
- "timeout_millis": 60000,
70
- "retry_codes_name": "idempotent",
71
- "retry_params_name": "default"
72
- }
73
- }
74
- }
75
- }
76
- }
@@ -1,550 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
-
28
- require "google/monitoring/v3/uptime_service_pb"
29
- require "google/cloud/monitoring/v3/credentials"
30
- require "google/cloud/monitoring/version"
31
-
32
- module Google
33
- module Cloud
34
- module Monitoring
35
- module V3
36
- # The UptimeCheckService API is used to manage (list, create, delete, edit)
37
- # Uptime check configurations in the Stackdriver Monitoring product. An Uptime
38
- # check is a piece of configuration that determines which resources and
39
- # services to monitor for availability. These configurations can also be
40
- # configured interactively by navigating to the [Cloud Console]
41
- # (http://console.cloud.google.com), selecting the appropriate project,
42
- # clicking on "Monitoring" on the left-hand side to navigate to Stackdriver,
43
- # and then clicking on "Uptime".
44
- #
45
- # @!attribute [r] uptime_check_service_stub
46
- # @return [Google::Monitoring::V3::UptimeCheckService::Stub]
47
- class UptimeCheckServiceClient
48
- # @private
49
- attr_reader :uptime_check_service_stub
50
-
51
- # The default address of the service.
52
- SERVICE_ADDRESS = "monitoring.googleapis.com".freeze
53
-
54
- # The default port of the service.
55
- DEFAULT_SERVICE_PORT = 443
56
-
57
- # The default set of gRPC interceptors.
58
- GRPC_INTERCEPTORS = []
59
-
60
- DEFAULT_TIMEOUT = 30
61
-
62
- PAGE_DESCRIPTORS = {
63
- "list_uptime_check_configs" => Google::Gax::PageDescriptor.new(
64
- "page_token",
65
- "next_page_token",
66
- "uptime_check_configs"),
67
- "list_uptime_check_ips" => Google::Gax::PageDescriptor.new(
68
- "page_token",
69
- "next_page_token",
70
- "uptime_check_ips")
71
- }.freeze
72
-
73
- private_constant :PAGE_DESCRIPTORS
74
-
75
- # The scopes needed to make gRPC calls to all of the methods defined in
76
- # this service.
77
- ALL_SCOPES = [
78
- "https://www.googleapis.com/auth/cloud-platform",
79
- "https://www.googleapis.com/auth/monitoring",
80
- "https://www.googleapis.com/auth/monitoring.read",
81
- "https://www.googleapis.com/auth/monitoring.write"
82
- ].freeze
83
-
84
-
85
- PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
86
- "projects/{project}"
87
- )
88
-
89
- private_constant :PROJECT_PATH_TEMPLATE
90
-
91
- UPTIME_CHECK_CONFIG_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
92
- "projects/{project}/uptimeCheckConfigs/{uptime_check_config}"
93
- )
94
-
95
- private_constant :UPTIME_CHECK_CONFIG_PATH_TEMPLATE
96
-
97
- # Returns a fully-qualified project resource name string.
98
- # @param project [String]
99
- # @return [String]
100
- def self.project_path project
101
- PROJECT_PATH_TEMPLATE.render(
102
- :"project" => project
103
- )
104
- end
105
-
106
- # Returns a fully-qualified uptime_check_config resource name string.
107
- # @param project [String]
108
- # @param uptime_check_config [String]
109
- # @return [String]
110
- def self.uptime_check_config_path project, uptime_check_config
111
- UPTIME_CHECK_CONFIG_PATH_TEMPLATE.render(
112
- :"project" => project,
113
- :"uptime_check_config" => uptime_check_config
114
- )
115
- end
116
-
117
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
118
- # Provides the means for authenticating requests made by the client. This parameter can
119
- # be many types.
120
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
121
- # authenticating requests made by this client.
122
- # A `String` will be treated as the path to the keyfile to be used for the construction of
123
- # credentials for this client.
124
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
125
- # credentials for this client.
126
- # A `GRPC::Core::Channel` will be used to make calls through.
127
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
128
- # should already be composed with a `GRPC::Core::CallCredentials` object.
129
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
130
- # metadata for requests, generally, to give OAuth credentials.
131
- # @param scopes [Array<String>]
132
- # The OAuth scopes for this service. This parameter is ignored if
133
- # an updater_proc is supplied.
134
- # @param client_config [Hash]
135
- # A Hash for call options for each method. See
136
- # Google::Gax#construct_settings for the structure of
137
- # this data. Falls back to the default config if not specified
138
- # or the specified config is missing data points.
139
- # @param timeout [Numeric]
140
- # The default timeout, in seconds, for calls made through this client.
141
- # @param metadata [Hash]
142
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
143
- # @param service_address [String]
144
- # Override for the service hostname, or `nil` to leave as the default.
145
- # @param service_port [Integer]
146
- # Override for the service port, or `nil` to leave as the default.
147
- # @param exception_transformer [Proc]
148
- # An optional proc that intercepts any exceptions raised during an API call to inject
149
- # custom error handling.
150
- def initialize \
151
- credentials: nil,
152
- scopes: ALL_SCOPES,
153
- client_config: {},
154
- timeout: DEFAULT_TIMEOUT,
155
- metadata: nil,
156
- service_address: nil,
157
- service_port: nil,
158
- exception_transformer: nil,
159
- lib_name: nil,
160
- lib_version: ""
161
- # These require statements are intentionally placed here to initialize
162
- # the gRPC module only when it's required.
163
- # See https://github.com/googleapis/toolkit/issues/446
164
- require "google/gax/grpc"
165
- require "google/monitoring/v3/uptime_service_services_pb"
166
-
167
- credentials ||= Google::Cloud::Monitoring::V3::Credentials.default
168
-
169
- if credentials.is_a?(String) || credentials.is_a?(Hash)
170
- updater_proc = Google::Cloud::Monitoring::V3::Credentials.new(credentials).updater_proc
171
- end
172
- if credentials.is_a?(GRPC::Core::Channel)
173
- channel = credentials
174
- end
175
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
176
- chan_creds = credentials
177
- end
178
- if credentials.is_a?(Proc)
179
- updater_proc = credentials
180
- end
181
- if credentials.is_a?(Google::Auth::Credentials)
182
- updater_proc = credentials.updater_proc
183
- end
184
-
185
- package_version = Google::Cloud::Monitoring::VERSION
186
-
187
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
188
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
189
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
190
- google_api_client << " grpc/#{GRPC::VERSION}"
191
- google_api_client.freeze
192
-
193
- headers = { :"x-goog-api-client" => google_api_client }
194
- if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
195
- headers[:"x-goog-user-project"] = credentials.quota_project_id
196
- end
197
- headers.merge!(metadata) unless metadata.nil?
198
- client_config_file = Pathname.new(__dir__).join(
199
- "uptime_check_service_client_config.json"
200
- )
201
- defaults = client_config_file.open do |f|
202
- Google::Gax.construct_settings(
203
- "google.monitoring.v3.UptimeCheckService",
204
- JSON.parse(f.read),
205
- client_config,
206
- Google::Gax::Grpc::STATUS_CODE_NAMES,
207
- timeout,
208
- page_descriptors: PAGE_DESCRIPTORS,
209
- errors: Google::Gax::Grpc::API_ERRORS,
210
- metadata: headers
211
- )
212
- end
213
-
214
- # Allow overriding the service path/port in subclasses.
215
- service_path = service_address || self.class::SERVICE_ADDRESS
216
- port = service_port || self.class::DEFAULT_SERVICE_PORT
217
- interceptors = self.class::GRPC_INTERCEPTORS
218
- @uptime_check_service_stub = Google::Gax::Grpc.create_stub(
219
- service_path,
220
- port,
221
- chan_creds: chan_creds,
222
- channel: channel,
223
- updater_proc: updater_proc,
224
- scopes: scopes,
225
- interceptors: interceptors,
226
- &Google::Monitoring::V3::UptimeCheckService::Stub.method(:new)
227
- )
228
-
229
- @list_uptime_check_configs = Google::Gax.create_api_call(
230
- @uptime_check_service_stub.method(:list_uptime_check_configs),
231
- defaults["list_uptime_check_configs"],
232
- exception_transformer: exception_transformer,
233
- params_extractor: proc do |request|
234
- {'parent' => request.parent}
235
- end
236
- )
237
- @get_uptime_check_config = Google::Gax.create_api_call(
238
- @uptime_check_service_stub.method(:get_uptime_check_config),
239
- defaults["get_uptime_check_config"],
240
- exception_transformer: exception_transformer,
241
- params_extractor: proc do |request|
242
- {'name' => request.name}
243
- end
244
- )
245
- @create_uptime_check_config = Google::Gax.create_api_call(
246
- @uptime_check_service_stub.method(:create_uptime_check_config),
247
- defaults["create_uptime_check_config"],
248
- exception_transformer: exception_transformer,
249
- params_extractor: proc do |request|
250
- {'parent' => request.parent}
251
- end
252
- )
253
- @update_uptime_check_config = Google::Gax.create_api_call(
254
- @uptime_check_service_stub.method(:update_uptime_check_config),
255
- defaults["update_uptime_check_config"],
256
- exception_transformer: exception_transformer,
257
- params_extractor: proc do |request|
258
- {'uptime_check_config.name' => request.uptime_check_config.name}
259
- end
260
- )
261
- @delete_uptime_check_config = Google::Gax.create_api_call(
262
- @uptime_check_service_stub.method(:delete_uptime_check_config),
263
- defaults["delete_uptime_check_config"],
264
- exception_transformer: exception_transformer,
265
- params_extractor: proc do |request|
266
- {'name' => request.name}
267
- end
268
- )
269
- @list_uptime_check_ips = Google::Gax.create_api_call(
270
- @uptime_check_service_stub.method(:list_uptime_check_ips),
271
- defaults["list_uptime_check_ips"],
272
- exception_transformer: exception_transformer
273
- )
274
- end
275
-
276
- # Service calls
277
-
278
- # Lists the existing valid Uptime check configurations for the project
279
- # (leaving out any invalid configurations).
280
- #
281
- # @param parent [String]
282
- # Required. The project whose Uptime check configurations are listed. The format is:
283
- #
284
- # projects/[PROJECT_ID_OR_NUMBER]
285
- # @param page_size [Integer]
286
- # The maximum number of resources contained in the underlying API
287
- # response. If page streaming is performed per-resource, this
288
- # parameter does not affect the return value. If page streaming is
289
- # performed per-page, this determines the maximum number of
290
- # resources in a page.
291
- # @param options [Google::Gax::CallOptions]
292
- # Overrides the default settings for this call, e.g, timeout,
293
- # retries, etc.
294
- # @yield [result, operation] Access the result along with the RPC operation
295
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Monitoring::V3::UptimeCheckConfig>]
296
- # @yieldparam operation [GRPC::ActiveCall::Operation]
297
- # @return [Google::Gax::PagedEnumerable<Google::Monitoring::V3::UptimeCheckConfig>]
298
- # An enumerable of Google::Monitoring::V3::UptimeCheckConfig instances.
299
- # See Google::Gax::PagedEnumerable documentation for other
300
- # operations such as per-page iteration or access to the response
301
- # object.
302
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
303
- # @example
304
- # require "google/cloud/monitoring"
305
- #
306
- # uptime_check_client = Google::Cloud::Monitoring::UptimeCheck.new(version: :v3)
307
- # formatted_parent = Google::Cloud::Monitoring::V3::UptimeCheckServiceClient.project_path("[PROJECT]")
308
- #
309
- # # Iterate over all results.
310
- # uptime_check_client.list_uptime_check_configs(formatted_parent).each do |element|
311
- # # Process element.
312
- # end
313
- #
314
- # # Or iterate over results one page at a time.
315
- # uptime_check_client.list_uptime_check_configs(formatted_parent).each_page do |page|
316
- # # Process each page at a time.
317
- # page.each do |element|
318
- # # Process element.
319
- # end
320
- # end
321
-
322
- def list_uptime_check_configs \
323
- parent,
324
- page_size: nil,
325
- options: nil,
326
- &block
327
- req = {
328
- parent: parent,
329
- page_size: page_size
330
- }.delete_if { |_, v| v.nil? }
331
- req = Google::Gax::to_proto(req, Google::Monitoring::V3::ListUptimeCheckConfigsRequest)
332
- @list_uptime_check_configs.call(req, options, &block)
333
- end
334
-
335
- # Gets a single Uptime check configuration.
336
- #
337
- # @param name [String]
338
- # Required. The Uptime check configuration to retrieve. The format is:
339
- #
340
- # projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
341
- # @param options [Google::Gax::CallOptions]
342
- # Overrides the default settings for this call, e.g, timeout,
343
- # retries, etc.
344
- # @yield [result, operation] Access the result along with the RPC operation
345
- # @yieldparam result [Google::Monitoring::V3::UptimeCheckConfig]
346
- # @yieldparam operation [GRPC::ActiveCall::Operation]
347
- # @return [Google::Monitoring::V3::UptimeCheckConfig]
348
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
349
- # @example
350
- # require "google/cloud/monitoring"
351
- #
352
- # uptime_check_client = Google::Cloud::Monitoring::UptimeCheck.new(version: :v3)
353
- # formatted_name = Google::Cloud::Monitoring::V3::UptimeCheckServiceClient.uptime_check_config_path("[PROJECT]", "[UPTIME_CHECK_CONFIG]")
354
- # response = uptime_check_client.get_uptime_check_config(formatted_name)
355
-
356
- def get_uptime_check_config \
357
- name,
358
- options: nil,
359
- &block
360
- req = {
361
- name: name
362
- }.delete_if { |_, v| v.nil? }
363
- req = Google::Gax::to_proto(req, Google::Monitoring::V3::GetUptimeCheckConfigRequest)
364
- @get_uptime_check_config.call(req, options, &block)
365
- end
366
-
367
- # Creates a new Uptime check configuration.
368
- #
369
- # @param parent [String]
370
- # Required. The project in which to create the Uptime check. The format is:
371
- #
372
- # projects/[PROJECT_ID_OR_NUMBER]
373
- # @param uptime_check_config [Google::Monitoring::V3::UptimeCheckConfig | Hash]
374
- # Required. The new Uptime check configuration.
375
- # A hash of the same form as `Google::Monitoring::V3::UptimeCheckConfig`
376
- # can also be provided.
377
- # @param options [Google::Gax::CallOptions]
378
- # Overrides the default settings for this call, e.g, timeout,
379
- # retries, etc.
380
- # @yield [result, operation] Access the result along with the RPC operation
381
- # @yieldparam result [Google::Monitoring::V3::UptimeCheckConfig]
382
- # @yieldparam operation [GRPC::ActiveCall::Operation]
383
- # @return [Google::Monitoring::V3::UptimeCheckConfig]
384
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
385
- # @example
386
- # require "google/cloud/monitoring"
387
- #
388
- # uptime_check_client = Google::Cloud::Monitoring::UptimeCheck.new(version: :v3)
389
- # formatted_parent = Google::Cloud::Monitoring::V3::UptimeCheckServiceClient.project_path("[PROJECT]")
390
- #
391
- # # TODO: Initialize `uptime_check_config`:
392
- # uptime_check_config = {}
393
- # response = uptime_check_client.create_uptime_check_config(formatted_parent, uptime_check_config)
394
-
395
- def create_uptime_check_config \
396
- parent,
397
- uptime_check_config,
398
- options: nil,
399
- &block
400
- req = {
401
- parent: parent,
402
- uptime_check_config: uptime_check_config
403
- }.delete_if { |_, v| v.nil? }
404
- req = Google::Gax::to_proto(req, Google::Monitoring::V3::CreateUptimeCheckConfigRequest)
405
- @create_uptime_check_config.call(req, options, &block)
406
- end
407
-
408
- # Updates an Uptime check configuration. You can either replace the entire
409
- # configuration with a new one or replace only certain fields in the current
410
- # configuration by specifying the fields to be updated via `updateMask`.
411
- # Returns the updated configuration.
412
- #
413
- # @param uptime_check_config [Google::Monitoring::V3::UptimeCheckConfig | Hash]
414
- # Required. If an `updateMask` has been specified, this field gives
415
- # the values for the set of fields mentioned in the `updateMask`. If an
416
- # `updateMask` has not been given, this Uptime check configuration replaces
417
- # the current configuration. If a field is mentioned in `updateMask` but
418
- # the corresonding field is omitted in this partial Uptime check
419
- # configuration, it has the effect of deleting/clearing the field from the
420
- # configuration on the server.
421
- #
422
- # The following fields can be updated: `display_name`,
423
- # `http_check`, `tcp_check`, `timeout`, `content_matchers`, and
424
- # `selected_regions`.
425
- # A hash of the same form as `Google::Monitoring::V3::UptimeCheckConfig`
426
- # can also be provided.
427
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
428
- # Optional. If present, only the listed fields in the current Uptime check
429
- # configuration are updated with values from the new configuration. If this
430
- # field is empty, then the current configuration is completely replaced with
431
- # the new configuration.
432
- # A hash of the same form as `Google::Protobuf::FieldMask`
433
- # can also be provided.
434
- # @param options [Google::Gax::CallOptions]
435
- # Overrides the default settings for this call, e.g, timeout,
436
- # retries, etc.
437
- # @yield [result, operation] Access the result along with the RPC operation
438
- # @yieldparam result [Google::Monitoring::V3::UptimeCheckConfig]
439
- # @yieldparam operation [GRPC::ActiveCall::Operation]
440
- # @return [Google::Monitoring::V3::UptimeCheckConfig]
441
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
442
- # @example
443
- # require "google/cloud/monitoring"
444
- #
445
- # uptime_check_client = Google::Cloud::Monitoring::UptimeCheck.new(version: :v3)
446
- #
447
- # # TODO: Initialize `uptime_check_config`:
448
- # uptime_check_config = {}
449
- # response = uptime_check_client.update_uptime_check_config(uptime_check_config)
450
-
451
- def update_uptime_check_config \
452
- uptime_check_config,
453
- update_mask: nil,
454
- options: nil,
455
- &block
456
- req = {
457
- uptime_check_config: uptime_check_config,
458
- update_mask: update_mask
459
- }.delete_if { |_, v| v.nil? }
460
- req = Google::Gax::to_proto(req, Google::Monitoring::V3::UpdateUptimeCheckConfigRequest)
461
- @update_uptime_check_config.call(req, options, &block)
462
- end
463
-
464
- # Deletes an Uptime check configuration. Note that this method will fail
465
- # if the Uptime check configuration is referenced by an alert policy or
466
- # other dependent configs that would be rendered invalid by the deletion.
467
- #
468
- # @param name [String]
469
- # Required. The Uptime check configuration to delete. The format is:
470
- #
471
- # projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
472
- # @param options [Google::Gax::CallOptions]
473
- # Overrides the default settings for this call, e.g, timeout,
474
- # retries, etc.
475
- # @yield [result, operation] Access the result along with the RPC operation
476
- # @yieldparam result []
477
- # @yieldparam operation [GRPC::ActiveCall::Operation]
478
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
479
- # @example
480
- # require "google/cloud/monitoring"
481
- #
482
- # uptime_check_client = Google::Cloud::Monitoring::UptimeCheck.new(version: :v3)
483
- # formatted_name = Google::Cloud::Monitoring::V3::UptimeCheckServiceClient.uptime_check_config_path("[PROJECT]", "[UPTIME_CHECK_CONFIG]")
484
- # uptime_check_client.delete_uptime_check_config(formatted_name)
485
-
486
- def delete_uptime_check_config \
487
- name,
488
- options: nil,
489
- &block
490
- req = {
491
- name: name
492
- }.delete_if { |_, v| v.nil? }
493
- req = Google::Gax::to_proto(req, Google::Monitoring::V3::DeleteUptimeCheckConfigRequest)
494
- @delete_uptime_check_config.call(req, options, &block)
495
- nil
496
- end
497
-
498
- # Returns the list of IP addresses that checkers run from
499
- #
500
- # @param page_size [Integer]
501
- # The maximum number of resources contained in the underlying API
502
- # response. If page streaming is performed per-resource, this
503
- # parameter does not affect the return value. If page streaming is
504
- # performed per-page, this determines the maximum number of
505
- # resources in a page.
506
- # @param options [Google::Gax::CallOptions]
507
- # Overrides the default settings for this call, e.g, timeout,
508
- # retries, etc.
509
- # @yield [result, operation] Access the result along with the RPC operation
510
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Monitoring::V3::UptimeCheckIp>]
511
- # @yieldparam operation [GRPC::ActiveCall::Operation]
512
- # @return [Google::Gax::PagedEnumerable<Google::Monitoring::V3::UptimeCheckIp>]
513
- # An enumerable of Google::Monitoring::V3::UptimeCheckIp instances.
514
- # See Google::Gax::PagedEnumerable documentation for other
515
- # operations such as per-page iteration or access to the response
516
- # object.
517
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
518
- # @example
519
- # require "google/cloud/monitoring"
520
- #
521
- # uptime_check_client = Google::Cloud::Monitoring::UptimeCheck.new(version: :v3)
522
- #
523
- # # Iterate over all results.
524
- # uptime_check_client.list_uptime_check_ips.each do |element|
525
- # # Process element.
526
- # end
527
- #
528
- # # Or iterate over results one page at a time.
529
- # uptime_check_client.list_uptime_check_ips.each_page do |page|
530
- # # Process each page at a time.
531
- # page.each do |element|
532
- # # Process element.
533
- # end
534
- # end
535
-
536
- def list_uptime_check_ips \
537
- page_size: nil,
538
- options: nil,
539
- &block
540
- req = {
541
- page_size: page_size
542
- }.delete_if { |_, v| v.nil? }
543
- req = Google::Gax::to_proto(req, Google::Monitoring::V3::ListUptimeCheckIpsRequest)
544
- @list_uptime_check_ips.call(req, options, &block)
545
- end
546
- end
547
- end
548
- end
549
- end
550
- end