google-cloud-observability-v1 0.a → 0.1.0
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/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +153 -8
- data/lib/google/cloud/observability/v1/bindings_override.rb +107 -0
- data/lib/google/cloud/observability/v1/observability/client.rb +2738 -0
- data/lib/google/cloud/observability/v1/observability/credentials.rb +47 -0
- data/lib/google/cloud/observability/v1/observability/operations.rb +843 -0
- data/lib/google/cloud/observability/v1/observability/paths.rb +226 -0
- data/lib/google/cloud/observability/v1/observability/rest/client.rb +2549 -0
- data/lib/google/cloud/observability/v1/observability/rest/operations.rb +985 -0
- data/lib/google/cloud/observability/v1/observability/rest/service_stub.rb +1461 -0
- data/lib/google/cloud/observability/v1/observability/rest.rb +54 -0
- data/lib/google/cloud/observability/v1/observability.rb +56 -0
- data/lib/google/cloud/observability/v1/observability_pb.rb +65 -0
- data/lib/google/cloud/observability/v1/observability_services_pb.rb +87 -0
- data/lib/google/cloud/observability/v1/rest.rb +38 -0
- data/lib/google/cloud/observability/v1/version.rb +7 -2
- data/lib/google/cloud/observability/v1.rb +45 -0
- data/lib/google-cloud-observability-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +593 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +227 -0
- data/proto_docs/google/cloud/observability/v1/observability.rb +709 -0
- data/proto_docs/google/longrunning/operations.rb +191 -0
- data/proto_docs/google/protobuf/any.rb +145 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +128 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- metadata +82 -9
|
@@ -0,0 +1,2549 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 Google LLC
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
require "google/cloud/errors"
|
|
20
|
+
require "google/cloud/observability/v1/observability_pb"
|
|
21
|
+
require "google/cloud/observability/v1/observability/rest/service_stub"
|
|
22
|
+
require "google/cloud/location/rest"
|
|
23
|
+
|
|
24
|
+
module Google
|
|
25
|
+
module Cloud
|
|
26
|
+
module Observability
|
|
27
|
+
module V1
|
|
28
|
+
module Observability
|
|
29
|
+
module Rest
|
|
30
|
+
##
|
|
31
|
+
# REST client for the Observability service.
|
|
32
|
+
#
|
|
33
|
+
# Service describing handlers for resources
|
|
34
|
+
#
|
|
35
|
+
class Client
|
|
36
|
+
# @private
|
|
37
|
+
API_VERSION = ""
|
|
38
|
+
|
|
39
|
+
# @private
|
|
40
|
+
DEFAULT_ENDPOINT_TEMPLATE = "observability.$UNIVERSE_DOMAIN$"
|
|
41
|
+
|
|
42
|
+
include Paths
|
|
43
|
+
|
|
44
|
+
# @private
|
|
45
|
+
attr_reader :observability_stub
|
|
46
|
+
|
|
47
|
+
##
|
|
48
|
+
# Configure the Observability Client class.
|
|
49
|
+
#
|
|
50
|
+
# See {::Google::Cloud::Observability::V1::Observability::Rest::Client::Configuration}
|
|
51
|
+
# for a description of the configuration fields.
|
|
52
|
+
#
|
|
53
|
+
# @example
|
|
54
|
+
#
|
|
55
|
+
# # Modify the configuration for all Observability clients
|
|
56
|
+
# ::Google::Cloud::Observability::V1::Observability::Rest::Client.configure do |config|
|
|
57
|
+
# config.timeout = 10.0
|
|
58
|
+
# end
|
|
59
|
+
#
|
|
60
|
+
# @yield [config] Configure the Client client.
|
|
61
|
+
# @yieldparam config [Client::Configuration]
|
|
62
|
+
#
|
|
63
|
+
# @return [Client::Configuration]
|
|
64
|
+
#
|
|
65
|
+
def self.configure
|
|
66
|
+
@configure ||= begin
|
|
67
|
+
namespace = ["Google", "Cloud", "Observability", "V1"]
|
|
68
|
+
parent_config = while namespace.any?
|
|
69
|
+
parent_name = namespace.join "::"
|
|
70
|
+
parent_const = const_get parent_name
|
|
71
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
|
72
|
+
namespace.pop
|
|
73
|
+
end
|
|
74
|
+
default_config = Client::Configuration.new parent_config
|
|
75
|
+
|
|
76
|
+
default_config.rpcs.get_scope.timeout = 60.0
|
|
77
|
+
default_config.rpcs.get_scope.retry_policy = {
|
|
78
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
default_config.rpcs.update_scope.timeout = 60.0
|
|
82
|
+
|
|
83
|
+
default_config.rpcs.get_bucket.timeout = 60.0
|
|
84
|
+
default_config.rpcs.get_bucket.retry_policy = {
|
|
85
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
default_config.rpcs.list_buckets.timeout = 60.0
|
|
89
|
+
default_config.rpcs.list_buckets.retry_policy = {
|
|
90
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
default_config.rpcs.create_bucket.timeout = 60.0
|
|
94
|
+
|
|
95
|
+
default_config.rpcs.update_bucket.timeout = 60.0
|
|
96
|
+
|
|
97
|
+
default_config.rpcs.get_dataset.timeout = 60.0
|
|
98
|
+
default_config.rpcs.get_dataset.retry_policy = {
|
|
99
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
default_config.rpcs.list_datasets.timeout = 60.0
|
|
103
|
+
default_config.rpcs.list_datasets.retry_policy = {
|
|
104
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
default_config.rpcs.get_view.timeout = 60.0
|
|
108
|
+
default_config.rpcs.get_view.retry_policy = {
|
|
109
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
default_config.rpcs.list_views.timeout = 60.0
|
|
113
|
+
default_config.rpcs.list_views.retry_policy = {
|
|
114
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
default_config.rpcs.get_link.timeout = 60.0
|
|
118
|
+
default_config.rpcs.get_link.retry_policy = {
|
|
119
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
default_config.rpcs.list_links.timeout = 60.0
|
|
123
|
+
default_config.rpcs.list_links.retry_policy = {
|
|
124
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
default_config.rpcs.create_link.timeout = 60.0
|
|
128
|
+
|
|
129
|
+
default_config.rpcs.update_link.timeout = 60.0
|
|
130
|
+
|
|
131
|
+
default_config.rpcs.delete_link.timeout = 60.0
|
|
132
|
+
|
|
133
|
+
default_config.rpcs.get_trace_scope.timeout = 60.0
|
|
134
|
+
default_config.rpcs.get_trace_scope.retry_policy = {
|
|
135
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
default_config.rpcs.list_trace_scopes.timeout = 60.0
|
|
139
|
+
default_config.rpcs.list_trace_scopes.retry_policy = {
|
|
140
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
default_config.rpcs.create_trace_scope.timeout = 60.0
|
|
144
|
+
|
|
145
|
+
default_config.rpcs.update_trace_scope.timeout = 60.0
|
|
146
|
+
|
|
147
|
+
default_config.rpcs.delete_trace_scope.timeout = 60.0
|
|
148
|
+
|
|
149
|
+
default_config.rpcs.get_settings.timeout = 60.0
|
|
150
|
+
default_config.rpcs.get_settings.retry_policy = {
|
|
151
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
default_config.rpcs.update_settings.timeout = 60.0
|
|
155
|
+
|
|
156
|
+
default_config
|
|
157
|
+
end
|
|
158
|
+
yield @configure if block_given?
|
|
159
|
+
@configure
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
##
|
|
163
|
+
# Configure the Observability Client instance.
|
|
164
|
+
#
|
|
165
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
|
166
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
|
167
|
+
# should be made on {Client.configure}.
|
|
168
|
+
#
|
|
169
|
+
# See {::Google::Cloud::Observability::V1::Observability::Rest::Client::Configuration}
|
|
170
|
+
# for a description of the configuration fields.
|
|
171
|
+
#
|
|
172
|
+
# @yield [config] Configure the Client client.
|
|
173
|
+
# @yieldparam config [Client::Configuration]
|
|
174
|
+
#
|
|
175
|
+
# @return [Client::Configuration]
|
|
176
|
+
#
|
|
177
|
+
def configure
|
|
178
|
+
yield @config if block_given?
|
|
179
|
+
@config
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
##
|
|
183
|
+
# The effective universe domain
|
|
184
|
+
#
|
|
185
|
+
# @return [String]
|
|
186
|
+
#
|
|
187
|
+
def universe_domain
|
|
188
|
+
@observability_stub.universe_domain
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
##
|
|
192
|
+
# Create a new Observability REST client object.
|
|
193
|
+
#
|
|
194
|
+
# @example
|
|
195
|
+
#
|
|
196
|
+
# # Create a client using the default configuration
|
|
197
|
+
# client = ::Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
198
|
+
#
|
|
199
|
+
# # Create a client using a custom configuration
|
|
200
|
+
# client = ::Google::Cloud::Observability::V1::Observability::Rest::Client.new do |config|
|
|
201
|
+
# config.timeout = 10.0
|
|
202
|
+
# end
|
|
203
|
+
#
|
|
204
|
+
# @yield [config] Configure the Observability client.
|
|
205
|
+
# @yieldparam config [Client::Configuration]
|
|
206
|
+
#
|
|
207
|
+
def initialize
|
|
208
|
+
# Create the configuration object
|
|
209
|
+
@config = Configuration.new Client.configure
|
|
210
|
+
|
|
211
|
+
# Yield the configuration if needed
|
|
212
|
+
yield @config if block_given?
|
|
213
|
+
|
|
214
|
+
# Create credentials
|
|
215
|
+
credentials = @config.credentials
|
|
216
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
|
217
|
+
# but only if the default endpoint does not have a region prefix.
|
|
218
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
|
219
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
|
220
|
+
!@config.endpoint.split(".").first.include?("-"))
|
|
221
|
+
credentials ||= Credentials.default scope: @config.scope,
|
|
222
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
|
223
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
|
224
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
@quota_project_id = @config.quota_project
|
|
228
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
|
229
|
+
|
|
230
|
+
@operations_client = ::Google::Cloud::Observability::V1::Observability::Rest::Operations.new do |config|
|
|
231
|
+
config.credentials = credentials
|
|
232
|
+
config.quota_project = @quota_project_id
|
|
233
|
+
config.endpoint = @config.endpoint
|
|
234
|
+
config.universe_domain = @config.universe_domain
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
@observability_stub = ::Google::Cloud::Observability::V1::Observability::Rest::ServiceStub.new(
|
|
238
|
+
endpoint: @config.endpoint,
|
|
239
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
|
240
|
+
universe_domain: @config.universe_domain,
|
|
241
|
+
credentials: credentials,
|
|
242
|
+
logger: @config.logger
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
@observability_stub.logger(stub: true)&.info do |entry|
|
|
246
|
+
entry.set_system_name
|
|
247
|
+
entry.set_service
|
|
248
|
+
entry.message = "Created client for #{entry.service}"
|
|
249
|
+
entry.set_credentials_fields credentials
|
|
250
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
|
251
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
|
252
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
|
256
|
+
config.credentials = credentials
|
|
257
|
+
config.quota_project = @quota_project_id
|
|
258
|
+
config.endpoint = @observability_stub.endpoint
|
|
259
|
+
config.universe_domain = @observability_stub.universe_domain
|
|
260
|
+
config.bindings_override = @config.bindings_override
|
|
261
|
+
config.logger = @observability_stub.logger if config.respond_to? :logger=
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
##
|
|
266
|
+
# Get the associated client for long-running operations.
|
|
267
|
+
#
|
|
268
|
+
# @return [::Google::Cloud::Observability::V1::Observability::Rest::Operations]
|
|
269
|
+
#
|
|
270
|
+
attr_reader :operations_client
|
|
271
|
+
|
|
272
|
+
##
|
|
273
|
+
# Get the associated client for mix-in of the Locations.
|
|
274
|
+
#
|
|
275
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
|
276
|
+
#
|
|
277
|
+
attr_reader :location_client
|
|
278
|
+
|
|
279
|
+
##
|
|
280
|
+
# The logger used for request/response debug logging.
|
|
281
|
+
#
|
|
282
|
+
# @return [Logger]
|
|
283
|
+
#
|
|
284
|
+
def logger
|
|
285
|
+
@observability_stub.logger
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Service calls
|
|
289
|
+
|
|
290
|
+
##
|
|
291
|
+
# Gets details of a single Scope.
|
|
292
|
+
#
|
|
293
|
+
# @overload get_scope(request, options = nil)
|
|
294
|
+
# Pass arguments to `get_scope` via a request object, either of type
|
|
295
|
+
# {::Google::Cloud::Observability::V1::GetScopeRequest} or an equivalent Hash.
|
|
296
|
+
#
|
|
297
|
+
# @param request [::Google::Cloud::Observability::V1::GetScopeRequest, ::Hash]
|
|
298
|
+
# A request object representing the call parameters. Required. To specify no
|
|
299
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
300
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
301
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
302
|
+
#
|
|
303
|
+
# @overload get_scope(name: nil)
|
|
304
|
+
# Pass arguments to `get_scope` via keyword arguments. Note that at
|
|
305
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
306
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
307
|
+
#
|
|
308
|
+
# @param name [::String]
|
|
309
|
+
# Required. Name of the resource. The format is:
|
|
310
|
+
#
|
|
311
|
+
# projects/\\{project}/locations/\\{location}/scopes/\\{scope}
|
|
312
|
+
#
|
|
313
|
+
# The `{location}` field must be set to `global`. The `{scope}` field must
|
|
314
|
+
# be set to `_Default`.
|
|
315
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
316
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::Scope]
|
|
317
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
318
|
+
#
|
|
319
|
+
# @return [::Google::Cloud::Observability::V1::Scope]
|
|
320
|
+
#
|
|
321
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
322
|
+
#
|
|
323
|
+
# @example Basic example
|
|
324
|
+
# require "google/cloud/observability/v1"
|
|
325
|
+
#
|
|
326
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
327
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
328
|
+
#
|
|
329
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
330
|
+
# request = Google::Cloud::Observability::V1::GetScopeRequest.new
|
|
331
|
+
#
|
|
332
|
+
# # Call the get_scope method.
|
|
333
|
+
# result = client.get_scope request
|
|
334
|
+
#
|
|
335
|
+
# # The returned object is of type Google::Cloud::Observability::V1::Scope.
|
|
336
|
+
# p result
|
|
337
|
+
#
|
|
338
|
+
def get_scope request, options = nil
|
|
339
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
340
|
+
|
|
341
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetScopeRequest
|
|
342
|
+
|
|
343
|
+
# Converts hash and nil to an options object
|
|
344
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
345
|
+
|
|
346
|
+
# Customize the options with defaults
|
|
347
|
+
call_metadata = @config.rpcs.get_scope.metadata.to_h
|
|
348
|
+
|
|
349
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
350
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
351
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
352
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
353
|
+
transports_version_send: [:rest]
|
|
354
|
+
|
|
355
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
356
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
357
|
+
|
|
358
|
+
options.apply_defaults timeout: @config.rpcs.get_scope.timeout,
|
|
359
|
+
metadata: call_metadata,
|
|
360
|
+
retry_policy: @config.rpcs.get_scope.retry_policy
|
|
361
|
+
|
|
362
|
+
options.apply_defaults timeout: @config.timeout,
|
|
363
|
+
metadata: @config.metadata,
|
|
364
|
+
retry_policy: @config.retry_policy
|
|
365
|
+
|
|
366
|
+
@observability_stub.get_scope request, options do |result, operation|
|
|
367
|
+
yield result, operation if block_given?
|
|
368
|
+
end
|
|
369
|
+
rescue ::Gapic::Rest::Error => e
|
|
370
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
##
|
|
374
|
+
# Updates the parameters of a single Scope.
|
|
375
|
+
#
|
|
376
|
+
# @overload update_scope(request, options = nil)
|
|
377
|
+
# Pass arguments to `update_scope` via a request object, either of type
|
|
378
|
+
# {::Google::Cloud::Observability::V1::UpdateScopeRequest} or an equivalent Hash.
|
|
379
|
+
#
|
|
380
|
+
# @param request [::Google::Cloud::Observability::V1::UpdateScopeRequest, ::Hash]
|
|
381
|
+
# A request object representing the call parameters. Required. To specify no
|
|
382
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
383
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
384
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
385
|
+
#
|
|
386
|
+
# @overload update_scope(update_mask: nil, scope: nil)
|
|
387
|
+
# Pass arguments to `update_scope` via keyword arguments. Note that at
|
|
388
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
389
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
390
|
+
#
|
|
391
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
392
|
+
# Optional. Field mask is used to specify the fields to be overwritten in the
|
|
393
|
+
# Scope resource by the update.
|
|
394
|
+
# The fields specified in the update_mask are relative to the resource, not
|
|
395
|
+
# the full request. A field is overwritten when it is in the mask. If the
|
|
396
|
+
# user does not provide a mask, then all fields present in the request are
|
|
397
|
+
# overwritten.
|
|
398
|
+
# @param scope [::Google::Cloud::Observability::V1::Scope, ::Hash]
|
|
399
|
+
# Required. The resource being updated.
|
|
400
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
401
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::Scope]
|
|
402
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
403
|
+
#
|
|
404
|
+
# @return [::Google::Cloud::Observability::V1::Scope]
|
|
405
|
+
#
|
|
406
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
407
|
+
#
|
|
408
|
+
# @example Basic example
|
|
409
|
+
# require "google/cloud/observability/v1"
|
|
410
|
+
#
|
|
411
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
412
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
413
|
+
#
|
|
414
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
415
|
+
# request = Google::Cloud::Observability::V1::UpdateScopeRequest.new
|
|
416
|
+
#
|
|
417
|
+
# # Call the update_scope method.
|
|
418
|
+
# result = client.update_scope request
|
|
419
|
+
#
|
|
420
|
+
# # The returned object is of type Google::Cloud::Observability::V1::Scope.
|
|
421
|
+
# p result
|
|
422
|
+
#
|
|
423
|
+
def update_scope request, options = nil
|
|
424
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
425
|
+
|
|
426
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateScopeRequest
|
|
427
|
+
|
|
428
|
+
# Converts hash and nil to an options object
|
|
429
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
430
|
+
|
|
431
|
+
# Customize the options with defaults
|
|
432
|
+
call_metadata = @config.rpcs.update_scope.metadata.to_h
|
|
433
|
+
|
|
434
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
435
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
436
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
437
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
438
|
+
transports_version_send: [:rest]
|
|
439
|
+
|
|
440
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
441
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
442
|
+
|
|
443
|
+
options.apply_defaults timeout: @config.rpcs.update_scope.timeout,
|
|
444
|
+
metadata: call_metadata,
|
|
445
|
+
retry_policy: @config.rpcs.update_scope.retry_policy
|
|
446
|
+
|
|
447
|
+
options.apply_defaults timeout: @config.timeout,
|
|
448
|
+
metadata: @config.metadata,
|
|
449
|
+
retry_policy: @config.retry_policy
|
|
450
|
+
|
|
451
|
+
@observability_stub.update_scope request, options do |result, operation|
|
|
452
|
+
yield result, operation if block_given?
|
|
453
|
+
end
|
|
454
|
+
rescue ::Gapic::Rest::Error => e
|
|
455
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
##
|
|
459
|
+
# Get bucket resource.
|
|
460
|
+
#
|
|
461
|
+
# @overload get_bucket(request, options = nil)
|
|
462
|
+
# Pass arguments to `get_bucket` via a request object, either of type
|
|
463
|
+
# {::Google::Cloud::Observability::V1::GetBucketRequest} or an equivalent Hash.
|
|
464
|
+
#
|
|
465
|
+
# @param request [::Google::Cloud::Observability::V1::GetBucketRequest, ::Hash]
|
|
466
|
+
# A request object representing the call parameters. Required. To specify no
|
|
467
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
468
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
469
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
470
|
+
#
|
|
471
|
+
# @overload get_bucket(name: nil)
|
|
472
|
+
# Pass arguments to `get_bucket` via keyword arguments. Note that at
|
|
473
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
474
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
475
|
+
#
|
|
476
|
+
# @param name [::String]
|
|
477
|
+
# Required. Name of the bucket to retrieve. The format is:
|
|
478
|
+
#
|
|
479
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
|
|
480
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
481
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::Bucket]
|
|
482
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
483
|
+
#
|
|
484
|
+
# @return [::Google::Cloud::Observability::V1::Bucket]
|
|
485
|
+
#
|
|
486
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
487
|
+
#
|
|
488
|
+
# @example Basic example
|
|
489
|
+
# require "google/cloud/observability/v1"
|
|
490
|
+
#
|
|
491
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
492
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
493
|
+
#
|
|
494
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
495
|
+
# request = Google::Cloud::Observability::V1::GetBucketRequest.new
|
|
496
|
+
#
|
|
497
|
+
# # Call the get_bucket method.
|
|
498
|
+
# result = client.get_bucket request
|
|
499
|
+
#
|
|
500
|
+
# # The returned object is of type Google::Cloud::Observability::V1::Bucket.
|
|
501
|
+
# p result
|
|
502
|
+
#
|
|
503
|
+
def get_bucket request, options = nil
|
|
504
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
505
|
+
|
|
506
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetBucketRequest
|
|
507
|
+
|
|
508
|
+
# Converts hash and nil to an options object
|
|
509
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
510
|
+
|
|
511
|
+
# Customize the options with defaults
|
|
512
|
+
call_metadata = @config.rpcs.get_bucket.metadata.to_h
|
|
513
|
+
|
|
514
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
515
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
516
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
517
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
518
|
+
transports_version_send: [:rest]
|
|
519
|
+
|
|
520
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
521
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
522
|
+
|
|
523
|
+
options.apply_defaults timeout: @config.rpcs.get_bucket.timeout,
|
|
524
|
+
metadata: call_metadata,
|
|
525
|
+
retry_policy: @config.rpcs.get_bucket.retry_policy
|
|
526
|
+
|
|
527
|
+
options.apply_defaults timeout: @config.timeout,
|
|
528
|
+
metadata: @config.metadata,
|
|
529
|
+
retry_policy: @config.retry_policy
|
|
530
|
+
|
|
531
|
+
@observability_stub.get_bucket request, options do |result, operation|
|
|
532
|
+
yield result, operation if block_given?
|
|
533
|
+
end
|
|
534
|
+
rescue ::Gapic::Rest::Error => e
|
|
535
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
536
|
+
end
|
|
537
|
+
|
|
538
|
+
##
|
|
539
|
+
# List buckets of a project in a particular location.
|
|
540
|
+
#
|
|
541
|
+
# @overload list_buckets(request, options = nil)
|
|
542
|
+
# Pass arguments to `list_buckets` via a request object, either of type
|
|
543
|
+
# {::Google::Cloud::Observability::V1::ListBucketsRequest} or an equivalent Hash.
|
|
544
|
+
#
|
|
545
|
+
# @param request [::Google::Cloud::Observability::V1::ListBucketsRequest, ::Hash]
|
|
546
|
+
# A request object representing the call parameters. Required. To specify no
|
|
547
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
548
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
549
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
550
|
+
#
|
|
551
|
+
# @overload list_buckets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil)
|
|
552
|
+
# Pass arguments to `list_buckets` via keyword arguments. Note that at
|
|
553
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
554
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
555
|
+
#
|
|
556
|
+
# @param parent [::String]
|
|
557
|
+
# Required. The parent, which owns this collection of buckets. The format is:
|
|
558
|
+
#
|
|
559
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]
|
|
560
|
+
# @param page_size [::Integer]
|
|
561
|
+
# Optional. The maximum number of buckets to return. If unspecified, then at
|
|
562
|
+
# most 100 buckets are returned. The maximum value is 1000; values above 1000
|
|
563
|
+
# are coerced to 1000.
|
|
564
|
+
# @param page_token [::String]
|
|
565
|
+
# Optional. A page token, received from a previous `ListBuckets` call.
|
|
566
|
+
# Provide this to retrieve the subsequent page.
|
|
567
|
+
# @param show_deleted [::Boolean]
|
|
568
|
+
# Optional. If true, then the response will include deleted buckets.
|
|
569
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
570
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::Bucket>]
|
|
571
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
572
|
+
#
|
|
573
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::Bucket>]
|
|
574
|
+
#
|
|
575
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
576
|
+
#
|
|
577
|
+
# @example Basic example
|
|
578
|
+
# require "google/cloud/observability/v1"
|
|
579
|
+
#
|
|
580
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
581
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
582
|
+
#
|
|
583
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
584
|
+
# request = Google::Cloud::Observability::V1::ListBucketsRequest.new
|
|
585
|
+
#
|
|
586
|
+
# # Call the list_buckets method.
|
|
587
|
+
# result = client.list_buckets request
|
|
588
|
+
#
|
|
589
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
590
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
591
|
+
# result.each do |item|
|
|
592
|
+
# # Each element is of type ::Google::Cloud::Observability::V1::Bucket.
|
|
593
|
+
# p item
|
|
594
|
+
# end
|
|
595
|
+
#
|
|
596
|
+
def list_buckets request, options = nil
|
|
597
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
598
|
+
|
|
599
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListBucketsRequest
|
|
600
|
+
|
|
601
|
+
# Converts hash and nil to an options object
|
|
602
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
603
|
+
|
|
604
|
+
# Customize the options with defaults
|
|
605
|
+
call_metadata = @config.rpcs.list_buckets.metadata.to_h
|
|
606
|
+
|
|
607
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
608
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
609
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
610
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
611
|
+
transports_version_send: [:rest]
|
|
612
|
+
|
|
613
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
614
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
615
|
+
|
|
616
|
+
options.apply_defaults timeout: @config.rpcs.list_buckets.timeout,
|
|
617
|
+
metadata: call_metadata,
|
|
618
|
+
retry_policy: @config.rpcs.list_buckets.retry_policy
|
|
619
|
+
|
|
620
|
+
options.apply_defaults timeout: @config.timeout,
|
|
621
|
+
metadata: @config.metadata,
|
|
622
|
+
retry_policy: @config.retry_policy
|
|
623
|
+
|
|
624
|
+
@observability_stub.list_buckets request, options do |result, operation|
|
|
625
|
+
result = ::Gapic::Rest::PagedEnumerable.new @observability_stub, :list_buckets, "buckets", request, result, options
|
|
626
|
+
yield result, operation if block_given?
|
|
627
|
+
throw :response, result
|
|
628
|
+
end
|
|
629
|
+
rescue ::Gapic::Rest::Error => e
|
|
630
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
631
|
+
end
|
|
632
|
+
|
|
633
|
+
##
|
|
634
|
+
# Create a new bucket.
|
|
635
|
+
#
|
|
636
|
+
# @overload create_bucket(request, options = nil)
|
|
637
|
+
# Pass arguments to `create_bucket` via a request object, either of type
|
|
638
|
+
# {::Google::Cloud::Observability::V1::CreateBucketRequest} or an equivalent Hash.
|
|
639
|
+
#
|
|
640
|
+
# @param request [::Google::Cloud::Observability::V1::CreateBucketRequest, ::Hash]
|
|
641
|
+
# A request object representing the call parameters. Required. To specify no
|
|
642
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
643
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
644
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
645
|
+
#
|
|
646
|
+
# @overload create_bucket(parent: nil, bucket_id: nil, bucket: nil)
|
|
647
|
+
# Pass arguments to `create_bucket` via keyword arguments. Note that at
|
|
648
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
649
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
650
|
+
#
|
|
651
|
+
# @param parent [::String]
|
|
652
|
+
# Required. Name of the project and location for the bucket. The format is:
|
|
653
|
+
#
|
|
654
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]
|
|
655
|
+
# @param bucket_id [::String]
|
|
656
|
+
# Required. Id of the bucket to create.
|
|
657
|
+
# @param bucket [::Google::Cloud::Observability::V1::Bucket, ::Hash]
|
|
658
|
+
# Required. Bucket to create.
|
|
659
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
660
|
+
# @yieldparam result [::Gapic::Operation]
|
|
661
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
662
|
+
#
|
|
663
|
+
# @return [::Gapic::Operation]
|
|
664
|
+
#
|
|
665
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
666
|
+
#
|
|
667
|
+
# @example Basic example
|
|
668
|
+
# require "google/cloud/observability/v1"
|
|
669
|
+
#
|
|
670
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
671
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
672
|
+
#
|
|
673
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
674
|
+
# request = Google::Cloud::Observability::V1::CreateBucketRequest.new
|
|
675
|
+
#
|
|
676
|
+
# # Call the create_bucket method.
|
|
677
|
+
# result = client.create_bucket request
|
|
678
|
+
#
|
|
679
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
680
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
681
|
+
# # Here is how to wait for a response.
|
|
682
|
+
# result.wait_until_done! timeout: 60
|
|
683
|
+
# if result.response?
|
|
684
|
+
# p result.response
|
|
685
|
+
# else
|
|
686
|
+
# puts "No response received."
|
|
687
|
+
# end
|
|
688
|
+
#
|
|
689
|
+
def create_bucket request, options = nil
|
|
690
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
691
|
+
|
|
692
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::CreateBucketRequest
|
|
693
|
+
|
|
694
|
+
# Converts hash and nil to an options object
|
|
695
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
696
|
+
|
|
697
|
+
# Customize the options with defaults
|
|
698
|
+
call_metadata = @config.rpcs.create_bucket.metadata.to_h
|
|
699
|
+
|
|
700
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
701
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
702
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
703
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
704
|
+
transports_version_send: [:rest]
|
|
705
|
+
|
|
706
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
707
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
708
|
+
|
|
709
|
+
options.apply_defaults timeout: @config.rpcs.create_bucket.timeout,
|
|
710
|
+
metadata: call_metadata,
|
|
711
|
+
retry_policy: @config.rpcs.create_bucket.retry_policy
|
|
712
|
+
|
|
713
|
+
options.apply_defaults timeout: @config.timeout,
|
|
714
|
+
metadata: @config.metadata,
|
|
715
|
+
retry_policy: @config.retry_policy
|
|
716
|
+
|
|
717
|
+
@observability_stub.create_bucket request, options do |result, operation|
|
|
718
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
719
|
+
yield result, operation if block_given?
|
|
720
|
+
throw :response, result
|
|
721
|
+
end
|
|
722
|
+
rescue ::Gapic::Rest::Error => e
|
|
723
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
724
|
+
end
|
|
725
|
+
|
|
726
|
+
##
|
|
727
|
+
# Update a bucket.
|
|
728
|
+
#
|
|
729
|
+
# @overload update_bucket(request, options = nil)
|
|
730
|
+
# Pass arguments to `update_bucket` via a request object, either of type
|
|
731
|
+
# {::Google::Cloud::Observability::V1::UpdateBucketRequest} or an equivalent Hash.
|
|
732
|
+
#
|
|
733
|
+
# @param request [::Google::Cloud::Observability::V1::UpdateBucketRequest, ::Hash]
|
|
734
|
+
# A request object representing the call parameters. Required. To specify no
|
|
735
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
736
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
737
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
738
|
+
#
|
|
739
|
+
# @overload update_bucket(bucket: nil, update_mask: nil)
|
|
740
|
+
# Pass arguments to `update_bucket` via keyword arguments. Note that at
|
|
741
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
742
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
743
|
+
#
|
|
744
|
+
# @param bucket [::Google::Cloud::Observability::V1::Bucket, ::Hash]
|
|
745
|
+
# Required. The bucket to update.
|
|
746
|
+
#
|
|
747
|
+
# The name field of bucket identifies the resource to update.
|
|
748
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
749
|
+
# Optional. The list of fields to update.
|
|
750
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
751
|
+
# @yieldparam result [::Gapic::Operation]
|
|
752
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
753
|
+
#
|
|
754
|
+
# @return [::Gapic::Operation]
|
|
755
|
+
#
|
|
756
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
757
|
+
#
|
|
758
|
+
# @example Basic example
|
|
759
|
+
# require "google/cloud/observability/v1"
|
|
760
|
+
#
|
|
761
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
762
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
763
|
+
#
|
|
764
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
765
|
+
# request = Google::Cloud::Observability::V1::UpdateBucketRequest.new
|
|
766
|
+
#
|
|
767
|
+
# # Call the update_bucket method.
|
|
768
|
+
# result = client.update_bucket request
|
|
769
|
+
#
|
|
770
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
771
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
772
|
+
# # Here is how to wait for a response.
|
|
773
|
+
# result.wait_until_done! timeout: 60
|
|
774
|
+
# if result.response?
|
|
775
|
+
# p result.response
|
|
776
|
+
# else
|
|
777
|
+
# puts "No response received."
|
|
778
|
+
# end
|
|
779
|
+
#
|
|
780
|
+
def update_bucket request, options = nil
|
|
781
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
782
|
+
|
|
783
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateBucketRequest
|
|
784
|
+
|
|
785
|
+
# Converts hash and nil to an options object
|
|
786
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
787
|
+
|
|
788
|
+
# Customize the options with defaults
|
|
789
|
+
call_metadata = @config.rpcs.update_bucket.metadata.to_h
|
|
790
|
+
|
|
791
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
792
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
793
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
794
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
795
|
+
transports_version_send: [:rest]
|
|
796
|
+
|
|
797
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
798
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
799
|
+
|
|
800
|
+
options.apply_defaults timeout: @config.rpcs.update_bucket.timeout,
|
|
801
|
+
metadata: call_metadata,
|
|
802
|
+
retry_policy: @config.rpcs.update_bucket.retry_policy
|
|
803
|
+
|
|
804
|
+
options.apply_defaults timeout: @config.timeout,
|
|
805
|
+
metadata: @config.metadata,
|
|
806
|
+
retry_policy: @config.retry_policy
|
|
807
|
+
|
|
808
|
+
@observability_stub.update_bucket request, options do |result, operation|
|
|
809
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
810
|
+
yield result, operation if block_given?
|
|
811
|
+
throw :response, result
|
|
812
|
+
end
|
|
813
|
+
rescue ::Gapic::Rest::Error => e
|
|
814
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
815
|
+
end
|
|
816
|
+
|
|
817
|
+
##
|
|
818
|
+
# Get a dataset.
|
|
819
|
+
#
|
|
820
|
+
# @overload get_dataset(request, options = nil)
|
|
821
|
+
# Pass arguments to `get_dataset` via a request object, either of type
|
|
822
|
+
# {::Google::Cloud::Observability::V1::GetDatasetRequest} or an equivalent Hash.
|
|
823
|
+
#
|
|
824
|
+
# @param request [::Google::Cloud::Observability::V1::GetDatasetRequest, ::Hash]
|
|
825
|
+
# A request object representing the call parameters. Required. To specify no
|
|
826
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
827
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
828
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
829
|
+
#
|
|
830
|
+
# @overload get_dataset(name: nil)
|
|
831
|
+
# Pass arguments to `get_dataset` via keyword arguments. Note that at
|
|
832
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
833
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
834
|
+
#
|
|
835
|
+
# @param name [::String]
|
|
836
|
+
# Required. Name of the dataset to retrieve. The format is:
|
|
837
|
+
#
|
|
838
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]
|
|
839
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
840
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::Dataset]
|
|
841
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
842
|
+
#
|
|
843
|
+
# @return [::Google::Cloud::Observability::V1::Dataset]
|
|
844
|
+
#
|
|
845
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
846
|
+
#
|
|
847
|
+
# @example Basic example
|
|
848
|
+
# require "google/cloud/observability/v1"
|
|
849
|
+
#
|
|
850
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
851
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
852
|
+
#
|
|
853
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
854
|
+
# request = Google::Cloud::Observability::V1::GetDatasetRequest.new
|
|
855
|
+
#
|
|
856
|
+
# # Call the get_dataset method.
|
|
857
|
+
# result = client.get_dataset request
|
|
858
|
+
#
|
|
859
|
+
# # The returned object is of type Google::Cloud::Observability::V1::Dataset.
|
|
860
|
+
# p result
|
|
861
|
+
#
|
|
862
|
+
def get_dataset request, options = nil
|
|
863
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
864
|
+
|
|
865
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetDatasetRequest
|
|
866
|
+
|
|
867
|
+
# Converts hash and nil to an options object
|
|
868
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
869
|
+
|
|
870
|
+
# Customize the options with defaults
|
|
871
|
+
call_metadata = @config.rpcs.get_dataset.metadata.to_h
|
|
872
|
+
|
|
873
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
874
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
875
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
876
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
877
|
+
transports_version_send: [:rest]
|
|
878
|
+
|
|
879
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
880
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
881
|
+
|
|
882
|
+
options.apply_defaults timeout: @config.rpcs.get_dataset.timeout,
|
|
883
|
+
metadata: call_metadata,
|
|
884
|
+
retry_policy: @config.rpcs.get_dataset.retry_policy
|
|
885
|
+
|
|
886
|
+
options.apply_defaults timeout: @config.timeout,
|
|
887
|
+
metadata: @config.metadata,
|
|
888
|
+
retry_policy: @config.retry_policy
|
|
889
|
+
|
|
890
|
+
@observability_stub.get_dataset request, options do |result, operation|
|
|
891
|
+
yield result, operation if block_given?
|
|
892
|
+
end
|
|
893
|
+
rescue ::Gapic::Rest::Error => e
|
|
894
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
895
|
+
end
|
|
896
|
+
|
|
897
|
+
##
|
|
898
|
+
# List datasets of a bucket.
|
|
899
|
+
#
|
|
900
|
+
# @overload list_datasets(request, options = nil)
|
|
901
|
+
# Pass arguments to `list_datasets` via a request object, either of type
|
|
902
|
+
# {::Google::Cloud::Observability::V1::ListDatasetsRequest} or an equivalent Hash.
|
|
903
|
+
#
|
|
904
|
+
# @param request [::Google::Cloud::Observability::V1::ListDatasetsRequest, ::Hash]
|
|
905
|
+
# A request object representing the call parameters. Required. To specify no
|
|
906
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
907
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
908
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
909
|
+
#
|
|
910
|
+
# @overload list_datasets(parent: nil, page_size: nil, page_token: nil, show_deleted: nil)
|
|
911
|
+
# Pass arguments to `list_datasets` via keyword arguments. Note that at
|
|
912
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
913
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
914
|
+
#
|
|
915
|
+
# @param parent [::String]
|
|
916
|
+
# Required. The parent bucket that owns this collection of datasets. The
|
|
917
|
+
# format is:
|
|
918
|
+
#
|
|
919
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]
|
|
920
|
+
# @param page_size [::Integer]
|
|
921
|
+
# Optional. The maximum number of datasets to return. If unspecified, then at
|
|
922
|
+
# most 100 datasets are returned. The maximum value is 1000; values above
|
|
923
|
+
# 1000 are coerced to 1000.
|
|
924
|
+
# @param page_token [::String]
|
|
925
|
+
# Optional. A page token, received from a previous `ListDatasets` call.
|
|
926
|
+
# Provide this to retrieve the subsequent page.
|
|
927
|
+
# @param show_deleted [::Boolean]
|
|
928
|
+
# Optional. If true, then the response will include deleted datasets.
|
|
929
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
930
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::Dataset>]
|
|
931
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
932
|
+
#
|
|
933
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::Dataset>]
|
|
934
|
+
#
|
|
935
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
936
|
+
#
|
|
937
|
+
# @example Basic example
|
|
938
|
+
# require "google/cloud/observability/v1"
|
|
939
|
+
#
|
|
940
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
941
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
942
|
+
#
|
|
943
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
944
|
+
# request = Google::Cloud::Observability::V1::ListDatasetsRequest.new
|
|
945
|
+
#
|
|
946
|
+
# # Call the list_datasets method.
|
|
947
|
+
# result = client.list_datasets request
|
|
948
|
+
#
|
|
949
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
950
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
951
|
+
# result.each do |item|
|
|
952
|
+
# # Each element is of type ::Google::Cloud::Observability::V1::Dataset.
|
|
953
|
+
# p item
|
|
954
|
+
# end
|
|
955
|
+
#
|
|
956
|
+
def list_datasets request, options = nil
|
|
957
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
958
|
+
|
|
959
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListDatasetsRequest
|
|
960
|
+
|
|
961
|
+
# Converts hash and nil to an options object
|
|
962
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
963
|
+
|
|
964
|
+
# Customize the options with defaults
|
|
965
|
+
call_metadata = @config.rpcs.list_datasets.metadata.to_h
|
|
966
|
+
|
|
967
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
968
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
969
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
970
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
971
|
+
transports_version_send: [:rest]
|
|
972
|
+
|
|
973
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
974
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
975
|
+
|
|
976
|
+
options.apply_defaults timeout: @config.rpcs.list_datasets.timeout,
|
|
977
|
+
metadata: call_metadata,
|
|
978
|
+
retry_policy: @config.rpcs.list_datasets.retry_policy
|
|
979
|
+
|
|
980
|
+
options.apply_defaults timeout: @config.timeout,
|
|
981
|
+
metadata: @config.metadata,
|
|
982
|
+
retry_policy: @config.retry_policy
|
|
983
|
+
|
|
984
|
+
@observability_stub.list_datasets request, options do |result, operation|
|
|
985
|
+
result = ::Gapic::Rest::PagedEnumerable.new @observability_stub, :list_datasets, "datasets", request, result, options
|
|
986
|
+
yield result, operation if block_given?
|
|
987
|
+
throw :response, result
|
|
988
|
+
end
|
|
989
|
+
rescue ::Gapic::Rest::Error => e
|
|
990
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
991
|
+
end
|
|
992
|
+
|
|
993
|
+
##
|
|
994
|
+
# Get a view.
|
|
995
|
+
#
|
|
996
|
+
# @overload get_view(request, options = nil)
|
|
997
|
+
# Pass arguments to `get_view` via a request object, either of type
|
|
998
|
+
# {::Google::Cloud::Observability::V1::GetViewRequest} or an equivalent Hash.
|
|
999
|
+
#
|
|
1000
|
+
# @param request [::Google::Cloud::Observability::V1::GetViewRequest, ::Hash]
|
|
1001
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1002
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1003
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1004
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1005
|
+
#
|
|
1006
|
+
# @overload get_view(name: nil)
|
|
1007
|
+
# Pass arguments to `get_view` via keyword arguments. Note that at
|
|
1008
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1009
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1010
|
+
#
|
|
1011
|
+
# @param name [::String]
|
|
1012
|
+
# Required. Name of the view to retrieve. The format is:
|
|
1013
|
+
#
|
|
1014
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/views/[VIEW_ID]
|
|
1015
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1016
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::View]
|
|
1017
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1018
|
+
#
|
|
1019
|
+
# @return [::Google::Cloud::Observability::V1::View]
|
|
1020
|
+
#
|
|
1021
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1022
|
+
#
|
|
1023
|
+
# @example Basic example
|
|
1024
|
+
# require "google/cloud/observability/v1"
|
|
1025
|
+
#
|
|
1026
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1027
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1028
|
+
#
|
|
1029
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1030
|
+
# request = Google::Cloud::Observability::V1::GetViewRequest.new
|
|
1031
|
+
#
|
|
1032
|
+
# # Call the get_view method.
|
|
1033
|
+
# result = client.get_view request
|
|
1034
|
+
#
|
|
1035
|
+
# # The returned object is of type Google::Cloud::Observability::V1::View.
|
|
1036
|
+
# p result
|
|
1037
|
+
#
|
|
1038
|
+
def get_view request, options = nil
|
|
1039
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1040
|
+
|
|
1041
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetViewRequest
|
|
1042
|
+
|
|
1043
|
+
# Converts hash and nil to an options object
|
|
1044
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1045
|
+
|
|
1046
|
+
# Customize the options with defaults
|
|
1047
|
+
call_metadata = @config.rpcs.get_view.metadata.to_h
|
|
1048
|
+
|
|
1049
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1050
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1051
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1052
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1053
|
+
transports_version_send: [:rest]
|
|
1054
|
+
|
|
1055
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1056
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1057
|
+
|
|
1058
|
+
options.apply_defaults timeout: @config.rpcs.get_view.timeout,
|
|
1059
|
+
metadata: call_metadata,
|
|
1060
|
+
retry_policy: @config.rpcs.get_view.retry_policy
|
|
1061
|
+
|
|
1062
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1063
|
+
metadata: @config.metadata,
|
|
1064
|
+
retry_policy: @config.retry_policy
|
|
1065
|
+
|
|
1066
|
+
@observability_stub.get_view request, options do |result, operation|
|
|
1067
|
+
yield result, operation if block_given?
|
|
1068
|
+
end
|
|
1069
|
+
rescue ::Gapic::Rest::Error => e
|
|
1070
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1071
|
+
end
|
|
1072
|
+
|
|
1073
|
+
##
|
|
1074
|
+
# List views of a dataset.
|
|
1075
|
+
#
|
|
1076
|
+
# @overload list_views(request, options = nil)
|
|
1077
|
+
# Pass arguments to `list_views` via a request object, either of type
|
|
1078
|
+
# {::Google::Cloud::Observability::V1::ListViewsRequest} or an equivalent Hash.
|
|
1079
|
+
#
|
|
1080
|
+
# @param request [::Google::Cloud::Observability::V1::ListViewsRequest, ::Hash]
|
|
1081
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1082
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1083
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1084
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1085
|
+
#
|
|
1086
|
+
# @overload list_views(parent: nil, page_size: nil, page_token: nil)
|
|
1087
|
+
# Pass arguments to `list_views` via keyword arguments. Note that at
|
|
1088
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1089
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1090
|
+
#
|
|
1091
|
+
# @param parent [::String]
|
|
1092
|
+
# Required. Dataset whose views are to be listed. The format is:
|
|
1093
|
+
#
|
|
1094
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]
|
|
1095
|
+
# @param page_size [::Integer]
|
|
1096
|
+
# Optional. The maximum number of views to return. If unspecified, then at
|
|
1097
|
+
# most 100 views are returned. The maximum value is 1000; values above 1000
|
|
1098
|
+
# are coerced to 1000.
|
|
1099
|
+
# @param page_token [::String]
|
|
1100
|
+
# Optional. A page token, received from a previous `ListViews` call. Provide
|
|
1101
|
+
# this to retrieve the subsequent page.
|
|
1102
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1103
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::View>]
|
|
1104
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1105
|
+
#
|
|
1106
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::View>]
|
|
1107
|
+
#
|
|
1108
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1109
|
+
#
|
|
1110
|
+
# @example Basic example
|
|
1111
|
+
# require "google/cloud/observability/v1"
|
|
1112
|
+
#
|
|
1113
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1114
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1115
|
+
#
|
|
1116
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1117
|
+
# request = Google::Cloud::Observability::V1::ListViewsRequest.new
|
|
1118
|
+
#
|
|
1119
|
+
# # Call the list_views method.
|
|
1120
|
+
# result = client.list_views request
|
|
1121
|
+
#
|
|
1122
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
1123
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
1124
|
+
# result.each do |item|
|
|
1125
|
+
# # Each element is of type ::Google::Cloud::Observability::V1::View.
|
|
1126
|
+
# p item
|
|
1127
|
+
# end
|
|
1128
|
+
#
|
|
1129
|
+
def list_views request, options = nil
|
|
1130
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1131
|
+
|
|
1132
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListViewsRequest
|
|
1133
|
+
|
|
1134
|
+
# Converts hash and nil to an options object
|
|
1135
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1136
|
+
|
|
1137
|
+
# Customize the options with defaults
|
|
1138
|
+
call_metadata = @config.rpcs.list_views.metadata.to_h
|
|
1139
|
+
|
|
1140
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1141
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1142
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1143
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1144
|
+
transports_version_send: [:rest]
|
|
1145
|
+
|
|
1146
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1147
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1148
|
+
|
|
1149
|
+
options.apply_defaults timeout: @config.rpcs.list_views.timeout,
|
|
1150
|
+
metadata: call_metadata,
|
|
1151
|
+
retry_policy: @config.rpcs.list_views.retry_policy
|
|
1152
|
+
|
|
1153
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1154
|
+
metadata: @config.metadata,
|
|
1155
|
+
retry_policy: @config.retry_policy
|
|
1156
|
+
|
|
1157
|
+
@observability_stub.list_views request, options do |result, operation|
|
|
1158
|
+
result = ::Gapic::Rest::PagedEnumerable.new @observability_stub, :list_views, "views", request, result, options
|
|
1159
|
+
yield result, operation if block_given?
|
|
1160
|
+
throw :response, result
|
|
1161
|
+
end
|
|
1162
|
+
rescue ::Gapic::Rest::Error => e
|
|
1163
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1164
|
+
end
|
|
1165
|
+
|
|
1166
|
+
##
|
|
1167
|
+
# Get a link.
|
|
1168
|
+
#
|
|
1169
|
+
# @overload get_link(request, options = nil)
|
|
1170
|
+
# Pass arguments to `get_link` via a request object, either of type
|
|
1171
|
+
# {::Google::Cloud::Observability::V1::GetLinkRequest} or an equivalent Hash.
|
|
1172
|
+
#
|
|
1173
|
+
# @param request [::Google::Cloud::Observability::V1::GetLinkRequest, ::Hash]
|
|
1174
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1175
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1176
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1177
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1178
|
+
#
|
|
1179
|
+
# @overload get_link(name: nil)
|
|
1180
|
+
# Pass arguments to `get_link` via keyword arguments. Note that at
|
|
1181
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1182
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1183
|
+
#
|
|
1184
|
+
# @param name [::String]
|
|
1185
|
+
# Required. Name of the link to retrieve. The format is:
|
|
1186
|
+
#
|
|
1187
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID]
|
|
1188
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1189
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::Link]
|
|
1190
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1191
|
+
#
|
|
1192
|
+
# @return [::Google::Cloud::Observability::V1::Link]
|
|
1193
|
+
#
|
|
1194
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1195
|
+
#
|
|
1196
|
+
# @example Basic example
|
|
1197
|
+
# require "google/cloud/observability/v1"
|
|
1198
|
+
#
|
|
1199
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1200
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1201
|
+
#
|
|
1202
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1203
|
+
# request = Google::Cloud::Observability::V1::GetLinkRequest.new
|
|
1204
|
+
#
|
|
1205
|
+
# # Call the get_link method.
|
|
1206
|
+
# result = client.get_link request
|
|
1207
|
+
#
|
|
1208
|
+
# # The returned object is of type Google::Cloud::Observability::V1::Link.
|
|
1209
|
+
# p result
|
|
1210
|
+
#
|
|
1211
|
+
def get_link request, options = nil
|
|
1212
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1213
|
+
|
|
1214
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetLinkRequest
|
|
1215
|
+
|
|
1216
|
+
# Converts hash and nil to an options object
|
|
1217
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1218
|
+
|
|
1219
|
+
# Customize the options with defaults
|
|
1220
|
+
call_metadata = @config.rpcs.get_link.metadata.to_h
|
|
1221
|
+
|
|
1222
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1223
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1224
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1225
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1226
|
+
transports_version_send: [:rest]
|
|
1227
|
+
|
|
1228
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1229
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1230
|
+
|
|
1231
|
+
options.apply_defaults timeout: @config.rpcs.get_link.timeout,
|
|
1232
|
+
metadata: call_metadata,
|
|
1233
|
+
retry_policy: @config.rpcs.get_link.retry_policy
|
|
1234
|
+
|
|
1235
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1236
|
+
metadata: @config.metadata,
|
|
1237
|
+
retry_policy: @config.retry_policy
|
|
1238
|
+
|
|
1239
|
+
@observability_stub.get_link request, options do |result, operation|
|
|
1240
|
+
yield result, operation if block_given?
|
|
1241
|
+
end
|
|
1242
|
+
rescue ::Gapic::Rest::Error => e
|
|
1243
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1244
|
+
end
|
|
1245
|
+
|
|
1246
|
+
##
|
|
1247
|
+
# List links of a dataset.
|
|
1248
|
+
#
|
|
1249
|
+
# @overload list_links(request, options = nil)
|
|
1250
|
+
# Pass arguments to `list_links` via a request object, either of type
|
|
1251
|
+
# {::Google::Cloud::Observability::V1::ListLinksRequest} or an equivalent Hash.
|
|
1252
|
+
#
|
|
1253
|
+
# @param request [::Google::Cloud::Observability::V1::ListLinksRequest, ::Hash]
|
|
1254
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1255
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1256
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1257
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1258
|
+
#
|
|
1259
|
+
# @overload list_links(parent: nil, page_size: nil, page_token: nil)
|
|
1260
|
+
# Pass arguments to `list_links` via keyword arguments. Note that at
|
|
1261
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1262
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1263
|
+
#
|
|
1264
|
+
# @param parent [::String]
|
|
1265
|
+
# Required. The parent dataset that owns this collection of links. The format
|
|
1266
|
+
# is:
|
|
1267
|
+
#
|
|
1268
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]
|
|
1269
|
+
# @param page_size [::Integer]
|
|
1270
|
+
# Optional. The maximum number of links to return. If unspecified, then at
|
|
1271
|
+
# most 100 links are returned. The maximum value is 1000; values above 1000
|
|
1272
|
+
# are coerced to 1000.
|
|
1273
|
+
# @param page_token [::String]
|
|
1274
|
+
# Optional. A page token, received from a previous `ListLinks` call. Provide
|
|
1275
|
+
# this to retrieve the subsequent page.
|
|
1276
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1277
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::Link>]
|
|
1278
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1279
|
+
#
|
|
1280
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::Link>]
|
|
1281
|
+
#
|
|
1282
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1283
|
+
#
|
|
1284
|
+
# @example Basic example
|
|
1285
|
+
# require "google/cloud/observability/v1"
|
|
1286
|
+
#
|
|
1287
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1288
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1289
|
+
#
|
|
1290
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1291
|
+
# request = Google::Cloud::Observability::V1::ListLinksRequest.new
|
|
1292
|
+
#
|
|
1293
|
+
# # Call the list_links method.
|
|
1294
|
+
# result = client.list_links request
|
|
1295
|
+
#
|
|
1296
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
1297
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
1298
|
+
# result.each do |item|
|
|
1299
|
+
# # Each element is of type ::Google::Cloud::Observability::V1::Link.
|
|
1300
|
+
# p item
|
|
1301
|
+
# end
|
|
1302
|
+
#
|
|
1303
|
+
def list_links request, options = nil
|
|
1304
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1305
|
+
|
|
1306
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListLinksRequest
|
|
1307
|
+
|
|
1308
|
+
# Converts hash and nil to an options object
|
|
1309
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1310
|
+
|
|
1311
|
+
# Customize the options with defaults
|
|
1312
|
+
call_metadata = @config.rpcs.list_links.metadata.to_h
|
|
1313
|
+
|
|
1314
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1315
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1316
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1317
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1318
|
+
transports_version_send: [:rest]
|
|
1319
|
+
|
|
1320
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1321
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1322
|
+
|
|
1323
|
+
options.apply_defaults timeout: @config.rpcs.list_links.timeout,
|
|
1324
|
+
metadata: call_metadata,
|
|
1325
|
+
retry_policy: @config.rpcs.list_links.retry_policy
|
|
1326
|
+
|
|
1327
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1328
|
+
metadata: @config.metadata,
|
|
1329
|
+
retry_policy: @config.retry_policy
|
|
1330
|
+
|
|
1331
|
+
@observability_stub.list_links request, options do |result, operation|
|
|
1332
|
+
result = ::Gapic::Rest::PagedEnumerable.new @observability_stub, :list_links, "links", request, result, options
|
|
1333
|
+
yield result, operation if block_given?
|
|
1334
|
+
throw :response, result
|
|
1335
|
+
end
|
|
1336
|
+
rescue ::Gapic::Rest::Error => e
|
|
1337
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1338
|
+
end
|
|
1339
|
+
|
|
1340
|
+
##
|
|
1341
|
+
# Create a new link.
|
|
1342
|
+
#
|
|
1343
|
+
# @overload create_link(request, options = nil)
|
|
1344
|
+
# Pass arguments to `create_link` via a request object, either of type
|
|
1345
|
+
# {::Google::Cloud::Observability::V1::CreateLinkRequest} or an equivalent Hash.
|
|
1346
|
+
#
|
|
1347
|
+
# @param request [::Google::Cloud::Observability::V1::CreateLinkRequest, ::Hash]
|
|
1348
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1349
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1350
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1351
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1352
|
+
#
|
|
1353
|
+
# @overload create_link(parent: nil, link_id: nil, link: nil)
|
|
1354
|
+
# Pass arguments to `create_link` via keyword arguments. Note that at
|
|
1355
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1356
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1357
|
+
#
|
|
1358
|
+
# @param parent [::String]
|
|
1359
|
+
# Required. Name of the containing dataset for this link. The format is:
|
|
1360
|
+
#
|
|
1361
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]
|
|
1362
|
+
# @param link_id [::String]
|
|
1363
|
+
# Required. Id of the link to create.
|
|
1364
|
+
# @param link [::Google::Cloud::Observability::V1::Link, ::Hash]
|
|
1365
|
+
# Required. Link to create.
|
|
1366
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1367
|
+
# @yieldparam result [::Gapic::Operation]
|
|
1368
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1369
|
+
#
|
|
1370
|
+
# @return [::Gapic::Operation]
|
|
1371
|
+
#
|
|
1372
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1373
|
+
#
|
|
1374
|
+
# @example Basic example
|
|
1375
|
+
# require "google/cloud/observability/v1"
|
|
1376
|
+
#
|
|
1377
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1378
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1379
|
+
#
|
|
1380
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1381
|
+
# request = Google::Cloud::Observability::V1::CreateLinkRequest.new
|
|
1382
|
+
#
|
|
1383
|
+
# # Call the create_link method.
|
|
1384
|
+
# result = client.create_link request
|
|
1385
|
+
#
|
|
1386
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
1387
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
1388
|
+
# # Here is how to wait for a response.
|
|
1389
|
+
# result.wait_until_done! timeout: 60
|
|
1390
|
+
# if result.response?
|
|
1391
|
+
# p result.response
|
|
1392
|
+
# else
|
|
1393
|
+
# puts "No response received."
|
|
1394
|
+
# end
|
|
1395
|
+
#
|
|
1396
|
+
def create_link request, options = nil
|
|
1397
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1398
|
+
|
|
1399
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::CreateLinkRequest
|
|
1400
|
+
|
|
1401
|
+
# Converts hash and nil to an options object
|
|
1402
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1403
|
+
|
|
1404
|
+
# Customize the options with defaults
|
|
1405
|
+
call_metadata = @config.rpcs.create_link.metadata.to_h
|
|
1406
|
+
|
|
1407
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1408
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1409
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1410
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1411
|
+
transports_version_send: [:rest]
|
|
1412
|
+
|
|
1413
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1414
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1415
|
+
|
|
1416
|
+
options.apply_defaults timeout: @config.rpcs.create_link.timeout,
|
|
1417
|
+
metadata: call_metadata,
|
|
1418
|
+
retry_policy: @config.rpcs.create_link.retry_policy
|
|
1419
|
+
|
|
1420
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1421
|
+
metadata: @config.metadata,
|
|
1422
|
+
retry_policy: @config.retry_policy
|
|
1423
|
+
|
|
1424
|
+
@observability_stub.create_link request, options do |result, operation|
|
|
1425
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
1426
|
+
yield result, operation if block_given?
|
|
1427
|
+
throw :response, result
|
|
1428
|
+
end
|
|
1429
|
+
rescue ::Gapic::Rest::Error => e
|
|
1430
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1431
|
+
end
|
|
1432
|
+
|
|
1433
|
+
##
|
|
1434
|
+
# Update a link.
|
|
1435
|
+
#
|
|
1436
|
+
# @overload update_link(request, options = nil)
|
|
1437
|
+
# Pass arguments to `update_link` via a request object, either of type
|
|
1438
|
+
# {::Google::Cloud::Observability::V1::UpdateLinkRequest} or an equivalent Hash.
|
|
1439
|
+
#
|
|
1440
|
+
# @param request [::Google::Cloud::Observability::V1::UpdateLinkRequest, ::Hash]
|
|
1441
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1442
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1443
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1444
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1445
|
+
#
|
|
1446
|
+
# @overload update_link(link: nil, update_mask: nil)
|
|
1447
|
+
# Pass arguments to `update_link` via keyword arguments. Note that at
|
|
1448
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1449
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1450
|
+
#
|
|
1451
|
+
# @param link [::Google::Cloud::Observability::V1::Link, ::Hash]
|
|
1452
|
+
# Required. Link to update.
|
|
1453
|
+
#
|
|
1454
|
+
# The name field of link identifies the resource to update.
|
|
1455
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
1456
|
+
# Optional. The list of fields to update.
|
|
1457
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1458
|
+
# @yieldparam result [::Gapic::Operation]
|
|
1459
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1460
|
+
#
|
|
1461
|
+
# @return [::Gapic::Operation]
|
|
1462
|
+
#
|
|
1463
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1464
|
+
#
|
|
1465
|
+
# @example Basic example
|
|
1466
|
+
# require "google/cloud/observability/v1"
|
|
1467
|
+
#
|
|
1468
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1469
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1470
|
+
#
|
|
1471
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1472
|
+
# request = Google::Cloud::Observability::V1::UpdateLinkRequest.new
|
|
1473
|
+
#
|
|
1474
|
+
# # Call the update_link method.
|
|
1475
|
+
# result = client.update_link request
|
|
1476
|
+
#
|
|
1477
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
1478
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
1479
|
+
# # Here is how to wait for a response.
|
|
1480
|
+
# result.wait_until_done! timeout: 60
|
|
1481
|
+
# if result.response?
|
|
1482
|
+
# p result.response
|
|
1483
|
+
# else
|
|
1484
|
+
# puts "No response received."
|
|
1485
|
+
# end
|
|
1486
|
+
#
|
|
1487
|
+
def update_link request, options = nil
|
|
1488
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1489
|
+
|
|
1490
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateLinkRequest
|
|
1491
|
+
|
|
1492
|
+
# Converts hash and nil to an options object
|
|
1493
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1494
|
+
|
|
1495
|
+
# Customize the options with defaults
|
|
1496
|
+
call_metadata = @config.rpcs.update_link.metadata.to_h
|
|
1497
|
+
|
|
1498
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1499
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1500
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1501
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1502
|
+
transports_version_send: [:rest]
|
|
1503
|
+
|
|
1504
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1505
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1506
|
+
|
|
1507
|
+
options.apply_defaults timeout: @config.rpcs.update_link.timeout,
|
|
1508
|
+
metadata: call_metadata,
|
|
1509
|
+
retry_policy: @config.rpcs.update_link.retry_policy
|
|
1510
|
+
|
|
1511
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1512
|
+
metadata: @config.metadata,
|
|
1513
|
+
retry_policy: @config.retry_policy
|
|
1514
|
+
|
|
1515
|
+
@observability_stub.update_link request, options do |result, operation|
|
|
1516
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
1517
|
+
yield result, operation if block_given?
|
|
1518
|
+
throw :response, result
|
|
1519
|
+
end
|
|
1520
|
+
rescue ::Gapic::Rest::Error => e
|
|
1521
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1522
|
+
end
|
|
1523
|
+
|
|
1524
|
+
##
|
|
1525
|
+
# Delete a link.
|
|
1526
|
+
#
|
|
1527
|
+
# @overload delete_link(request, options = nil)
|
|
1528
|
+
# Pass arguments to `delete_link` via a request object, either of type
|
|
1529
|
+
# {::Google::Cloud::Observability::V1::DeleteLinkRequest} or an equivalent Hash.
|
|
1530
|
+
#
|
|
1531
|
+
# @param request [::Google::Cloud::Observability::V1::DeleteLinkRequest, ::Hash]
|
|
1532
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1533
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1534
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1535
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1536
|
+
#
|
|
1537
|
+
# @overload delete_link(name: nil)
|
|
1538
|
+
# Pass arguments to `delete_link` via keyword arguments. Note that at
|
|
1539
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1540
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1541
|
+
#
|
|
1542
|
+
# @param name [::String]
|
|
1543
|
+
# Required. Name of the link to delete. The format is:
|
|
1544
|
+
#
|
|
1545
|
+
# projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID]
|
|
1546
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1547
|
+
# @yieldparam result [::Gapic::Operation]
|
|
1548
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1549
|
+
#
|
|
1550
|
+
# @return [::Gapic::Operation]
|
|
1551
|
+
#
|
|
1552
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1553
|
+
#
|
|
1554
|
+
# @example Basic example
|
|
1555
|
+
# require "google/cloud/observability/v1"
|
|
1556
|
+
#
|
|
1557
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1558
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1559
|
+
#
|
|
1560
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1561
|
+
# request = Google::Cloud::Observability::V1::DeleteLinkRequest.new
|
|
1562
|
+
#
|
|
1563
|
+
# # Call the delete_link method.
|
|
1564
|
+
# result = client.delete_link request
|
|
1565
|
+
#
|
|
1566
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
1567
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
1568
|
+
# # Here is how to wait for a response.
|
|
1569
|
+
# result.wait_until_done! timeout: 60
|
|
1570
|
+
# if result.response?
|
|
1571
|
+
# p result.response
|
|
1572
|
+
# else
|
|
1573
|
+
# puts "No response received."
|
|
1574
|
+
# end
|
|
1575
|
+
#
|
|
1576
|
+
def delete_link request, options = nil
|
|
1577
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1578
|
+
|
|
1579
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::DeleteLinkRequest
|
|
1580
|
+
|
|
1581
|
+
# Converts hash and nil to an options object
|
|
1582
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1583
|
+
|
|
1584
|
+
# Customize the options with defaults
|
|
1585
|
+
call_metadata = @config.rpcs.delete_link.metadata.to_h
|
|
1586
|
+
|
|
1587
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1588
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1589
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1590
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1591
|
+
transports_version_send: [:rest]
|
|
1592
|
+
|
|
1593
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1594
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1595
|
+
|
|
1596
|
+
options.apply_defaults timeout: @config.rpcs.delete_link.timeout,
|
|
1597
|
+
metadata: call_metadata,
|
|
1598
|
+
retry_policy: @config.rpcs.delete_link.retry_policy
|
|
1599
|
+
|
|
1600
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1601
|
+
metadata: @config.metadata,
|
|
1602
|
+
retry_policy: @config.retry_policy
|
|
1603
|
+
|
|
1604
|
+
@observability_stub.delete_link request, options do |result, operation|
|
|
1605
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
1606
|
+
yield result, operation if block_given?
|
|
1607
|
+
throw :response, result
|
|
1608
|
+
end
|
|
1609
|
+
rescue ::Gapic::Rest::Error => e
|
|
1610
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1611
|
+
end
|
|
1612
|
+
|
|
1613
|
+
##
|
|
1614
|
+
# Get TraceScope resource.
|
|
1615
|
+
#
|
|
1616
|
+
# @overload get_trace_scope(request, options = nil)
|
|
1617
|
+
# Pass arguments to `get_trace_scope` via a request object, either of type
|
|
1618
|
+
# {::Google::Cloud::Observability::V1::GetTraceScopeRequest} or an equivalent Hash.
|
|
1619
|
+
#
|
|
1620
|
+
# @param request [::Google::Cloud::Observability::V1::GetTraceScopeRequest, ::Hash]
|
|
1621
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1622
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1623
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1624
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1625
|
+
#
|
|
1626
|
+
# @overload get_trace_scope(name: nil)
|
|
1627
|
+
# Pass arguments to `get_trace_scope` via keyword arguments. Note that at
|
|
1628
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1629
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1630
|
+
#
|
|
1631
|
+
# @param name [::String]
|
|
1632
|
+
# Required. The resource name of the trace scope:
|
|
1633
|
+
#
|
|
1634
|
+
# projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID]
|
|
1635
|
+
#
|
|
1636
|
+
# For example:
|
|
1637
|
+
#
|
|
1638
|
+
# projects/my-project/locations/global/traceScopes/my-trace-scope
|
|
1639
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1640
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::TraceScope]
|
|
1641
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1642
|
+
#
|
|
1643
|
+
# @return [::Google::Cloud::Observability::V1::TraceScope]
|
|
1644
|
+
#
|
|
1645
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1646
|
+
#
|
|
1647
|
+
# @example Basic example
|
|
1648
|
+
# require "google/cloud/observability/v1"
|
|
1649
|
+
#
|
|
1650
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1651
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1652
|
+
#
|
|
1653
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1654
|
+
# request = Google::Cloud::Observability::V1::GetTraceScopeRequest.new
|
|
1655
|
+
#
|
|
1656
|
+
# # Call the get_trace_scope method.
|
|
1657
|
+
# result = client.get_trace_scope request
|
|
1658
|
+
#
|
|
1659
|
+
# # The returned object is of type Google::Cloud::Observability::V1::TraceScope.
|
|
1660
|
+
# p result
|
|
1661
|
+
#
|
|
1662
|
+
def get_trace_scope request, options = nil
|
|
1663
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1664
|
+
|
|
1665
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetTraceScopeRequest
|
|
1666
|
+
|
|
1667
|
+
# Converts hash and nil to an options object
|
|
1668
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1669
|
+
|
|
1670
|
+
# Customize the options with defaults
|
|
1671
|
+
call_metadata = @config.rpcs.get_trace_scope.metadata.to_h
|
|
1672
|
+
|
|
1673
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1674
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1675
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1676
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1677
|
+
transports_version_send: [:rest]
|
|
1678
|
+
|
|
1679
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1680
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1681
|
+
|
|
1682
|
+
options.apply_defaults timeout: @config.rpcs.get_trace_scope.timeout,
|
|
1683
|
+
metadata: call_metadata,
|
|
1684
|
+
retry_policy: @config.rpcs.get_trace_scope.retry_policy
|
|
1685
|
+
|
|
1686
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1687
|
+
metadata: @config.metadata,
|
|
1688
|
+
retry_policy: @config.retry_policy
|
|
1689
|
+
|
|
1690
|
+
@observability_stub.get_trace_scope request, options do |result, operation|
|
|
1691
|
+
yield result, operation if block_given?
|
|
1692
|
+
end
|
|
1693
|
+
rescue ::Gapic::Rest::Error => e
|
|
1694
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1695
|
+
end
|
|
1696
|
+
|
|
1697
|
+
##
|
|
1698
|
+
# List TraceScopes of a project in a particular location.
|
|
1699
|
+
#
|
|
1700
|
+
# @overload list_trace_scopes(request, options = nil)
|
|
1701
|
+
# Pass arguments to `list_trace_scopes` via a request object, either of type
|
|
1702
|
+
# {::Google::Cloud::Observability::V1::ListTraceScopesRequest} or an equivalent Hash.
|
|
1703
|
+
#
|
|
1704
|
+
# @param request [::Google::Cloud::Observability::V1::ListTraceScopesRequest, ::Hash]
|
|
1705
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1706
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1707
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1708
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1709
|
+
#
|
|
1710
|
+
# @overload list_trace_scopes(parent: nil, page_size: nil, page_token: nil)
|
|
1711
|
+
# Pass arguments to `list_trace_scopes` via keyword arguments. Note that at
|
|
1712
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1713
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1714
|
+
#
|
|
1715
|
+
# @param parent [::String]
|
|
1716
|
+
# Required. The full resource name of the location to look for trace scopes:
|
|
1717
|
+
#
|
|
1718
|
+
# projects/[PROJECT_ID]/locations/[LOCATION_ID]
|
|
1719
|
+
#
|
|
1720
|
+
# For example:
|
|
1721
|
+
#
|
|
1722
|
+
# projects/my-project/locations/global
|
|
1723
|
+
# @param page_size [::Integer]
|
|
1724
|
+
# Optional. The maximum number of results to return from this request.
|
|
1725
|
+
#
|
|
1726
|
+
# Non-positive values are ignored. The presence of `next_page_token` in the
|
|
1727
|
+
# response indicates that more results might be available.
|
|
1728
|
+
# @param page_token [::String]
|
|
1729
|
+
# Optional. If present, then retrieve the next batch of results from the
|
|
1730
|
+
# preceding call to this method. `page_token` must be the value of
|
|
1731
|
+
# `next_page_token` from the previous response. The values of other method
|
|
1732
|
+
# parameters should be identical to those in the previous call.
|
|
1733
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1734
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::TraceScope>]
|
|
1735
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1736
|
+
#
|
|
1737
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Observability::V1::TraceScope>]
|
|
1738
|
+
#
|
|
1739
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1740
|
+
#
|
|
1741
|
+
# @example Basic example
|
|
1742
|
+
# require "google/cloud/observability/v1"
|
|
1743
|
+
#
|
|
1744
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1745
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1746
|
+
#
|
|
1747
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1748
|
+
# request = Google::Cloud::Observability::V1::ListTraceScopesRequest.new
|
|
1749
|
+
#
|
|
1750
|
+
# # Call the list_trace_scopes method.
|
|
1751
|
+
# result = client.list_trace_scopes request
|
|
1752
|
+
#
|
|
1753
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
1754
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
1755
|
+
# result.each do |item|
|
|
1756
|
+
# # Each element is of type ::Google::Cloud::Observability::V1::TraceScope.
|
|
1757
|
+
# p item
|
|
1758
|
+
# end
|
|
1759
|
+
#
|
|
1760
|
+
def list_trace_scopes request, options = nil
|
|
1761
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1762
|
+
|
|
1763
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::ListTraceScopesRequest
|
|
1764
|
+
|
|
1765
|
+
# Converts hash and nil to an options object
|
|
1766
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1767
|
+
|
|
1768
|
+
# Customize the options with defaults
|
|
1769
|
+
call_metadata = @config.rpcs.list_trace_scopes.metadata.to_h
|
|
1770
|
+
|
|
1771
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1772
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1773
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1774
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1775
|
+
transports_version_send: [:rest]
|
|
1776
|
+
|
|
1777
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1778
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1779
|
+
|
|
1780
|
+
options.apply_defaults timeout: @config.rpcs.list_trace_scopes.timeout,
|
|
1781
|
+
metadata: call_metadata,
|
|
1782
|
+
retry_policy: @config.rpcs.list_trace_scopes.retry_policy
|
|
1783
|
+
|
|
1784
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1785
|
+
metadata: @config.metadata,
|
|
1786
|
+
retry_policy: @config.retry_policy
|
|
1787
|
+
|
|
1788
|
+
@observability_stub.list_trace_scopes request, options do |result, operation|
|
|
1789
|
+
result = ::Gapic::Rest::PagedEnumerable.new @observability_stub, :list_trace_scopes, "trace_scopes", request, result, options
|
|
1790
|
+
yield result, operation if block_given?
|
|
1791
|
+
throw :response, result
|
|
1792
|
+
end
|
|
1793
|
+
rescue ::Gapic::Rest::Error => e
|
|
1794
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1795
|
+
end
|
|
1796
|
+
|
|
1797
|
+
##
|
|
1798
|
+
# Create a new TraceScope.
|
|
1799
|
+
#
|
|
1800
|
+
# @overload create_trace_scope(request, options = nil)
|
|
1801
|
+
# Pass arguments to `create_trace_scope` via a request object, either of type
|
|
1802
|
+
# {::Google::Cloud::Observability::V1::CreateTraceScopeRequest} or an equivalent Hash.
|
|
1803
|
+
#
|
|
1804
|
+
# @param request [::Google::Cloud::Observability::V1::CreateTraceScopeRequest, ::Hash]
|
|
1805
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1806
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1807
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1808
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1809
|
+
#
|
|
1810
|
+
# @overload create_trace_scope(parent: nil, trace_scope_id: nil, trace_scope: nil)
|
|
1811
|
+
# Pass arguments to `create_trace_scope` via keyword arguments. Note that at
|
|
1812
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1813
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1814
|
+
#
|
|
1815
|
+
# @param parent [::String]
|
|
1816
|
+
# Required. The full resource name of the location where the trace scope
|
|
1817
|
+
# should be created
|
|
1818
|
+
#
|
|
1819
|
+
# projects/[PROJECT_ID]/locations/[LOCATION_ID]
|
|
1820
|
+
#
|
|
1821
|
+
# For example:
|
|
1822
|
+
#
|
|
1823
|
+
# projects/my-project/locations/global
|
|
1824
|
+
# @param trace_scope_id [::String]
|
|
1825
|
+
# Required. A client-assigned identifier for the trace scope.
|
|
1826
|
+
# @param trace_scope [::Google::Cloud::Observability::V1::TraceScope, ::Hash]
|
|
1827
|
+
# Required. The new trace scope.
|
|
1828
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1829
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::TraceScope]
|
|
1830
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1831
|
+
#
|
|
1832
|
+
# @return [::Google::Cloud::Observability::V1::TraceScope]
|
|
1833
|
+
#
|
|
1834
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1835
|
+
#
|
|
1836
|
+
# @example Basic example
|
|
1837
|
+
# require "google/cloud/observability/v1"
|
|
1838
|
+
#
|
|
1839
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1840
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1841
|
+
#
|
|
1842
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1843
|
+
# request = Google::Cloud::Observability::V1::CreateTraceScopeRequest.new
|
|
1844
|
+
#
|
|
1845
|
+
# # Call the create_trace_scope method.
|
|
1846
|
+
# result = client.create_trace_scope request
|
|
1847
|
+
#
|
|
1848
|
+
# # The returned object is of type Google::Cloud::Observability::V1::TraceScope.
|
|
1849
|
+
# p result
|
|
1850
|
+
#
|
|
1851
|
+
def create_trace_scope request, options = nil
|
|
1852
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1853
|
+
|
|
1854
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::CreateTraceScopeRequest
|
|
1855
|
+
|
|
1856
|
+
# Converts hash and nil to an options object
|
|
1857
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1858
|
+
|
|
1859
|
+
# Customize the options with defaults
|
|
1860
|
+
call_metadata = @config.rpcs.create_trace_scope.metadata.to_h
|
|
1861
|
+
|
|
1862
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1863
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1864
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1865
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1866
|
+
transports_version_send: [:rest]
|
|
1867
|
+
|
|
1868
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1869
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1870
|
+
|
|
1871
|
+
options.apply_defaults timeout: @config.rpcs.create_trace_scope.timeout,
|
|
1872
|
+
metadata: call_metadata,
|
|
1873
|
+
retry_policy: @config.rpcs.create_trace_scope.retry_policy
|
|
1874
|
+
|
|
1875
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1876
|
+
metadata: @config.metadata,
|
|
1877
|
+
retry_policy: @config.retry_policy
|
|
1878
|
+
|
|
1879
|
+
@observability_stub.create_trace_scope request, options do |result, operation|
|
|
1880
|
+
yield result, operation if block_given?
|
|
1881
|
+
end
|
|
1882
|
+
rescue ::Gapic::Rest::Error => e
|
|
1883
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1884
|
+
end
|
|
1885
|
+
|
|
1886
|
+
##
|
|
1887
|
+
# Update a TraceScope.
|
|
1888
|
+
#
|
|
1889
|
+
# @overload update_trace_scope(request, options = nil)
|
|
1890
|
+
# Pass arguments to `update_trace_scope` via a request object, either of type
|
|
1891
|
+
# {::Google::Cloud::Observability::V1::UpdateTraceScopeRequest} or an equivalent Hash.
|
|
1892
|
+
#
|
|
1893
|
+
# @param request [::Google::Cloud::Observability::V1::UpdateTraceScopeRequest, ::Hash]
|
|
1894
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1895
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1896
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1897
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1898
|
+
#
|
|
1899
|
+
# @overload update_trace_scope(trace_scope: nil, update_mask: nil)
|
|
1900
|
+
# Pass arguments to `update_trace_scope` via keyword arguments. Note that at
|
|
1901
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1902
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1903
|
+
#
|
|
1904
|
+
# @param trace_scope [::Google::Cloud::Observability::V1::TraceScope, ::Hash]
|
|
1905
|
+
# Required. The updated trace scope.
|
|
1906
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
1907
|
+
# Optional. The list of fields to update.
|
|
1908
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1909
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::TraceScope]
|
|
1910
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1911
|
+
#
|
|
1912
|
+
# @return [::Google::Cloud::Observability::V1::TraceScope]
|
|
1913
|
+
#
|
|
1914
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1915
|
+
#
|
|
1916
|
+
# @example Basic example
|
|
1917
|
+
# require "google/cloud/observability/v1"
|
|
1918
|
+
#
|
|
1919
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1920
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
1921
|
+
#
|
|
1922
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1923
|
+
# request = Google::Cloud::Observability::V1::UpdateTraceScopeRequest.new
|
|
1924
|
+
#
|
|
1925
|
+
# # Call the update_trace_scope method.
|
|
1926
|
+
# result = client.update_trace_scope request
|
|
1927
|
+
#
|
|
1928
|
+
# # The returned object is of type Google::Cloud::Observability::V1::TraceScope.
|
|
1929
|
+
# p result
|
|
1930
|
+
#
|
|
1931
|
+
def update_trace_scope request, options = nil
|
|
1932
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1933
|
+
|
|
1934
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateTraceScopeRequest
|
|
1935
|
+
|
|
1936
|
+
# Converts hash and nil to an options object
|
|
1937
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1938
|
+
|
|
1939
|
+
# Customize the options with defaults
|
|
1940
|
+
call_metadata = @config.rpcs.update_trace_scope.metadata.to_h
|
|
1941
|
+
|
|
1942
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1943
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1944
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1945
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
1946
|
+
transports_version_send: [:rest]
|
|
1947
|
+
|
|
1948
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1949
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1950
|
+
|
|
1951
|
+
options.apply_defaults timeout: @config.rpcs.update_trace_scope.timeout,
|
|
1952
|
+
metadata: call_metadata,
|
|
1953
|
+
retry_policy: @config.rpcs.update_trace_scope.retry_policy
|
|
1954
|
+
|
|
1955
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1956
|
+
metadata: @config.metadata,
|
|
1957
|
+
retry_policy: @config.retry_policy
|
|
1958
|
+
|
|
1959
|
+
@observability_stub.update_trace_scope request, options do |result, operation|
|
|
1960
|
+
yield result, operation if block_given?
|
|
1961
|
+
end
|
|
1962
|
+
rescue ::Gapic::Rest::Error => e
|
|
1963
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1964
|
+
end
|
|
1965
|
+
|
|
1966
|
+
##
|
|
1967
|
+
# Delete a TraceScope.
|
|
1968
|
+
#
|
|
1969
|
+
# @overload delete_trace_scope(request, options = nil)
|
|
1970
|
+
# Pass arguments to `delete_trace_scope` via a request object, either of type
|
|
1971
|
+
# {::Google::Cloud::Observability::V1::DeleteTraceScopeRequest} or an equivalent Hash.
|
|
1972
|
+
#
|
|
1973
|
+
# @param request [::Google::Cloud::Observability::V1::DeleteTraceScopeRequest, ::Hash]
|
|
1974
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1975
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1976
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1977
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1978
|
+
#
|
|
1979
|
+
# @overload delete_trace_scope(name: nil)
|
|
1980
|
+
# Pass arguments to `delete_trace_scope` via keyword arguments. Note that at
|
|
1981
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1982
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1983
|
+
#
|
|
1984
|
+
# @param name [::String]
|
|
1985
|
+
# Required. The full resource name of the trace scope to delete:
|
|
1986
|
+
#
|
|
1987
|
+
# projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID]
|
|
1988
|
+
#
|
|
1989
|
+
# For example:
|
|
1990
|
+
#
|
|
1991
|
+
# projects/my-project/locations/global/traceScopes/my-trace-scope
|
|
1992
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1993
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
|
1994
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1995
|
+
#
|
|
1996
|
+
# @return [::Google::Protobuf::Empty]
|
|
1997
|
+
#
|
|
1998
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1999
|
+
#
|
|
2000
|
+
# @example Basic example
|
|
2001
|
+
# require "google/cloud/observability/v1"
|
|
2002
|
+
#
|
|
2003
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2004
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
2005
|
+
#
|
|
2006
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2007
|
+
# request = Google::Cloud::Observability::V1::DeleteTraceScopeRequest.new
|
|
2008
|
+
#
|
|
2009
|
+
# # Call the delete_trace_scope method.
|
|
2010
|
+
# result = client.delete_trace_scope request
|
|
2011
|
+
#
|
|
2012
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
|
2013
|
+
# p result
|
|
2014
|
+
#
|
|
2015
|
+
def delete_trace_scope request, options = nil
|
|
2016
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2017
|
+
|
|
2018
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::DeleteTraceScopeRequest
|
|
2019
|
+
|
|
2020
|
+
# Converts hash and nil to an options object
|
|
2021
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2022
|
+
|
|
2023
|
+
# Customize the options with defaults
|
|
2024
|
+
call_metadata = @config.rpcs.delete_trace_scope.metadata.to_h
|
|
2025
|
+
|
|
2026
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2027
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2028
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2029
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
2030
|
+
transports_version_send: [:rest]
|
|
2031
|
+
|
|
2032
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2033
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2034
|
+
|
|
2035
|
+
options.apply_defaults timeout: @config.rpcs.delete_trace_scope.timeout,
|
|
2036
|
+
metadata: call_metadata,
|
|
2037
|
+
retry_policy: @config.rpcs.delete_trace_scope.retry_policy
|
|
2038
|
+
|
|
2039
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2040
|
+
metadata: @config.metadata,
|
|
2041
|
+
retry_policy: @config.retry_policy
|
|
2042
|
+
|
|
2043
|
+
@observability_stub.delete_trace_scope request, options do |result, operation|
|
|
2044
|
+
yield result, operation if block_given?
|
|
2045
|
+
end
|
|
2046
|
+
rescue ::Gapic::Rest::Error => e
|
|
2047
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2048
|
+
end
|
|
2049
|
+
|
|
2050
|
+
##
|
|
2051
|
+
# Get Settings
|
|
2052
|
+
#
|
|
2053
|
+
# @overload get_settings(request, options = nil)
|
|
2054
|
+
# Pass arguments to `get_settings` via a request object, either of type
|
|
2055
|
+
# {::Google::Cloud::Observability::V1::GetSettingsRequest} or an equivalent Hash.
|
|
2056
|
+
#
|
|
2057
|
+
# @param request [::Google::Cloud::Observability::V1::GetSettingsRequest, ::Hash]
|
|
2058
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2059
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2060
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2061
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
2062
|
+
#
|
|
2063
|
+
# @overload get_settings(name: nil)
|
|
2064
|
+
# Pass arguments to `get_settings` via keyword arguments. Note that at
|
|
2065
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2066
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2067
|
+
#
|
|
2068
|
+
# @param name [::String]
|
|
2069
|
+
# Required. Name of the settings to retrieve.
|
|
2070
|
+
#
|
|
2071
|
+
# Name format:
|
|
2072
|
+
#
|
|
2073
|
+
# "projects/[PROJECT_ID]/locations/[LOCATION]/settings"
|
|
2074
|
+
# "folders/[FOLDER_ID]/locations/[LOCATION]/settings"
|
|
2075
|
+
# "organizations/[ORGANIZATION_ID]/locations/[LOCATION]/settings"
|
|
2076
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
2077
|
+
# @yieldparam result [::Google::Cloud::Observability::V1::Settings]
|
|
2078
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
2079
|
+
#
|
|
2080
|
+
# @return [::Google::Cloud::Observability::V1::Settings]
|
|
2081
|
+
#
|
|
2082
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
2083
|
+
#
|
|
2084
|
+
# @example Basic example
|
|
2085
|
+
# require "google/cloud/observability/v1"
|
|
2086
|
+
#
|
|
2087
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2088
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
2089
|
+
#
|
|
2090
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2091
|
+
# request = Google::Cloud::Observability::V1::GetSettingsRequest.new
|
|
2092
|
+
#
|
|
2093
|
+
# # Call the get_settings method.
|
|
2094
|
+
# result = client.get_settings request
|
|
2095
|
+
#
|
|
2096
|
+
# # The returned object is of type Google::Cloud::Observability::V1::Settings.
|
|
2097
|
+
# p result
|
|
2098
|
+
#
|
|
2099
|
+
def get_settings request, options = nil
|
|
2100
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2101
|
+
|
|
2102
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::GetSettingsRequest
|
|
2103
|
+
|
|
2104
|
+
# Converts hash and nil to an options object
|
|
2105
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2106
|
+
|
|
2107
|
+
# Customize the options with defaults
|
|
2108
|
+
call_metadata = @config.rpcs.get_settings.metadata.to_h
|
|
2109
|
+
|
|
2110
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2111
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2112
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2113
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
2114
|
+
transports_version_send: [:rest]
|
|
2115
|
+
|
|
2116
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2117
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2118
|
+
|
|
2119
|
+
options.apply_defaults timeout: @config.rpcs.get_settings.timeout,
|
|
2120
|
+
metadata: call_metadata,
|
|
2121
|
+
retry_policy: @config.rpcs.get_settings.retry_policy
|
|
2122
|
+
|
|
2123
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2124
|
+
metadata: @config.metadata,
|
|
2125
|
+
retry_policy: @config.retry_policy
|
|
2126
|
+
|
|
2127
|
+
@observability_stub.get_settings request, options do |result, operation|
|
|
2128
|
+
yield result, operation if block_given?
|
|
2129
|
+
end
|
|
2130
|
+
rescue ::Gapic::Rest::Error => e
|
|
2131
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2132
|
+
end
|
|
2133
|
+
|
|
2134
|
+
##
|
|
2135
|
+
# Update Settings
|
|
2136
|
+
#
|
|
2137
|
+
# @overload update_settings(request, options = nil)
|
|
2138
|
+
# Pass arguments to `update_settings` via a request object, either of type
|
|
2139
|
+
# {::Google::Cloud::Observability::V1::UpdateSettingsRequest} or an equivalent Hash.
|
|
2140
|
+
#
|
|
2141
|
+
# @param request [::Google::Cloud::Observability::V1::UpdateSettingsRequest, ::Hash]
|
|
2142
|
+
# A request object representing the call parameters. Required. To specify no
|
|
2143
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
2144
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
2145
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
2146
|
+
#
|
|
2147
|
+
# @overload update_settings(settings: nil, update_mask: nil)
|
|
2148
|
+
# Pass arguments to `update_settings` via keyword arguments. Note that at
|
|
2149
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
2150
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
2151
|
+
#
|
|
2152
|
+
# @param settings [::Google::Cloud::Observability::V1::Settings, ::Hash]
|
|
2153
|
+
# Required. The settings to update.
|
|
2154
|
+
#
|
|
2155
|
+
# The name field of settings is used to identify the resource to be updated.
|
|
2156
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
2157
|
+
# Optional. The field mask specifying which fields of the settings are to be
|
|
2158
|
+
# updated.
|
|
2159
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
2160
|
+
# @yieldparam result [::Gapic::Operation]
|
|
2161
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
2162
|
+
#
|
|
2163
|
+
# @return [::Gapic::Operation]
|
|
2164
|
+
#
|
|
2165
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
2166
|
+
#
|
|
2167
|
+
# @example Basic example
|
|
2168
|
+
# require "google/cloud/observability/v1"
|
|
2169
|
+
#
|
|
2170
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
2171
|
+
# client = Google::Cloud::Observability::V1::Observability::Rest::Client.new
|
|
2172
|
+
#
|
|
2173
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
2174
|
+
# request = Google::Cloud::Observability::V1::UpdateSettingsRequest.new
|
|
2175
|
+
#
|
|
2176
|
+
# # Call the update_settings method.
|
|
2177
|
+
# result = client.update_settings request
|
|
2178
|
+
#
|
|
2179
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
2180
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
2181
|
+
# # Here is how to wait for a response.
|
|
2182
|
+
# result.wait_until_done! timeout: 60
|
|
2183
|
+
# if result.response?
|
|
2184
|
+
# p result.response
|
|
2185
|
+
# else
|
|
2186
|
+
# puts "No response received."
|
|
2187
|
+
# end
|
|
2188
|
+
#
|
|
2189
|
+
def update_settings request, options = nil
|
|
2190
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
2191
|
+
|
|
2192
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Observability::V1::UpdateSettingsRequest
|
|
2193
|
+
|
|
2194
|
+
# Converts hash and nil to an options object
|
|
2195
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
2196
|
+
|
|
2197
|
+
# Customize the options with defaults
|
|
2198
|
+
call_metadata = @config.rpcs.update_settings.metadata.to_h
|
|
2199
|
+
|
|
2200
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
2201
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
2202
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
2203
|
+
gapic_version: ::Google::Cloud::Observability::V1::VERSION,
|
|
2204
|
+
transports_version_send: [:rest]
|
|
2205
|
+
|
|
2206
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
2207
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
2208
|
+
|
|
2209
|
+
options.apply_defaults timeout: @config.rpcs.update_settings.timeout,
|
|
2210
|
+
metadata: call_metadata,
|
|
2211
|
+
retry_policy: @config.rpcs.update_settings.retry_policy
|
|
2212
|
+
|
|
2213
|
+
options.apply_defaults timeout: @config.timeout,
|
|
2214
|
+
metadata: @config.metadata,
|
|
2215
|
+
retry_policy: @config.retry_policy
|
|
2216
|
+
|
|
2217
|
+
@observability_stub.update_settings request, options do |result, operation|
|
|
2218
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
2219
|
+
yield result, operation if block_given?
|
|
2220
|
+
throw :response, result
|
|
2221
|
+
end
|
|
2222
|
+
rescue ::Gapic::Rest::Error => e
|
|
2223
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
2224
|
+
end
|
|
2225
|
+
|
|
2226
|
+
##
|
|
2227
|
+
# Configuration class for the Observability REST API.
|
|
2228
|
+
#
|
|
2229
|
+
# This class represents the configuration for Observability REST,
|
|
2230
|
+
# providing control over timeouts, retry behavior, logging, transport
|
|
2231
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
|
2232
|
+
# applied individually to specific RPCs. See
|
|
2233
|
+
# {::Google::Cloud::Observability::V1::Observability::Rest::Client::Configuration::Rpcs}
|
|
2234
|
+
# for a list of RPCs that can be configured independently.
|
|
2235
|
+
#
|
|
2236
|
+
# Configuration can be applied globally to all clients, or to a single client
|
|
2237
|
+
# on construction.
|
|
2238
|
+
#
|
|
2239
|
+
# @example
|
|
2240
|
+
#
|
|
2241
|
+
# # Modify the global config, setting the timeout for
|
|
2242
|
+
# # get_scope to 20 seconds,
|
|
2243
|
+
# # and all remaining timeouts to 10 seconds.
|
|
2244
|
+
# ::Google::Cloud::Observability::V1::Observability::Rest::Client.configure do |config|
|
|
2245
|
+
# config.timeout = 10.0
|
|
2246
|
+
# config.rpcs.get_scope.timeout = 20.0
|
|
2247
|
+
# end
|
|
2248
|
+
#
|
|
2249
|
+
# # Apply the above configuration only to a new client.
|
|
2250
|
+
# client = ::Google::Cloud::Observability::V1::Observability::Rest::Client.new do |config|
|
|
2251
|
+
# config.timeout = 10.0
|
|
2252
|
+
# config.rpcs.get_scope.timeout = 20.0
|
|
2253
|
+
# end
|
|
2254
|
+
#
|
|
2255
|
+
# @!attribute [rw] endpoint
|
|
2256
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
|
2257
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
|
2258
|
+
# @return [::String,nil]
|
|
2259
|
+
# @!attribute [rw] credentials
|
|
2260
|
+
# Credentials to send with calls. You may provide any of the following types:
|
|
2261
|
+
# * (`String`) The path to a service account key file in JSON format
|
|
2262
|
+
# * (`Hash`) A service account key as a Hash
|
|
2263
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
|
2264
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
|
2265
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
|
2266
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
|
2267
|
+
# * (`nil`) indicating no credentials
|
|
2268
|
+
#
|
|
2269
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
|
2270
|
+
# external source for authentication to Google Cloud, you must validate it before
|
|
2271
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
|
2272
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
|
2273
|
+
# For more information, refer to [Validate credential configurations from external
|
|
2274
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
|
2275
|
+
# @return [::Object]
|
|
2276
|
+
# @!attribute [rw] scope
|
|
2277
|
+
# The OAuth scopes
|
|
2278
|
+
# @return [::Array<::String>]
|
|
2279
|
+
# @!attribute [rw] lib_name
|
|
2280
|
+
# The library name as recorded in instrumentation and logging
|
|
2281
|
+
# @return [::String]
|
|
2282
|
+
# @!attribute [rw] lib_version
|
|
2283
|
+
# The library version as recorded in instrumentation and logging
|
|
2284
|
+
# @return [::String]
|
|
2285
|
+
# @!attribute [rw] timeout
|
|
2286
|
+
# The call timeout in seconds.
|
|
2287
|
+
# @return [::Numeric]
|
|
2288
|
+
# @!attribute [rw] metadata
|
|
2289
|
+
# Additional headers to be sent with the call.
|
|
2290
|
+
# @return [::Hash{::Symbol=>::String}]
|
|
2291
|
+
# @!attribute [rw] retry_policy
|
|
2292
|
+
# The retry policy. The value is a hash with the following keys:
|
|
2293
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
2294
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
2295
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
2296
|
+
# * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
|
|
2297
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
2298
|
+
# trigger a retry.
|
|
2299
|
+
# @return [::Hash]
|
|
2300
|
+
# @!attribute [rw] quota_project
|
|
2301
|
+
# A separate project against which to charge quota.
|
|
2302
|
+
# @return [::String]
|
|
2303
|
+
# @!attribute [rw] universe_domain
|
|
2304
|
+
# The universe domain within which to make requests. This determines the
|
|
2305
|
+
# default endpoint URL. The default value of nil uses the environment
|
|
2306
|
+
# universe (usually the default "googleapis.com" universe).
|
|
2307
|
+
# @return [::String,nil]
|
|
2308
|
+
# @!attribute [rw] logger
|
|
2309
|
+
# A custom logger to use for request/response debug logging, or the value
|
|
2310
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
|
2311
|
+
# explicitly disable logging.
|
|
2312
|
+
# @return [::Logger,:default,nil]
|
|
2313
|
+
#
|
|
2314
|
+
class Configuration
|
|
2315
|
+
extend ::Gapic::Config
|
|
2316
|
+
|
|
2317
|
+
# @private
|
|
2318
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
|
2319
|
+
DEFAULT_ENDPOINT = "observability.googleapis.com"
|
|
2320
|
+
|
|
2321
|
+
config_attr :endpoint, nil, ::String, nil
|
|
2322
|
+
config_attr :credentials, nil do |value|
|
|
2323
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
|
|
2324
|
+
allowed.any? { |klass| klass === value }
|
|
2325
|
+
end
|
|
2326
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
|
2327
|
+
config_attr :lib_name, nil, ::String, nil
|
|
2328
|
+
config_attr :lib_version, nil, ::String, nil
|
|
2329
|
+
config_attr :timeout, nil, ::Numeric, nil
|
|
2330
|
+
config_attr :metadata, nil, ::Hash, nil
|
|
2331
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
2332
|
+
config_attr :quota_project, nil, ::String, nil
|
|
2333
|
+
config_attr :universe_domain, nil, ::String, nil
|
|
2334
|
+
|
|
2335
|
+
# @private
|
|
2336
|
+
# Overrides for http bindings for the RPCs of this service
|
|
2337
|
+
# are only used when this service is used as mixin, and only
|
|
2338
|
+
# by the host service.
|
|
2339
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
|
2340
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
|
2341
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
|
2342
|
+
|
|
2343
|
+
# @private
|
|
2344
|
+
def initialize parent_config = nil
|
|
2345
|
+
@parent_config = parent_config unless parent_config.nil?
|
|
2346
|
+
|
|
2347
|
+
yield self if block_given?
|
|
2348
|
+
end
|
|
2349
|
+
|
|
2350
|
+
##
|
|
2351
|
+
# Configurations for individual RPCs
|
|
2352
|
+
# @return [Rpcs]
|
|
2353
|
+
#
|
|
2354
|
+
def rpcs
|
|
2355
|
+
@rpcs ||= begin
|
|
2356
|
+
parent_rpcs = nil
|
|
2357
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
|
2358
|
+
Rpcs.new parent_rpcs
|
|
2359
|
+
end
|
|
2360
|
+
end
|
|
2361
|
+
|
|
2362
|
+
##
|
|
2363
|
+
# Configuration RPC class for the Observability API.
|
|
2364
|
+
#
|
|
2365
|
+
# Includes fields providing the configuration for each RPC in this service.
|
|
2366
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
|
2367
|
+
# the following configuration fields:
|
|
2368
|
+
#
|
|
2369
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
|
2370
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
|
2371
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
|
2372
|
+
# include the following keys:
|
|
2373
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
2374
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
2375
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
2376
|
+
# * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
|
|
2377
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
2378
|
+
# trigger a retry.
|
|
2379
|
+
#
|
|
2380
|
+
class Rpcs
|
|
2381
|
+
##
|
|
2382
|
+
# RPC-specific configuration for `get_scope`
|
|
2383
|
+
# @return [::Gapic::Config::Method]
|
|
2384
|
+
#
|
|
2385
|
+
attr_reader :get_scope
|
|
2386
|
+
##
|
|
2387
|
+
# RPC-specific configuration for `update_scope`
|
|
2388
|
+
# @return [::Gapic::Config::Method]
|
|
2389
|
+
#
|
|
2390
|
+
attr_reader :update_scope
|
|
2391
|
+
##
|
|
2392
|
+
# RPC-specific configuration for `get_bucket`
|
|
2393
|
+
# @return [::Gapic::Config::Method]
|
|
2394
|
+
#
|
|
2395
|
+
attr_reader :get_bucket
|
|
2396
|
+
##
|
|
2397
|
+
# RPC-specific configuration for `list_buckets`
|
|
2398
|
+
# @return [::Gapic::Config::Method]
|
|
2399
|
+
#
|
|
2400
|
+
attr_reader :list_buckets
|
|
2401
|
+
##
|
|
2402
|
+
# RPC-specific configuration for `create_bucket`
|
|
2403
|
+
# @return [::Gapic::Config::Method]
|
|
2404
|
+
#
|
|
2405
|
+
attr_reader :create_bucket
|
|
2406
|
+
##
|
|
2407
|
+
# RPC-specific configuration for `update_bucket`
|
|
2408
|
+
# @return [::Gapic::Config::Method]
|
|
2409
|
+
#
|
|
2410
|
+
attr_reader :update_bucket
|
|
2411
|
+
##
|
|
2412
|
+
# RPC-specific configuration for `get_dataset`
|
|
2413
|
+
# @return [::Gapic::Config::Method]
|
|
2414
|
+
#
|
|
2415
|
+
attr_reader :get_dataset
|
|
2416
|
+
##
|
|
2417
|
+
# RPC-specific configuration for `list_datasets`
|
|
2418
|
+
# @return [::Gapic::Config::Method]
|
|
2419
|
+
#
|
|
2420
|
+
attr_reader :list_datasets
|
|
2421
|
+
##
|
|
2422
|
+
# RPC-specific configuration for `get_view`
|
|
2423
|
+
# @return [::Gapic::Config::Method]
|
|
2424
|
+
#
|
|
2425
|
+
attr_reader :get_view
|
|
2426
|
+
##
|
|
2427
|
+
# RPC-specific configuration for `list_views`
|
|
2428
|
+
# @return [::Gapic::Config::Method]
|
|
2429
|
+
#
|
|
2430
|
+
attr_reader :list_views
|
|
2431
|
+
##
|
|
2432
|
+
# RPC-specific configuration for `get_link`
|
|
2433
|
+
# @return [::Gapic::Config::Method]
|
|
2434
|
+
#
|
|
2435
|
+
attr_reader :get_link
|
|
2436
|
+
##
|
|
2437
|
+
# RPC-specific configuration for `list_links`
|
|
2438
|
+
# @return [::Gapic::Config::Method]
|
|
2439
|
+
#
|
|
2440
|
+
attr_reader :list_links
|
|
2441
|
+
##
|
|
2442
|
+
# RPC-specific configuration for `create_link`
|
|
2443
|
+
# @return [::Gapic::Config::Method]
|
|
2444
|
+
#
|
|
2445
|
+
attr_reader :create_link
|
|
2446
|
+
##
|
|
2447
|
+
# RPC-specific configuration for `update_link`
|
|
2448
|
+
# @return [::Gapic::Config::Method]
|
|
2449
|
+
#
|
|
2450
|
+
attr_reader :update_link
|
|
2451
|
+
##
|
|
2452
|
+
# RPC-specific configuration for `delete_link`
|
|
2453
|
+
# @return [::Gapic::Config::Method]
|
|
2454
|
+
#
|
|
2455
|
+
attr_reader :delete_link
|
|
2456
|
+
##
|
|
2457
|
+
# RPC-specific configuration for `get_trace_scope`
|
|
2458
|
+
# @return [::Gapic::Config::Method]
|
|
2459
|
+
#
|
|
2460
|
+
attr_reader :get_trace_scope
|
|
2461
|
+
##
|
|
2462
|
+
# RPC-specific configuration for `list_trace_scopes`
|
|
2463
|
+
# @return [::Gapic::Config::Method]
|
|
2464
|
+
#
|
|
2465
|
+
attr_reader :list_trace_scopes
|
|
2466
|
+
##
|
|
2467
|
+
# RPC-specific configuration for `create_trace_scope`
|
|
2468
|
+
# @return [::Gapic::Config::Method]
|
|
2469
|
+
#
|
|
2470
|
+
attr_reader :create_trace_scope
|
|
2471
|
+
##
|
|
2472
|
+
# RPC-specific configuration for `update_trace_scope`
|
|
2473
|
+
# @return [::Gapic::Config::Method]
|
|
2474
|
+
#
|
|
2475
|
+
attr_reader :update_trace_scope
|
|
2476
|
+
##
|
|
2477
|
+
# RPC-specific configuration for `delete_trace_scope`
|
|
2478
|
+
# @return [::Gapic::Config::Method]
|
|
2479
|
+
#
|
|
2480
|
+
attr_reader :delete_trace_scope
|
|
2481
|
+
##
|
|
2482
|
+
# RPC-specific configuration for `get_settings`
|
|
2483
|
+
# @return [::Gapic::Config::Method]
|
|
2484
|
+
#
|
|
2485
|
+
attr_reader :get_settings
|
|
2486
|
+
##
|
|
2487
|
+
# RPC-specific configuration for `update_settings`
|
|
2488
|
+
# @return [::Gapic::Config::Method]
|
|
2489
|
+
#
|
|
2490
|
+
attr_reader :update_settings
|
|
2491
|
+
|
|
2492
|
+
# @private
|
|
2493
|
+
def initialize parent_rpcs = nil
|
|
2494
|
+
get_scope_config = parent_rpcs.get_scope if parent_rpcs.respond_to? :get_scope
|
|
2495
|
+
@get_scope = ::Gapic::Config::Method.new get_scope_config
|
|
2496
|
+
update_scope_config = parent_rpcs.update_scope if parent_rpcs.respond_to? :update_scope
|
|
2497
|
+
@update_scope = ::Gapic::Config::Method.new update_scope_config
|
|
2498
|
+
get_bucket_config = parent_rpcs.get_bucket if parent_rpcs.respond_to? :get_bucket
|
|
2499
|
+
@get_bucket = ::Gapic::Config::Method.new get_bucket_config
|
|
2500
|
+
list_buckets_config = parent_rpcs.list_buckets if parent_rpcs.respond_to? :list_buckets
|
|
2501
|
+
@list_buckets = ::Gapic::Config::Method.new list_buckets_config
|
|
2502
|
+
create_bucket_config = parent_rpcs.create_bucket if parent_rpcs.respond_to? :create_bucket
|
|
2503
|
+
@create_bucket = ::Gapic::Config::Method.new create_bucket_config
|
|
2504
|
+
update_bucket_config = parent_rpcs.update_bucket if parent_rpcs.respond_to? :update_bucket
|
|
2505
|
+
@update_bucket = ::Gapic::Config::Method.new update_bucket_config
|
|
2506
|
+
get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset
|
|
2507
|
+
@get_dataset = ::Gapic::Config::Method.new get_dataset_config
|
|
2508
|
+
list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets
|
|
2509
|
+
@list_datasets = ::Gapic::Config::Method.new list_datasets_config
|
|
2510
|
+
get_view_config = parent_rpcs.get_view if parent_rpcs.respond_to? :get_view
|
|
2511
|
+
@get_view = ::Gapic::Config::Method.new get_view_config
|
|
2512
|
+
list_views_config = parent_rpcs.list_views if parent_rpcs.respond_to? :list_views
|
|
2513
|
+
@list_views = ::Gapic::Config::Method.new list_views_config
|
|
2514
|
+
get_link_config = parent_rpcs.get_link if parent_rpcs.respond_to? :get_link
|
|
2515
|
+
@get_link = ::Gapic::Config::Method.new get_link_config
|
|
2516
|
+
list_links_config = parent_rpcs.list_links if parent_rpcs.respond_to? :list_links
|
|
2517
|
+
@list_links = ::Gapic::Config::Method.new list_links_config
|
|
2518
|
+
create_link_config = parent_rpcs.create_link if parent_rpcs.respond_to? :create_link
|
|
2519
|
+
@create_link = ::Gapic::Config::Method.new create_link_config
|
|
2520
|
+
update_link_config = parent_rpcs.update_link if parent_rpcs.respond_to? :update_link
|
|
2521
|
+
@update_link = ::Gapic::Config::Method.new update_link_config
|
|
2522
|
+
delete_link_config = parent_rpcs.delete_link if parent_rpcs.respond_to? :delete_link
|
|
2523
|
+
@delete_link = ::Gapic::Config::Method.new delete_link_config
|
|
2524
|
+
get_trace_scope_config = parent_rpcs.get_trace_scope if parent_rpcs.respond_to? :get_trace_scope
|
|
2525
|
+
@get_trace_scope = ::Gapic::Config::Method.new get_trace_scope_config
|
|
2526
|
+
list_trace_scopes_config = parent_rpcs.list_trace_scopes if parent_rpcs.respond_to? :list_trace_scopes
|
|
2527
|
+
@list_trace_scopes = ::Gapic::Config::Method.new list_trace_scopes_config
|
|
2528
|
+
create_trace_scope_config = parent_rpcs.create_trace_scope if parent_rpcs.respond_to? :create_trace_scope
|
|
2529
|
+
@create_trace_scope = ::Gapic::Config::Method.new create_trace_scope_config
|
|
2530
|
+
update_trace_scope_config = parent_rpcs.update_trace_scope if parent_rpcs.respond_to? :update_trace_scope
|
|
2531
|
+
@update_trace_scope = ::Gapic::Config::Method.new update_trace_scope_config
|
|
2532
|
+
delete_trace_scope_config = parent_rpcs.delete_trace_scope if parent_rpcs.respond_to? :delete_trace_scope
|
|
2533
|
+
@delete_trace_scope = ::Gapic::Config::Method.new delete_trace_scope_config
|
|
2534
|
+
get_settings_config = parent_rpcs.get_settings if parent_rpcs.respond_to? :get_settings
|
|
2535
|
+
@get_settings = ::Gapic::Config::Method.new get_settings_config
|
|
2536
|
+
update_settings_config = parent_rpcs.update_settings if parent_rpcs.respond_to? :update_settings
|
|
2537
|
+
@update_settings = ::Gapic::Config::Method.new update_settings_config
|
|
2538
|
+
|
|
2539
|
+
yield self if block_given?
|
|
2540
|
+
end
|
|
2541
|
+
end
|
|
2542
|
+
end
|
|
2543
|
+
end
|
|
2544
|
+
end
|
|
2545
|
+
end
|
|
2546
|
+
end
|
|
2547
|
+
end
|
|
2548
|
+
end
|
|
2549
|
+
end
|