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