google-cloud-parallelstore-v1beta 0.a → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +144 -8
- data/lib/google/cloud/parallelstore/v1beta/bindings_override.rb +102 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/client.rb +1194 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/credentials.rb +47 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/operations.rb +809 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/paths.rb +122 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/rest/client.rb +1126 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/rest/operations.rb +902 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/rest/service_stub.rb +486 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore/rest.rb +68 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore.rb +70 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore_pb.rb +75 -0
- data/lib/google/cloud/parallelstore/v1beta/parallelstore_services_pb.rb +71 -0
- data/lib/google/cloud/parallelstore/v1beta/rest.rb +38 -0
- data/lib/google/cloud/parallelstore/v1beta/version.rb +7 -2
- data/lib/google/cloud/parallelstore/v1beta.rb +45 -0
- data/lib/google-cloud-parallelstore-v1beta.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +399 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/field_info.rb +65 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/cloud/parallelstore/v1beta/parallelstore.rb +566 -0
- data/proto_docs/google/longrunning/operations.rb +164 -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 +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- metadata +95 -11
@@ -0,0 +1,1126 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 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/parallelstore/v1beta/parallelstore_pb"
|
21
|
+
require "google/cloud/parallelstore/v1beta/parallelstore/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module Parallelstore
|
27
|
+
module V1beta
|
28
|
+
module Parallelstore
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the Parallelstore service.
|
32
|
+
#
|
33
|
+
# Service describing handlers for resources
|
34
|
+
# Configures and manages parallelstore resources.
|
35
|
+
#
|
36
|
+
# Parallelstore service.
|
37
|
+
#
|
38
|
+
# The `parallelstore.googleapis.com` service implements the parallelstore API
|
39
|
+
# and defines the following resource model for managing instances:
|
40
|
+
# * The service works with a collection of cloud projects, named: `/projects/*`
|
41
|
+
# * Each project has a collection of available locations, named: `/locations/*`
|
42
|
+
# * Each location has a collection of instances named `/instances/*`.
|
43
|
+
# * Parallelstore instances are resources of the form:
|
44
|
+
# `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
|
45
|
+
#
|
46
|
+
# Note that location_id must be a Google Cloud `zone`; for example:
|
47
|
+
# * `projects/12345/locations/us-central1-c/instances/my-parallelstore-share`
|
48
|
+
#
|
49
|
+
class Client
|
50
|
+
# @private
|
51
|
+
API_VERSION = ""
|
52
|
+
|
53
|
+
# @private
|
54
|
+
DEFAULT_ENDPOINT_TEMPLATE = "parallelstore.$UNIVERSE_DOMAIN$"
|
55
|
+
|
56
|
+
include Paths
|
57
|
+
|
58
|
+
# @private
|
59
|
+
attr_reader :parallelstore_stub
|
60
|
+
|
61
|
+
##
|
62
|
+
# Configure the Parallelstore Client class.
|
63
|
+
#
|
64
|
+
# See {::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client::Configuration}
|
65
|
+
# for a description of the configuration fields.
|
66
|
+
#
|
67
|
+
# @example
|
68
|
+
#
|
69
|
+
# # Modify the configuration for all Parallelstore clients
|
70
|
+
# ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.configure do |config|
|
71
|
+
# config.timeout = 10.0
|
72
|
+
# end
|
73
|
+
#
|
74
|
+
# @yield [config] Configure the Client client.
|
75
|
+
# @yieldparam config [Client::Configuration]
|
76
|
+
#
|
77
|
+
# @return [Client::Configuration]
|
78
|
+
#
|
79
|
+
def self.configure
|
80
|
+
@configure ||= begin
|
81
|
+
namespace = ["Google", "Cloud", "Parallelstore", "V1beta"]
|
82
|
+
parent_config = while namespace.any?
|
83
|
+
parent_name = namespace.join "::"
|
84
|
+
parent_const = const_get parent_name
|
85
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
86
|
+
namespace.pop
|
87
|
+
end
|
88
|
+
default_config = Client::Configuration.new parent_config
|
89
|
+
|
90
|
+
default_config
|
91
|
+
end
|
92
|
+
yield @configure if block_given?
|
93
|
+
@configure
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# Configure the Parallelstore Client instance.
|
98
|
+
#
|
99
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
100
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
101
|
+
# should be made on {Client.configure}.
|
102
|
+
#
|
103
|
+
# See {::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client::Configuration}
|
104
|
+
# for a description of the configuration fields.
|
105
|
+
#
|
106
|
+
# @yield [config] Configure the Client client.
|
107
|
+
# @yieldparam config [Client::Configuration]
|
108
|
+
#
|
109
|
+
# @return [Client::Configuration]
|
110
|
+
#
|
111
|
+
def configure
|
112
|
+
yield @config if block_given?
|
113
|
+
@config
|
114
|
+
end
|
115
|
+
|
116
|
+
##
|
117
|
+
# The effective universe domain
|
118
|
+
#
|
119
|
+
# @return [String]
|
120
|
+
#
|
121
|
+
def universe_domain
|
122
|
+
@parallelstore_stub.universe_domain
|
123
|
+
end
|
124
|
+
|
125
|
+
##
|
126
|
+
# Create a new Parallelstore REST client object.
|
127
|
+
#
|
128
|
+
# @example
|
129
|
+
#
|
130
|
+
# # Create a client using the default configuration
|
131
|
+
# client = ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new
|
132
|
+
#
|
133
|
+
# # Create a client using a custom configuration
|
134
|
+
# client = ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new do |config|
|
135
|
+
# config.timeout = 10.0
|
136
|
+
# end
|
137
|
+
#
|
138
|
+
# @yield [config] Configure the Parallelstore client.
|
139
|
+
# @yieldparam config [Client::Configuration]
|
140
|
+
#
|
141
|
+
def initialize
|
142
|
+
# Create the configuration object
|
143
|
+
@config = Configuration.new Client.configure
|
144
|
+
|
145
|
+
# Yield the configuration if needed
|
146
|
+
yield @config if block_given?
|
147
|
+
|
148
|
+
# Create credentials
|
149
|
+
credentials = @config.credentials
|
150
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
151
|
+
# but only if the default endpoint does not have a region prefix.
|
152
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
153
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
154
|
+
!@config.endpoint.split(".").first.include?("-"))
|
155
|
+
credentials ||= Credentials.default scope: @config.scope,
|
156
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
157
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
158
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
159
|
+
end
|
160
|
+
|
161
|
+
@quota_project_id = @config.quota_project
|
162
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
163
|
+
|
164
|
+
@operations_client = ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Operations.new do |config|
|
165
|
+
config.credentials = credentials
|
166
|
+
config.quota_project = @quota_project_id
|
167
|
+
config.endpoint = @config.endpoint
|
168
|
+
config.universe_domain = @config.universe_domain
|
169
|
+
end
|
170
|
+
|
171
|
+
@parallelstore_stub = ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::ServiceStub.new(
|
172
|
+
endpoint: @config.endpoint,
|
173
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
174
|
+
universe_domain: @config.universe_domain,
|
175
|
+
credentials: credentials
|
176
|
+
)
|
177
|
+
|
178
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
179
|
+
config.credentials = credentials
|
180
|
+
config.quota_project = @quota_project_id
|
181
|
+
config.endpoint = @parallelstore_stub.endpoint
|
182
|
+
config.universe_domain = @parallelstore_stub.universe_domain
|
183
|
+
config.bindings_override = @config.bindings_override
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
##
|
188
|
+
# Get the associated client for long-running operations.
|
189
|
+
#
|
190
|
+
# @return [::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Operations]
|
191
|
+
#
|
192
|
+
attr_reader :operations_client
|
193
|
+
|
194
|
+
##
|
195
|
+
# Get the associated client for mix-in of the Locations.
|
196
|
+
#
|
197
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
198
|
+
#
|
199
|
+
attr_reader :location_client
|
200
|
+
|
201
|
+
# Service calls
|
202
|
+
|
203
|
+
##
|
204
|
+
# Lists Instances in a given project and location.
|
205
|
+
#
|
206
|
+
# @overload list_instances(request, options = nil)
|
207
|
+
# Pass arguments to `list_instances` via a request object, either of type
|
208
|
+
# {::Google::Cloud::Parallelstore::V1beta::ListInstancesRequest} or an equivalent Hash.
|
209
|
+
#
|
210
|
+
# @param request [::Google::Cloud::Parallelstore::V1beta::ListInstancesRequest, ::Hash]
|
211
|
+
# A request object representing the call parameters. Required. To specify no
|
212
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
213
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
214
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
215
|
+
#
|
216
|
+
# @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
217
|
+
# Pass arguments to `list_instances` via keyword arguments. Note that at
|
218
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
219
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
220
|
+
#
|
221
|
+
# @param parent [::String]
|
222
|
+
# Required. The project and location for which to retrieve instance
|
223
|
+
# information, in the format `projects/{project_id}/locations/{location}`.
|
224
|
+
# For Parallelstore locations map to Google Cloud zones, for example
|
225
|
+
# **us-central1-a**.
|
226
|
+
# To retrieve instance information for all locations, use "-" for the
|
227
|
+
# `{location}` value.
|
228
|
+
# @param page_size [::Integer]
|
229
|
+
# Optional. Requested page size. Server may return fewer items than
|
230
|
+
# requested. If unspecified, server will pick an appropriate default.
|
231
|
+
# @param page_token [::String]
|
232
|
+
# Optional. A token identifying a page of results the server should return.
|
233
|
+
# @param filter [::String]
|
234
|
+
# Optional. Filtering results
|
235
|
+
# @param order_by [::String]
|
236
|
+
# Optional. Hint for how to order the results
|
237
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
238
|
+
# @yieldparam result [::Google::Cloud::Parallelstore::V1beta::ListInstancesResponse]
|
239
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
240
|
+
#
|
241
|
+
# @return [::Google::Cloud::Parallelstore::V1beta::ListInstancesResponse]
|
242
|
+
#
|
243
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
244
|
+
#
|
245
|
+
# @example Basic example
|
246
|
+
# require "google/cloud/parallelstore/v1beta"
|
247
|
+
#
|
248
|
+
# # Create a client object. The client can be reused for multiple calls.
|
249
|
+
# client = Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new
|
250
|
+
#
|
251
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
252
|
+
# request = Google::Cloud::Parallelstore::V1beta::ListInstancesRequest.new
|
253
|
+
#
|
254
|
+
# # Call the list_instances method.
|
255
|
+
# result = client.list_instances request
|
256
|
+
#
|
257
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
258
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
259
|
+
# result.each do |item|
|
260
|
+
# # Each element is of type ::Google::Cloud::Parallelstore::V1beta::Instance.
|
261
|
+
# p item
|
262
|
+
# end
|
263
|
+
#
|
264
|
+
def list_instances request, options = nil
|
265
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
266
|
+
|
267
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Parallelstore::V1beta::ListInstancesRequest
|
268
|
+
|
269
|
+
# Converts hash and nil to an options object
|
270
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
271
|
+
|
272
|
+
# Customize the options with defaults
|
273
|
+
call_metadata = @config.rpcs.list_instances.metadata.to_h
|
274
|
+
|
275
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
276
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
277
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
278
|
+
gapic_version: ::Google::Cloud::Parallelstore::V1beta::VERSION,
|
279
|
+
transports_version_send: [:rest]
|
280
|
+
|
281
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
282
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
283
|
+
|
284
|
+
options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
|
285
|
+
metadata: call_metadata,
|
286
|
+
retry_policy: @config.rpcs.list_instances.retry_policy
|
287
|
+
|
288
|
+
options.apply_defaults timeout: @config.timeout,
|
289
|
+
metadata: @config.metadata,
|
290
|
+
retry_policy: @config.retry_policy
|
291
|
+
|
292
|
+
@parallelstore_stub.list_instances request, options do |result, operation|
|
293
|
+
yield result, operation if block_given?
|
294
|
+
return result
|
295
|
+
end
|
296
|
+
rescue ::Gapic::Rest::Error => e
|
297
|
+
raise ::Google::Cloud::Error.from_error(e)
|
298
|
+
end
|
299
|
+
|
300
|
+
##
|
301
|
+
# Gets details of a single Instance.
|
302
|
+
#
|
303
|
+
# @overload get_instance(request, options = nil)
|
304
|
+
# Pass arguments to `get_instance` via a request object, either of type
|
305
|
+
# {::Google::Cloud::Parallelstore::V1beta::GetInstanceRequest} or an equivalent Hash.
|
306
|
+
#
|
307
|
+
# @param request [::Google::Cloud::Parallelstore::V1beta::GetInstanceRequest, ::Hash]
|
308
|
+
# A request object representing the call parameters. Required. To specify no
|
309
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
310
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
311
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
312
|
+
#
|
313
|
+
# @overload get_instance(name: nil)
|
314
|
+
# Pass arguments to `get_instance` via keyword arguments. Note that at
|
315
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
316
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
317
|
+
#
|
318
|
+
# @param name [::String]
|
319
|
+
# Required. The instance resource name, in the format
|
320
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`.
|
321
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
322
|
+
# @yieldparam result [::Google::Cloud::Parallelstore::V1beta::Instance]
|
323
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
324
|
+
#
|
325
|
+
# @return [::Google::Cloud::Parallelstore::V1beta::Instance]
|
326
|
+
#
|
327
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
328
|
+
#
|
329
|
+
# @example Basic example
|
330
|
+
# require "google/cloud/parallelstore/v1beta"
|
331
|
+
#
|
332
|
+
# # Create a client object. The client can be reused for multiple calls.
|
333
|
+
# client = Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new
|
334
|
+
#
|
335
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
336
|
+
# request = Google::Cloud::Parallelstore::V1beta::GetInstanceRequest.new
|
337
|
+
#
|
338
|
+
# # Call the get_instance method.
|
339
|
+
# result = client.get_instance request
|
340
|
+
#
|
341
|
+
# # The returned object is of type Google::Cloud::Parallelstore::V1beta::Instance.
|
342
|
+
# p result
|
343
|
+
#
|
344
|
+
def get_instance request, options = nil
|
345
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
346
|
+
|
347
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Parallelstore::V1beta::GetInstanceRequest
|
348
|
+
|
349
|
+
# Converts hash and nil to an options object
|
350
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
351
|
+
|
352
|
+
# Customize the options with defaults
|
353
|
+
call_metadata = @config.rpcs.get_instance.metadata.to_h
|
354
|
+
|
355
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
356
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
357
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
358
|
+
gapic_version: ::Google::Cloud::Parallelstore::V1beta::VERSION,
|
359
|
+
transports_version_send: [:rest]
|
360
|
+
|
361
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
362
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
363
|
+
|
364
|
+
options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
|
365
|
+
metadata: call_metadata,
|
366
|
+
retry_policy: @config.rpcs.get_instance.retry_policy
|
367
|
+
|
368
|
+
options.apply_defaults timeout: @config.timeout,
|
369
|
+
metadata: @config.metadata,
|
370
|
+
retry_policy: @config.retry_policy
|
371
|
+
|
372
|
+
@parallelstore_stub.get_instance request, options do |result, operation|
|
373
|
+
yield result, operation if block_given?
|
374
|
+
return result
|
375
|
+
end
|
376
|
+
rescue ::Gapic::Rest::Error => e
|
377
|
+
raise ::Google::Cloud::Error.from_error(e)
|
378
|
+
end
|
379
|
+
|
380
|
+
##
|
381
|
+
# Creates a Parallelstore instance in a given project and location.
|
382
|
+
#
|
383
|
+
# @overload create_instance(request, options = nil)
|
384
|
+
# Pass arguments to `create_instance` via a request object, either of type
|
385
|
+
# {::Google::Cloud::Parallelstore::V1beta::CreateInstanceRequest} or an equivalent Hash.
|
386
|
+
#
|
387
|
+
# @param request [::Google::Cloud::Parallelstore::V1beta::CreateInstanceRequest, ::Hash]
|
388
|
+
# A request object representing the call parameters. Required. To specify no
|
389
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
390
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
391
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
392
|
+
#
|
393
|
+
# @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil)
|
394
|
+
# Pass arguments to `create_instance` via keyword arguments. Note that at
|
395
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
396
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
397
|
+
#
|
398
|
+
# @param parent [::String]
|
399
|
+
# Required. The instance's project and location, in the format
|
400
|
+
# `projects/{project}/locations/{location}`.
|
401
|
+
# Locations map to Google Cloud zones, for example **us-west1-b**.
|
402
|
+
# @param instance_id [::String]
|
403
|
+
# Required. The logical name of the Parallelstore instance in the user
|
404
|
+
# project with the following restrictions:
|
405
|
+
#
|
406
|
+
# * Must contain only lowercase letters, numbers, and hyphens.
|
407
|
+
# * Must start with a letter.
|
408
|
+
# * Must be between 1-63 characters.
|
409
|
+
# * Must end with a number or a letter.
|
410
|
+
# * Must be unique within the customer project / location
|
411
|
+
# @param instance [::Google::Cloud::Parallelstore::V1beta::Instance, ::Hash]
|
412
|
+
# Required. The instance to create.
|
413
|
+
# @param request_id [::String]
|
414
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
415
|
+
# request ID so that if you must retry your request, the server will know to
|
416
|
+
# ignore the request if it has already been completed. The server will
|
417
|
+
# guarantee that for at least 60 minutes since the first request.
|
418
|
+
#
|
419
|
+
# For example, consider a situation where you make an initial request and t
|
420
|
+
# he request times out. If you make the request again with the same request
|
421
|
+
# ID, the server can check if original operation with the same request ID
|
422
|
+
# was received, and if so, will ignore the second request. This prevents
|
423
|
+
# clients from accidentally creating duplicate commitments.
|
424
|
+
#
|
425
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
426
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
427
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
428
|
+
# @yieldparam result [::Gapic::Operation]
|
429
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
430
|
+
#
|
431
|
+
# @return [::Gapic::Operation]
|
432
|
+
#
|
433
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
434
|
+
#
|
435
|
+
# @example Basic example
|
436
|
+
# require "google/cloud/parallelstore/v1beta"
|
437
|
+
#
|
438
|
+
# # Create a client object. The client can be reused for multiple calls.
|
439
|
+
# client = Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new
|
440
|
+
#
|
441
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
442
|
+
# request = Google::Cloud::Parallelstore::V1beta::CreateInstanceRequest.new
|
443
|
+
#
|
444
|
+
# # Call the create_instance method.
|
445
|
+
# result = client.create_instance request
|
446
|
+
#
|
447
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
448
|
+
# # check the status of an operation, cancel it, or wait for results.
|
449
|
+
# # Here is how to wait for a response.
|
450
|
+
# result.wait_until_done! timeout: 60
|
451
|
+
# if result.response?
|
452
|
+
# p result.response
|
453
|
+
# else
|
454
|
+
# puts "No response received."
|
455
|
+
# end
|
456
|
+
#
|
457
|
+
def create_instance request, options = nil
|
458
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
459
|
+
|
460
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Parallelstore::V1beta::CreateInstanceRequest
|
461
|
+
|
462
|
+
# Converts hash and nil to an options object
|
463
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
464
|
+
|
465
|
+
# Customize the options with defaults
|
466
|
+
call_metadata = @config.rpcs.create_instance.metadata.to_h
|
467
|
+
|
468
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
469
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
470
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
471
|
+
gapic_version: ::Google::Cloud::Parallelstore::V1beta::VERSION,
|
472
|
+
transports_version_send: [:rest]
|
473
|
+
|
474
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
475
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
476
|
+
|
477
|
+
options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
|
478
|
+
metadata: call_metadata,
|
479
|
+
retry_policy: @config.rpcs.create_instance.retry_policy
|
480
|
+
|
481
|
+
options.apply_defaults timeout: @config.timeout,
|
482
|
+
metadata: @config.metadata,
|
483
|
+
retry_policy: @config.retry_policy
|
484
|
+
|
485
|
+
@parallelstore_stub.create_instance request, options do |result, operation|
|
486
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
487
|
+
yield result, operation if block_given?
|
488
|
+
return result
|
489
|
+
end
|
490
|
+
rescue ::Gapic::Rest::Error => e
|
491
|
+
raise ::Google::Cloud::Error.from_error(e)
|
492
|
+
end
|
493
|
+
|
494
|
+
##
|
495
|
+
# Updates the parameters of a single Instance.
|
496
|
+
#
|
497
|
+
# @overload update_instance(request, options = nil)
|
498
|
+
# Pass arguments to `update_instance` via a request object, either of type
|
499
|
+
# {::Google::Cloud::Parallelstore::V1beta::UpdateInstanceRequest} or an equivalent Hash.
|
500
|
+
#
|
501
|
+
# @param request [::Google::Cloud::Parallelstore::V1beta::UpdateInstanceRequest, ::Hash]
|
502
|
+
# A request object representing the call parameters. Required. To specify no
|
503
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
504
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
505
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
506
|
+
#
|
507
|
+
# @overload update_instance(update_mask: nil, instance: nil, request_id: nil)
|
508
|
+
# Pass arguments to `update_instance` via keyword arguments. Note that at
|
509
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
510
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
511
|
+
#
|
512
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
513
|
+
# Required. Mask of fields to update .Field mask is used to specify the
|
514
|
+
# fields to be overwritten in the Instance resource by the update. At least
|
515
|
+
# one path must be supplied in this field. The fields specified in the
|
516
|
+
# update_mask are relative to the resource, not the full request.
|
517
|
+
# @param instance [::Google::Cloud::Parallelstore::V1beta::Instance, ::Hash]
|
518
|
+
# Required. The instance to update
|
519
|
+
# @param request_id [::String]
|
520
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
521
|
+
# request ID so that if you must retry your request, the server will know to
|
522
|
+
# ignore the request if it has already been completed. The server will
|
523
|
+
# guarantee that for at least 60 minutes since the first request.
|
524
|
+
#
|
525
|
+
# For example, consider a situation where you make an initial request and t
|
526
|
+
# he request times out. If you make the request again with the same request
|
527
|
+
# ID, the server can check if original operation with the same request ID
|
528
|
+
# was received, and if so, will ignore the second request. This prevents
|
529
|
+
# clients from accidentally creating duplicate commitments.
|
530
|
+
#
|
531
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
532
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
533
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
534
|
+
# @yieldparam result [::Gapic::Operation]
|
535
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
536
|
+
#
|
537
|
+
# @return [::Gapic::Operation]
|
538
|
+
#
|
539
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
540
|
+
#
|
541
|
+
# @example Basic example
|
542
|
+
# require "google/cloud/parallelstore/v1beta"
|
543
|
+
#
|
544
|
+
# # Create a client object. The client can be reused for multiple calls.
|
545
|
+
# client = Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new
|
546
|
+
#
|
547
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
548
|
+
# request = Google::Cloud::Parallelstore::V1beta::UpdateInstanceRequest.new
|
549
|
+
#
|
550
|
+
# # Call the update_instance method.
|
551
|
+
# result = client.update_instance request
|
552
|
+
#
|
553
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
554
|
+
# # check the status of an operation, cancel it, or wait for results.
|
555
|
+
# # Here is how to wait for a response.
|
556
|
+
# result.wait_until_done! timeout: 60
|
557
|
+
# if result.response?
|
558
|
+
# p result.response
|
559
|
+
# else
|
560
|
+
# puts "No response received."
|
561
|
+
# end
|
562
|
+
#
|
563
|
+
def update_instance request, options = nil
|
564
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
565
|
+
|
566
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Parallelstore::V1beta::UpdateInstanceRequest
|
567
|
+
|
568
|
+
# Converts hash and nil to an options object
|
569
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
570
|
+
|
571
|
+
# Customize the options with defaults
|
572
|
+
call_metadata = @config.rpcs.update_instance.metadata.to_h
|
573
|
+
|
574
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
575
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
576
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
577
|
+
gapic_version: ::Google::Cloud::Parallelstore::V1beta::VERSION,
|
578
|
+
transports_version_send: [:rest]
|
579
|
+
|
580
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
581
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
582
|
+
|
583
|
+
options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
|
584
|
+
metadata: call_metadata,
|
585
|
+
retry_policy: @config.rpcs.update_instance.retry_policy
|
586
|
+
|
587
|
+
options.apply_defaults timeout: @config.timeout,
|
588
|
+
metadata: @config.metadata,
|
589
|
+
retry_policy: @config.retry_policy
|
590
|
+
|
591
|
+
@parallelstore_stub.update_instance request, options do |result, operation|
|
592
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
593
|
+
yield result, operation if block_given?
|
594
|
+
return result
|
595
|
+
end
|
596
|
+
rescue ::Gapic::Rest::Error => e
|
597
|
+
raise ::Google::Cloud::Error.from_error(e)
|
598
|
+
end
|
599
|
+
|
600
|
+
##
|
601
|
+
# Deletes a single Instance.
|
602
|
+
#
|
603
|
+
# @overload delete_instance(request, options = nil)
|
604
|
+
# Pass arguments to `delete_instance` via a request object, either of type
|
605
|
+
# {::Google::Cloud::Parallelstore::V1beta::DeleteInstanceRequest} or an equivalent Hash.
|
606
|
+
#
|
607
|
+
# @param request [::Google::Cloud::Parallelstore::V1beta::DeleteInstanceRequest, ::Hash]
|
608
|
+
# A request object representing the call parameters. Required. To specify no
|
609
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
610
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
611
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
612
|
+
#
|
613
|
+
# @overload delete_instance(name: nil, request_id: nil)
|
614
|
+
# Pass arguments to `delete_instance` via keyword arguments. Note that at
|
615
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
616
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
617
|
+
#
|
618
|
+
# @param name [::String]
|
619
|
+
# Required. Name of the resource
|
620
|
+
# @param request_id [::String]
|
621
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
622
|
+
# request ID so that if you must retry your request, the server will know to
|
623
|
+
# ignore the request if it has already been completed. The server will
|
624
|
+
# guarantee that for at least 60 minutes after the first request.
|
625
|
+
#
|
626
|
+
# For example, consider a situation where you make an initial request and t
|
627
|
+
# he request times out. If you make the request again with the same request
|
628
|
+
# ID, the server can check if original operation with the same request ID
|
629
|
+
# was received, and if so, will ignore the second request. This prevents
|
630
|
+
# clients from accidentally creating duplicate commitments.
|
631
|
+
#
|
632
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
633
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
634
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
635
|
+
# @yieldparam result [::Gapic::Operation]
|
636
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
637
|
+
#
|
638
|
+
# @return [::Gapic::Operation]
|
639
|
+
#
|
640
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
641
|
+
#
|
642
|
+
# @example Basic example
|
643
|
+
# require "google/cloud/parallelstore/v1beta"
|
644
|
+
#
|
645
|
+
# # Create a client object. The client can be reused for multiple calls.
|
646
|
+
# client = Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new
|
647
|
+
#
|
648
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
649
|
+
# request = Google::Cloud::Parallelstore::V1beta::DeleteInstanceRequest.new
|
650
|
+
#
|
651
|
+
# # Call the delete_instance method.
|
652
|
+
# result = client.delete_instance request
|
653
|
+
#
|
654
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
655
|
+
# # check the status of an operation, cancel it, or wait for results.
|
656
|
+
# # Here is how to wait for a response.
|
657
|
+
# result.wait_until_done! timeout: 60
|
658
|
+
# if result.response?
|
659
|
+
# p result.response
|
660
|
+
# else
|
661
|
+
# puts "No response received."
|
662
|
+
# end
|
663
|
+
#
|
664
|
+
def delete_instance request, options = nil
|
665
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
666
|
+
|
667
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Parallelstore::V1beta::DeleteInstanceRequest
|
668
|
+
|
669
|
+
# Converts hash and nil to an options object
|
670
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
671
|
+
|
672
|
+
# Customize the options with defaults
|
673
|
+
call_metadata = @config.rpcs.delete_instance.metadata.to_h
|
674
|
+
|
675
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
676
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
677
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
678
|
+
gapic_version: ::Google::Cloud::Parallelstore::V1beta::VERSION,
|
679
|
+
transports_version_send: [:rest]
|
680
|
+
|
681
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
682
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
683
|
+
|
684
|
+
options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
|
685
|
+
metadata: call_metadata,
|
686
|
+
retry_policy: @config.rpcs.delete_instance.retry_policy
|
687
|
+
|
688
|
+
options.apply_defaults timeout: @config.timeout,
|
689
|
+
metadata: @config.metadata,
|
690
|
+
retry_policy: @config.retry_policy
|
691
|
+
|
692
|
+
@parallelstore_stub.delete_instance request, options do |result, operation|
|
693
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
694
|
+
yield result, operation if block_given?
|
695
|
+
return result
|
696
|
+
end
|
697
|
+
rescue ::Gapic::Rest::Error => e
|
698
|
+
raise ::Google::Cloud::Error.from_error(e)
|
699
|
+
end
|
700
|
+
|
701
|
+
##
|
702
|
+
# ImportData copies data from Cloud Storage to Parallelstore.
|
703
|
+
#
|
704
|
+
# @overload import_data(request, options = nil)
|
705
|
+
# Pass arguments to `import_data` via a request object, either of type
|
706
|
+
# {::Google::Cloud::Parallelstore::V1beta::ImportDataRequest} or an equivalent Hash.
|
707
|
+
#
|
708
|
+
# @param request [::Google::Cloud::Parallelstore::V1beta::ImportDataRequest, ::Hash]
|
709
|
+
# A request object representing the call parameters. Required. To specify no
|
710
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
711
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
712
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
713
|
+
#
|
714
|
+
# @overload import_data(source_gcs_bucket: nil, destination_parallelstore: nil, name: nil, request_id: nil, service_account: nil)
|
715
|
+
# Pass arguments to `import_data` via keyword arguments. Note that at
|
716
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
717
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
718
|
+
#
|
719
|
+
# @param source_gcs_bucket [::Google::Cloud::Parallelstore::V1beta::SourceGcsBucket, ::Hash]
|
720
|
+
# Cloud Storage source.
|
721
|
+
# @param destination_parallelstore [::Google::Cloud::Parallelstore::V1beta::DestinationParallelstore, ::Hash]
|
722
|
+
# Parallelstore destination.
|
723
|
+
# @param name [::String]
|
724
|
+
# Required. Name of the resource.
|
725
|
+
# @param request_id [::String]
|
726
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
727
|
+
# request ID so that if you must retry your request, the server will know to
|
728
|
+
# ignore the request if it has already been completed. The server will
|
729
|
+
# guarantee that for at least 60 minutes since the first request.
|
730
|
+
#
|
731
|
+
# For example, consider a situation where you make an initial request and t
|
732
|
+
# he request times out. If you make the request again with the same request
|
733
|
+
# ID, the server can check if original operation with the same request ID
|
734
|
+
# was received, and if so, will ignore the second request. This prevents
|
735
|
+
# clients from accidentally creating duplicate commitments.
|
736
|
+
#
|
737
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
738
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
739
|
+
# @param service_account [::String]
|
740
|
+
# Optional. User-specified Service Account (SA) credentials to be used when
|
741
|
+
# performing the transfer.
|
742
|
+
# Format: `projects/{project_id}/serviceAccounts/{service_account}`
|
743
|
+
# If unspecified, the Parallelstore service agent is used:
|
744
|
+
# service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com)
|
745
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
746
|
+
# @yieldparam result [::Gapic::Operation]
|
747
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
748
|
+
#
|
749
|
+
# @return [::Gapic::Operation]
|
750
|
+
#
|
751
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
752
|
+
#
|
753
|
+
# @example Basic example
|
754
|
+
# require "google/cloud/parallelstore/v1beta"
|
755
|
+
#
|
756
|
+
# # Create a client object. The client can be reused for multiple calls.
|
757
|
+
# client = Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new
|
758
|
+
#
|
759
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
760
|
+
# request = Google::Cloud::Parallelstore::V1beta::ImportDataRequest.new
|
761
|
+
#
|
762
|
+
# # Call the import_data method.
|
763
|
+
# result = client.import_data request
|
764
|
+
#
|
765
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
766
|
+
# # check the status of an operation, cancel it, or wait for results.
|
767
|
+
# # Here is how to wait for a response.
|
768
|
+
# result.wait_until_done! timeout: 60
|
769
|
+
# if result.response?
|
770
|
+
# p result.response
|
771
|
+
# else
|
772
|
+
# puts "No response received."
|
773
|
+
# end
|
774
|
+
#
|
775
|
+
def import_data request, options = nil
|
776
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
777
|
+
|
778
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Parallelstore::V1beta::ImportDataRequest
|
779
|
+
|
780
|
+
# Converts hash and nil to an options object
|
781
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
782
|
+
|
783
|
+
# Customize the options with defaults
|
784
|
+
call_metadata = @config.rpcs.import_data.metadata.to_h
|
785
|
+
|
786
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
787
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
788
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
789
|
+
gapic_version: ::Google::Cloud::Parallelstore::V1beta::VERSION,
|
790
|
+
transports_version_send: [:rest]
|
791
|
+
|
792
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
793
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
794
|
+
|
795
|
+
options.apply_defaults timeout: @config.rpcs.import_data.timeout,
|
796
|
+
metadata: call_metadata,
|
797
|
+
retry_policy: @config.rpcs.import_data.retry_policy
|
798
|
+
|
799
|
+
options.apply_defaults timeout: @config.timeout,
|
800
|
+
metadata: @config.metadata,
|
801
|
+
retry_policy: @config.retry_policy
|
802
|
+
|
803
|
+
@parallelstore_stub.import_data request, options do |result, operation|
|
804
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
805
|
+
yield result, operation if block_given?
|
806
|
+
return result
|
807
|
+
end
|
808
|
+
rescue ::Gapic::Rest::Error => e
|
809
|
+
raise ::Google::Cloud::Error.from_error(e)
|
810
|
+
end
|
811
|
+
|
812
|
+
##
|
813
|
+
# ExportData copies data from Parallelstore to Cloud Storage
|
814
|
+
#
|
815
|
+
# @overload export_data(request, options = nil)
|
816
|
+
# Pass arguments to `export_data` via a request object, either of type
|
817
|
+
# {::Google::Cloud::Parallelstore::V1beta::ExportDataRequest} or an equivalent Hash.
|
818
|
+
#
|
819
|
+
# @param request [::Google::Cloud::Parallelstore::V1beta::ExportDataRequest, ::Hash]
|
820
|
+
# A request object representing the call parameters. Required. To specify no
|
821
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
822
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
823
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
824
|
+
#
|
825
|
+
# @overload export_data(source_parallelstore: nil, destination_gcs_bucket: nil, name: nil, request_id: nil, service_account: nil)
|
826
|
+
# Pass arguments to `export_data` via keyword arguments. Note that at
|
827
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
828
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
829
|
+
#
|
830
|
+
# @param source_parallelstore [::Google::Cloud::Parallelstore::V1beta::SourceParallelstore, ::Hash]
|
831
|
+
# Parallelstore source.
|
832
|
+
# @param destination_gcs_bucket [::Google::Cloud::Parallelstore::V1beta::DestinationGcsBucket, ::Hash]
|
833
|
+
# Cloud Storage destination.
|
834
|
+
# @param name [::String]
|
835
|
+
# Required. Name of the resource.
|
836
|
+
# @param request_id [::String]
|
837
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
838
|
+
# request ID so that if you must retry your request, the server will know to
|
839
|
+
# ignore the request if it has already been completed. The server will
|
840
|
+
# guarantee that for at least 60 minutes since the first request.
|
841
|
+
#
|
842
|
+
# For example, consider a situation where you make an initial request and t
|
843
|
+
# he request times out. If you make the request again with the same request
|
844
|
+
# ID, the server can check if original operation with the same request ID
|
845
|
+
# was received, and if so, will ignore the second request. This prevents
|
846
|
+
# clients from accidentally creating duplicate commitments.
|
847
|
+
#
|
848
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
849
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
850
|
+
# @param service_account [::String]
|
851
|
+
# Optional. User-specified Service Account (SA) credentials to be used when
|
852
|
+
# performing the transfer.
|
853
|
+
# Format: `projects/{project_id}/serviceAccounts/{service_account}`
|
854
|
+
# If unspecified, the Parallelstore service agent is used:
|
855
|
+
# service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com)
|
856
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
857
|
+
# @yieldparam result [::Gapic::Operation]
|
858
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
859
|
+
#
|
860
|
+
# @return [::Gapic::Operation]
|
861
|
+
#
|
862
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
863
|
+
#
|
864
|
+
# @example Basic example
|
865
|
+
# require "google/cloud/parallelstore/v1beta"
|
866
|
+
#
|
867
|
+
# # Create a client object. The client can be reused for multiple calls.
|
868
|
+
# client = Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new
|
869
|
+
#
|
870
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
871
|
+
# request = Google::Cloud::Parallelstore::V1beta::ExportDataRequest.new
|
872
|
+
#
|
873
|
+
# # Call the export_data method.
|
874
|
+
# result = client.export_data request
|
875
|
+
#
|
876
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
877
|
+
# # check the status of an operation, cancel it, or wait for results.
|
878
|
+
# # Here is how to wait for a response.
|
879
|
+
# result.wait_until_done! timeout: 60
|
880
|
+
# if result.response?
|
881
|
+
# p result.response
|
882
|
+
# else
|
883
|
+
# puts "No response received."
|
884
|
+
# end
|
885
|
+
#
|
886
|
+
def export_data request, options = nil
|
887
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
888
|
+
|
889
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Parallelstore::V1beta::ExportDataRequest
|
890
|
+
|
891
|
+
# Converts hash and nil to an options object
|
892
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
893
|
+
|
894
|
+
# Customize the options with defaults
|
895
|
+
call_metadata = @config.rpcs.export_data.metadata.to_h
|
896
|
+
|
897
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
898
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
899
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
900
|
+
gapic_version: ::Google::Cloud::Parallelstore::V1beta::VERSION,
|
901
|
+
transports_version_send: [:rest]
|
902
|
+
|
903
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
904
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
905
|
+
|
906
|
+
options.apply_defaults timeout: @config.rpcs.export_data.timeout,
|
907
|
+
metadata: call_metadata,
|
908
|
+
retry_policy: @config.rpcs.export_data.retry_policy
|
909
|
+
|
910
|
+
options.apply_defaults timeout: @config.timeout,
|
911
|
+
metadata: @config.metadata,
|
912
|
+
retry_policy: @config.retry_policy
|
913
|
+
|
914
|
+
@parallelstore_stub.export_data request, options do |result, operation|
|
915
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
916
|
+
yield result, operation if block_given?
|
917
|
+
return result
|
918
|
+
end
|
919
|
+
rescue ::Gapic::Rest::Error => e
|
920
|
+
raise ::Google::Cloud::Error.from_error(e)
|
921
|
+
end
|
922
|
+
|
923
|
+
##
|
924
|
+
# Configuration class for the Parallelstore REST API.
|
925
|
+
#
|
926
|
+
# This class represents the configuration for Parallelstore REST,
|
927
|
+
# providing control over timeouts, retry behavior, logging, transport
|
928
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
929
|
+
# applied individually to specific RPCs. See
|
930
|
+
# {::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client::Configuration::Rpcs}
|
931
|
+
# for a list of RPCs that can be configured independently.
|
932
|
+
#
|
933
|
+
# Configuration can be applied globally to all clients, or to a single client
|
934
|
+
# on construction.
|
935
|
+
#
|
936
|
+
# @example
|
937
|
+
#
|
938
|
+
# # Modify the global config, setting the timeout for
|
939
|
+
# # list_instances to 20 seconds,
|
940
|
+
# # and all remaining timeouts to 10 seconds.
|
941
|
+
# ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.configure do |config|
|
942
|
+
# config.timeout = 10.0
|
943
|
+
# config.rpcs.list_instances.timeout = 20.0
|
944
|
+
# end
|
945
|
+
#
|
946
|
+
# # Apply the above configuration only to a new client.
|
947
|
+
# client = ::Google::Cloud::Parallelstore::V1beta::Parallelstore::Rest::Client.new do |config|
|
948
|
+
# config.timeout = 10.0
|
949
|
+
# config.rpcs.list_instances.timeout = 20.0
|
950
|
+
# end
|
951
|
+
#
|
952
|
+
# @!attribute [rw] endpoint
|
953
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
954
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
955
|
+
# @return [::String,nil]
|
956
|
+
# @!attribute [rw] credentials
|
957
|
+
# Credentials to send with calls. You may provide any of the following types:
|
958
|
+
# * (`String`) The path to a service account key file in JSON format
|
959
|
+
# * (`Hash`) A service account key as a Hash
|
960
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
961
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
962
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
963
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
964
|
+
# * (`nil`) indicating no credentials
|
965
|
+
# @return [::Object]
|
966
|
+
# @!attribute [rw] scope
|
967
|
+
# The OAuth scopes
|
968
|
+
# @return [::Array<::String>]
|
969
|
+
# @!attribute [rw] lib_name
|
970
|
+
# The library name as recorded in instrumentation and logging
|
971
|
+
# @return [::String]
|
972
|
+
# @!attribute [rw] lib_version
|
973
|
+
# The library version as recorded in instrumentation and logging
|
974
|
+
# @return [::String]
|
975
|
+
# @!attribute [rw] timeout
|
976
|
+
# The call timeout in seconds.
|
977
|
+
# @return [::Numeric]
|
978
|
+
# @!attribute [rw] metadata
|
979
|
+
# Additional headers to be sent with the call.
|
980
|
+
# @return [::Hash{::Symbol=>::String}]
|
981
|
+
# @!attribute [rw] retry_policy
|
982
|
+
# The retry policy. The value is a hash with the following keys:
|
983
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
984
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
985
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
986
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
987
|
+
# trigger a retry.
|
988
|
+
# @return [::Hash]
|
989
|
+
# @!attribute [rw] quota_project
|
990
|
+
# A separate project against which to charge quota.
|
991
|
+
# @return [::String]
|
992
|
+
# @!attribute [rw] universe_domain
|
993
|
+
# The universe domain within which to make requests. This determines the
|
994
|
+
# default endpoint URL. The default value of nil uses the environment
|
995
|
+
# universe (usually the default "googleapis.com" universe).
|
996
|
+
# @return [::String,nil]
|
997
|
+
#
|
998
|
+
class Configuration
|
999
|
+
extend ::Gapic::Config
|
1000
|
+
|
1001
|
+
# @private
|
1002
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1003
|
+
DEFAULT_ENDPOINT = "parallelstore.googleapis.com"
|
1004
|
+
|
1005
|
+
config_attr :endpoint, nil, ::String, nil
|
1006
|
+
config_attr :credentials, nil do |value|
|
1007
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1008
|
+
allowed.any? { |klass| klass === value }
|
1009
|
+
end
|
1010
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
1011
|
+
config_attr :lib_name, nil, ::String, nil
|
1012
|
+
config_attr :lib_version, nil, ::String, nil
|
1013
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1014
|
+
config_attr :metadata, nil, ::Hash, nil
|
1015
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1016
|
+
config_attr :quota_project, nil, ::String, nil
|
1017
|
+
config_attr :universe_domain, nil, ::String, nil
|
1018
|
+
|
1019
|
+
# @private
|
1020
|
+
# Overrides for http bindings for the RPCs of this service
|
1021
|
+
# are only used when this service is used as mixin, and only
|
1022
|
+
# by the host service.
|
1023
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1024
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
1025
|
+
|
1026
|
+
# @private
|
1027
|
+
def initialize parent_config = nil
|
1028
|
+
@parent_config = parent_config unless parent_config.nil?
|
1029
|
+
|
1030
|
+
yield self if block_given?
|
1031
|
+
end
|
1032
|
+
|
1033
|
+
##
|
1034
|
+
# Configurations for individual RPCs
|
1035
|
+
# @return [Rpcs]
|
1036
|
+
#
|
1037
|
+
def rpcs
|
1038
|
+
@rpcs ||= begin
|
1039
|
+
parent_rpcs = nil
|
1040
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1041
|
+
Rpcs.new parent_rpcs
|
1042
|
+
end
|
1043
|
+
end
|
1044
|
+
|
1045
|
+
##
|
1046
|
+
# Configuration RPC class for the Parallelstore API.
|
1047
|
+
#
|
1048
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1049
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1050
|
+
# the following configuration fields:
|
1051
|
+
#
|
1052
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
1053
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
1054
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1055
|
+
# include the following keys:
|
1056
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1057
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1058
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1059
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1060
|
+
# trigger a retry.
|
1061
|
+
#
|
1062
|
+
class Rpcs
|
1063
|
+
##
|
1064
|
+
# RPC-specific configuration for `list_instances`
|
1065
|
+
# @return [::Gapic::Config::Method]
|
1066
|
+
#
|
1067
|
+
attr_reader :list_instances
|
1068
|
+
##
|
1069
|
+
# RPC-specific configuration for `get_instance`
|
1070
|
+
# @return [::Gapic::Config::Method]
|
1071
|
+
#
|
1072
|
+
attr_reader :get_instance
|
1073
|
+
##
|
1074
|
+
# RPC-specific configuration for `create_instance`
|
1075
|
+
# @return [::Gapic::Config::Method]
|
1076
|
+
#
|
1077
|
+
attr_reader :create_instance
|
1078
|
+
##
|
1079
|
+
# RPC-specific configuration for `update_instance`
|
1080
|
+
# @return [::Gapic::Config::Method]
|
1081
|
+
#
|
1082
|
+
attr_reader :update_instance
|
1083
|
+
##
|
1084
|
+
# RPC-specific configuration for `delete_instance`
|
1085
|
+
# @return [::Gapic::Config::Method]
|
1086
|
+
#
|
1087
|
+
attr_reader :delete_instance
|
1088
|
+
##
|
1089
|
+
# RPC-specific configuration for `import_data`
|
1090
|
+
# @return [::Gapic::Config::Method]
|
1091
|
+
#
|
1092
|
+
attr_reader :import_data
|
1093
|
+
##
|
1094
|
+
# RPC-specific configuration for `export_data`
|
1095
|
+
# @return [::Gapic::Config::Method]
|
1096
|
+
#
|
1097
|
+
attr_reader :export_data
|
1098
|
+
|
1099
|
+
# @private
|
1100
|
+
def initialize parent_rpcs = nil
|
1101
|
+
list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
|
1102
|
+
@list_instances = ::Gapic::Config::Method.new list_instances_config
|
1103
|
+
get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
|
1104
|
+
@get_instance = ::Gapic::Config::Method.new get_instance_config
|
1105
|
+
create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
|
1106
|
+
@create_instance = ::Gapic::Config::Method.new create_instance_config
|
1107
|
+
update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
|
1108
|
+
@update_instance = ::Gapic::Config::Method.new update_instance_config
|
1109
|
+
delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
|
1110
|
+
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
1111
|
+
import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data
|
1112
|
+
@import_data = ::Gapic::Config::Method.new import_data_config
|
1113
|
+
export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data
|
1114
|
+
@export_data = ::Gapic::Config::Method.new export_data_config
|
1115
|
+
|
1116
|
+
yield self if block_given?
|
1117
|
+
end
|
1118
|
+
end
|
1119
|
+
end
|
1120
|
+
end
|
1121
|
+
end
|
1122
|
+
end
|
1123
|
+
end
|
1124
|
+
end
|
1125
|
+
end
|
1126
|
+
end
|