google-cloud-backupdr-v1 0.4.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/backupdr/v1/backupdr/client.rb +137 -1
- data/lib/google/cloud/backupdr/v1/backupdr/operations.rb +7 -0
- data/lib/google/cloud/backupdr/v1/backupdr/rest/client.rb +158 -15
- data/lib/google/cloud/backupdr/v1/backupdr/rest/operations.rb +7 -0
- data/lib/google/cloud/backupdr/v1/backupdr/rest/service_stub.rb +62 -0
- data/lib/google/cloud/backupdr/v1/backupdr_pb.rb +3 -1
- data/lib/google/cloud/backupdr/v1/backupdr_services_pb.rb +2 -0
- data/lib/google/cloud/backupdr/v1/backupplanassociation_pb.rb +1 -1
- data/lib/google/cloud/backupdr/v1/backupvault_pb.rb +1 -1
- data/lib/google/cloud/backupdr/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +8 -0
- data/proto_docs/google/cloud/backupdr/v1/backupdr.rb +54 -5
- data/proto_docs/google/cloud/backupdr/v1/backupplan.rb +8 -2
- data/proto_docs/google/cloud/backupdr/v1/backupplanassociation.rb +6 -12
- data/proto_docs/google/cloud/backupdr/v1/backupvault.rb +33 -5
- data/proto_docs/google/cloud/backupdr/v1/backupvault_gce.rb +6 -0
- data/proto_docs/google/longrunning/operations.rb +4 -0
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7085a79a96a4e426803fdca873b7e687b59dde6f09f3dcdc59d573a55d3f91d7
|
4
|
+
data.tar.gz: b2d0e3990ebaef765911f468d660ab6377325ca78c9ef0696d279fc0afec2df3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 390bcfb79fd90362f5eb3580dd5cd2c4746d8921a534027227f8af7476482827bc0b7f97c746651ac89f0dc5e621b21ba1fe79e7ec0a7c26c069a04423c8fa08
|
7
|
+
data.tar.gz: 7c96ba0b3573f502cf89a6a092ca421ca5024992de657b1c159488c281c8a5326f5432b3012dcaa6c8edcafa0456046cdff9577fb99e2e3ed824272b15abef9c
|
data/README.md
CHANGED
@@ -86,7 +86,7 @@ To browse ready to use code samples check [Google Cloud Samples](https://cloud.g
|
|
86
86
|
|
87
87
|
## Supported Ruby Versions
|
88
88
|
|
89
|
-
This library is supported on Ruby
|
89
|
+
This library is supported on Ruby 3.0+.
|
90
90
|
|
91
91
|
Google provides official support for Ruby versions that are actively supported
|
92
92
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -139,6 +139,11 @@ module Google
|
|
139
139
|
|
140
140
|
default_config.rpcs.restore_backup.timeout = 60.0
|
141
141
|
|
142
|
+
default_config.rpcs.initialize_service.timeout = 60.0
|
143
|
+
default_config.rpcs.initialize_service.retry_policy = {
|
144
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
145
|
+
}
|
146
|
+
|
142
147
|
default_config
|
143
148
|
end
|
144
149
|
yield @configure if block_given?
|
@@ -1265,7 +1270,7 @@ module Google
|
|
1265
1270
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1266
1271
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1267
1272
|
#
|
1268
|
-
# @overload delete_backup_vault(name: nil, request_id: nil, force: nil, etag: nil, validate_only: nil, allow_missing: nil)
|
1273
|
+
# @overload delete_backup_vault(name: nil, request_id: nil, force: nil, etag: nil, validate_only: nil, allow_missing: nil, ignore_backup_plan_references: nil)
|
1269
1274
|
# Pass arguments to `delete_backup_vault` via keyword arguments. Note that at
|
1270
1275
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1271
1276
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -1299,6 +1304,9 @@ module Google
|
|
1299
1304
|
# @param allow_missing [::Boolean]
|
1300
1305
|
# Optional. If true and the BackupVault is not found, the request will
|
1301
1306
|
# succeed but no action will be taken.
|
1307
|
+
# @param ignore_backup_plan_references [::Boolean]
|
1308
|
+
# Optional. If set to true, backupvault deletion will proceed even if there
|
1309
|
+
# are backup plans referencing the backupvault. The default is 'false'.
|
1302
1310
|
#
|
1303
1311
|
# @yield [response, operation] Access the result along with the RPC operation
|
1304
1312
|
# @yieldparam response [::Gapic::Operation]
|
@@ -3163,6 +3171,120 @@ module Google
|
|
3163
3171
|
raise ::Google::Cloud::Error.from_error(e)
|
3164
3172
|
end
|
3165
3173
|
|
3174
|
+
##
|
3175
|
+
# Initializes the service related config for a project.
|
3176
|
+
#
|
3177
|
+
# @overload initialize_service(request, options = nil)
|
3178
|
+
# Pass arguments to `initialize_service` via a request object, either of type
|
3179
|
+
# {::Google::Cloud::BackupDR::V1::InitializeServiceRequest} or an equivalent Hash.
|
3180
|
+
#
|
3181
|
+
# @param request [::Google::Cloud::BackupDR::V1::InitializeServiceRequest, ::Hash]
|
3182
|
+
# A request object representing the call parameters. Required. To specify no
|
3183
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3184
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3185
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3186
|
+
#
|
3187
|
+
# @overload initialize_service(name: nil, resource_type: nil, request_id: nil)
|
3188
|
+
# Pass arguments to `initialize_service` via keyword arguments. Note that at
|
3189
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3190
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3191
|
+
#
|
3192
|
+
# @param name [::String]
|
3193
|
+
# Required. The resource name of the serviceConfig used to initialize the
|
3194
|
+
# service. Format:
|
3195
|
+
# `projects/{project_id}/locations/{location}/serviceConfig`.
|
3196
|
+
# @param resource_type [::String]
|
3197
|
+
# Required. The resource type to which the default service config will be
|
3198
|
+
# applied. Examples include, "compute.googleapis.com/Instance" and
|
3199
|
+
# "storage.googleapis.com/Bucket".
|
3200
|
+
# @param request_id [::String]
|
3201
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3202
|
+
# request ID so that if you must retry your request, the server will know to
|
3203
|
+
# ignore the request if it has already been completed. The server will
|
3204
|
+
# guarantee that for at least 60 minutes since the first request.
|
3205
|
+
#
|
3206
|
+
# For example, consider a situation where you make an initial request and t
|
3207
|
+
# he request times out. If you make the request again with the same request
|
3208
|
+
# ID, the server can check if original operation with the same request ID
|
3209
|
+
# was received, and if so, will ignore the second request. This prevents
|
3210
|
+
# clients from accidentally creating duplicate commitments.
|
3211
|
+
#
|
3212
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3213
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3214
|
+
#
|
3215
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3216
|
+
# @yieldparam response [::Gapic::Operation]
|
3217
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3218
|
+
#
|
3219
|
+
# @return [::Gapic::Operation]
|
3220
|
+
#
|
3221
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3222
|
+
#
|
3223
|
+
# @example Basic example
|
3224
|
+
# require "google/cloud/backupdr/v1"
|
3225
|
+
#
|
3226
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3227
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
3228
|
+
#
|
3229
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3230
|
+
# request = Google::Cloud::BackupDR::V1::InitializeServiceRequest.new
|
3231
|
+
#
|
3232
|
+
# # Call the initialize_service method.
|
3233
|
+
# result = client.initialize_service request
|
3234
|
+
#
|
3235
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3236
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3237
|
+
# # Here is how to wait for a response.
|
3238
|
+
# result.wait_until_done! timeout: 60
|
3239
|
+
# if result.response?
|
3240
|
+
# p result.response
|
3241
|
+
# else
|
3242
|
+
# puts "No response received."
|
3243
|
+
# end
|
3244
|
+
#
|
3245
|
+
def initialize_service request, options = nil
|
3246
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3247
|
+
|
3248
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::InitializeServiceRequest
|
3249
|
+
|
3250
|
+
# Converts hash and nil to an options object
|
3251
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3252
|
+
|
3253
|
+
# Customize the options with defaults
|
3254
|
+
metadata = @config.rpcs.initialize_service.metadata.to_h
|
3255
|
+
|
3256
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3257
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3258
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3259
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
3260
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3261
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3262
|
+
|
3263
|
+
header_params = {}
|
3264
|
+
if request.name
|
3265
|
+
header_params["name"] = request.name
|
3266
|
+
end
|
3267
|
+
|
3268
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3269
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3270
|
+
|
3271
|
+
options.apply_defaults timeout: @config.rpcs.initialize_service.timeout,
|
3272
|
+
metadata: metadata,
|
3273
|
+
retry_policy: @config.rpcs.initialize_service.retry_policy
|
3274
|
+
|
3275
|
+
options.apply_defaults timeout: @config.timeout,
|
3276
|
+
metadata: @config.metadata,
|
3277
|
+
retry_policy: @config.retry_policy
|
3278
|
+
|
3279
|
+
@backup_dr_stub.call_rpc :initialize_service, request, options: options do |response, operation|
|
3280
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
3281
|
+
yield response, operation if block_given?
|
3282
|
+
throw :response, response
|
3283
|
+
end
|
3284
|
+
rescue ::GRPC::BadStatus => e
|
3285
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3286
|
+
end
|
3287
|
+
|
3166
3288
|
##
|
3167
3289
|
# Configuration class for the BackupDR API.
|
3168
3290
|
#
|
@@ -3207,6 +3329,13 @@ module Google
|
|
3207
3329
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
3208
3330
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
3209
3331
|
# * (`nil`) indicating no credentials
|
3332
|
+
#
|
3333
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
3334
|
+
# external source for authentication to Google Cloud, you must validate it before
|
3335
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
3336
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
3337
|
+
# For more information, refer to [Validate credential configurations from external
|
3338
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
3210
3339
|
# @return [::Object]
|
3211
3340
|
# @!attribute [rw] scope
|
3212
3341
|
# The OAuth scopes
|
@@ -3457,6 +3586,11 @@ module Google
|
|
3457
3586
|
# @return [::Gapic::Config::Method]
|
3458
3587
|
#
|
3459
3588
|
attr_reader :trigger_backup
|
3589
|
+
##
|
3590
|
+
# RPC-specific configuration for `initialize_service`
|
3591
|
+
# @return [::Gapic::Config::Method]
|
3592
|
+
#
|
3593
|
+
attr_reader :initialize_service
|
3460
3594
|
|
3461
3595
|
# @private
|
3462
3596
|
def initialize parent_rpcs = nil
|
@@ -3514,6 +3648,8 @@ module Google
|
|
3514
3648
|
@delete_backup_plan_association = ::Gapic::Config::Method.new delete_backup_plan_association_config
|
3515
3649
|
trigger_backup_config = parent_rpcs.trigger_backup if parent_rpcs.respond_to? :trigger_backup
|
3516
3650
|
@trigger_backup = ::Gapic::Config::Method.new trigger_backup_config
|
3651
|
+
initialize_service_config = parent_rpcs.initialize_service if parent_rpcs.respond_to? :initialize_service
|
3652
|
+
@initialize_service = ::Gapic::Config::Method.new initialize_service_config
|
3517
3653
|
|
3518
3654
|
yield self if block_given?
|
3519
3655
|
end
|
@@ -640,6 +640,13 @@ module Google
|
|
640
640
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
641
641
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
642
642
|
# * (`nil`) indicating no credentials
|
643
|
+
#
|
644
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
645
|
+
# external source for authentication to Google Cloud, you must validate it before
|
646
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
647
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
648
|
+
# For more information, refer to [Validate credential configurations from external
|
649
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
643
650
|
# @return [::Object]
|
644
651
|
# @!attribute [rw] scope
|
645
652
|
# The OAuth scopes
|
@@ -141,6 +141,11 @@ module Google
|
|
141
141
|
|
142
142
|
default_config.rpcs.restore_backup.timeout = 60.0
|
143
143
|
|
144
|
+
default_config.rpcs.initialize_service.timeout = 60.0
|
145
|
+
default_config.rpcs.initialize_service.retry_policy = {
|
146
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
147
|
+
}
|
148
|
+
|
144
149
|
default_config
|
145
150
|
end
|
146
151
|
yield @configure if block_given?
|
@@ -326,10 +331,10 @@ module Google
|
|
326
331
|
# @param order_by [::String]
|
327
332
|
# Optional. Hint for how to order the results.
|
328
333
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
329
|
-
# @yieldparam result [::Google::Cloud::BackupDR::V1::
|
334
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::ManagementServer>]
|
330
335
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
331
336
|
#
|
332
|
-
# @return [::Google::Cloud::BackupDR::V1::
|
337
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::ManagementServer>]
|
333
338
|
#
|
334
339
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
335
340
|
#
|
@@ -381,7 +386,9 @@ module Google
|
|
381
386
|
retry_policy: @config.retry_policy
|
382
387
|
|
383
388
|
@backup_dr_stub.list_management_servers request, options do |result, operation|
|
389
|
+
result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_management_servers, "management_servers", request, result, options
|
384
390
|
yield result, operation if block_given?
|
391
|
+
throw :response, result
|
385
392
|
end
|
386
393
|
rescue ::Gapic::Rest::Error => e
|
387
394
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -824,10 +831,10 @@ module Google
|
|
824
831
|
# Optional. Reserved for future use to provide a BASIC & FULL view of Backup
|
825
832
|
# Vault.
|
826
833
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
827
|
-
# @yieldparam result [::Google::Cloud::BackupDR::V1::
|
834
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>]
|
828
835
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
829
836
|
#
|
830
|
-
# @return [::Google::Cloud::BackupDR::V1::
|
837
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>]
|
831
838
|
#
|
832
839
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
833
840
|
#
|
@@ -879,7 +886,9 @@ module Google
|
|
879
886
|
retry_policy: @config.retry_policy
|
880
887
|
|
881
888
|
@backup_dr_stub.list_backup_vaults request, options do |result, operation|
|
889
|
+
result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_vaults, "backup_vaults", request, result, options
|
882
890
|
yield result, operation if block_given?
|
891
|
+
throw :response, result
|
883
892
|
end
|
884
893
|
rescue ::Gapic::Rest::Error => e
|
885
894
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -922,10 +931,10 @@ module Google
|
|
922
931
|
# @param order_by [::String]
|
923
932
|
# Optional. Hint for how to order the results.
|
924
933
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
925
|
-
# @yieldparam result [::Google::Cloud::BackupDR::V1::
|
934
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>]
|
926
935
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
927
936
|
#
|
928
|
-
# @return [::Google::Cloud::BackupDR::V1::
|
937
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>]
|
929
938
|
#
|
930
939
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
931
940
|
#
|
@@ -977,7 +986,9 @@ module Google
|
|
977
986
|
retry_policy: @config.retry_policy
|
978
987
|
|
979
988
|
@backup_dr_stub.fetch_usable_backup_vaults request, options do |result, operation|
|
989
|
+
result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :fetch_usable_backup_vaults, "backup_vaults", request, result, options
|
980
990
|
yield result, operation if block_given?
|
991
|
+
throw :response, result
|
981
992
|
end
|
982
993
|
rescue ::Gapic::Rest::Error => e
|
983
994
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1191,7 +1202,7 @@ module Google
|
|
1191
1202
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1192
1203
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1193
1204
|
#
|
1194
|
-
# @overload delete_backup_vault(name: nil, request_id: nil, force: nil, etag: nil, validate_only: nil, allow_missing: nil)
|
1205
|
+
# @overload delete_backup_vault(name: nil, request_id: nil, force: nil, etag: nil, validate_only: nil, allow_missing: nil, ignore_backup_plan_references: nil)
|
1195
1206
|
# Pass arguments to `delete_backup_vault` via keyword arguments. Note that at
|
1196
1207
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1197
1208
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -1225,6 +1236,9 @@ module Google
|
|
1225
1236
|
# @param allow_missing [::Boolean]
|
1226
1237
|
# Optional. If true and the BackupVault is not found, the request will
|
1227
1238
|
# succeed but no action will be taken.
|
1239
|
+
# @param ignore_backup_plan_references [::Boolean]
|
1240
|
+
# Optional. If set to true, backupvault deletion will proceed even if there
|
1241
|
+
# are backup plans referencing the backupvault. The default is 'false'.
|
1228
1242
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1229
1243
|
# @yieldparam result [::Gapic::Operation]
|
1230
1244
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1327,10 +1341,10 @@ module Google
|
|
1327
1341
|
# @param order_by [::String]
|
1328
1342
|
# Optional. Hint for how to order the results.
|
1329
1343
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1330
|
-
# @yieldparam result [::Google::Cloud::BackupDR::V1::
|
1344
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSource>]
|
1331
1345
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1332
1346
|
#
|
1333
|
-
# @return [::Google::Cloud::BackupDR::V1::
|
1347
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSource>]
|
1334
1348
|
#
|
1335
1349
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1336
1350
|
#
|
@@ -1382,7 +1396,9 @@ module Google
|
|
1382
1396
|
retry_policy: @config.retry_policy
|
1383
1397
|
|
1384
1398
|
@backup_dr_stub.list_data_sources request, options do |result, operation|
|
1399
|
+
result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_data_sources, "data_sources", request, result, options
|
1385
1400
|
yield result, operation if block_given?
|
1401
|
+
throw :response, result
|
1386
1402
|
end
|
1387
1403
|
rescue ::Gapic::Rest::Error => e
|
1388
1404
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1614,10 +1630,10 @@ module Google
|
|
1614
1630
|
# Optional. Reserved for future use to provide a BASIC & FULL view of Backup
|
1615
1631
|
# resource.
|
1616
1632
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1617
|
-
# @yieldparam result [::Google::Cloud::BackupDR::V1::
|
1633
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>]
|
1618
1634
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1619
1635
|
#
|
1620
|
-
# @return [::Google::Cloud::BackupDR::V1::
|
1636
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>]
|
1621
1637
|
#
|
1622
1638
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1623
1639
|
#
|
@@ -1669,7 +1685,9 @@ module Google
|
|
1669
1685
|
retry_policy: @config.retry_policy
|
1670
1686
|
|
1671
1687
|
@backup_dr_stub.list_backups request, options do |result, operation|
|
1688
|
+
result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backups, "backups", request, result, options
|
1672
1689
|
yield result, operation if block_given?
|
1690
|
+
throw :response, result
|
1673
1691
|
end
|
1674
1692
|
rescue ::Gapic::Rest::Error => e
|
1675
1693
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2304,10 +2322,10 @@ module Google
|
|
2304
2322
|
# @param order_by [::String]
|
2305
2323
|
# Optional. Field by which to sort the results.
|
2306
2324
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
2307
|
-
# @yieldparam result [::Google::Cloud::BackupDR::V1::
|
2325
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlan>]
|
2308
2326
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2309
2327
|
#
|
2310
|
-
# @return [::Google::Cloud::BackupDR::V1::
|
2328
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlan>]
|
2311
2329
|
#
|
2312
2330
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2313
2331
|
#
|
@@ -2359,7 +2377,9 @@ module Google
|
|
2359
2377
|
retry_policy: @config.retry_policy
|
2360
2378
|
|
2361
2379
|
@backup_dr_stub.list_backup_plans request, options do |result, operation|
|
2380
|
+
result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_plans, "backup_plans", request, result, options
|
2362
2381
|
yield result, operation if block_given?
|
2382
|
+
throw :response, result
|
2363
2383
|
end
|
2364
2384
|
rescue ::Gapic::Rest::Error => e
|
2365
2385
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2688,10 +2708,10 @@ module Google
|
|
2688
2708
|
# @param filter [::String]
|
2689
2709
|
# Optional. Filtering results
|
2690
2710
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
2691
|
-
# @yieldparam result [::Google::Cloud::BackupDR::V1::
|
2711
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>]
|
2692
2712
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2693
2713
|
#
|
2694
|
-
# @return [::Google::Cloud::BackupDR::V1::
|
2714
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>]
|
2695
2715
|
#
|
2696
2716
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2697
2717
|
#
|
@@ -2743,7 +2763,9 @@ module Google
|
|
2743
2763
|
retry_policy: @config.retry_policy
|
2744
2764
|
|
2745
2765
|
@backup_dr_stub.list_backup_plan_associations request, options do |result, operation|
|
2766
|
+
result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_plan_associations, "backup_plan_associations", request, result, options
|
2746
2767
|
yield result, operation if block_given?
|
2768
|
+
throw :response, result
|
2747
2769
|
end
|
2748
2770
|
rescue ::Gapic::Rest::Error => e
|
2749
2771
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2955,6 +2977,113 @@ module Google
|
|
2955
2977
|
raise ::Google::Cloud::Error.from_error(e)
|
2956
2978
|
end
|
2957
2979
|
|
2980
|
+
##
|
2981
|
+
# Initializes the service related config for a project.
|
2982
|
+
#
|
2983
|
+
# @overload initialize_service(request, options = nil)
|
2984
|
+
# Pass arguments to `initialize_service` via a request object, either of type
|
2985
|
+
# {::Google::Cloud::BackupDR::V1::InitializeServiceRequest} or an equivalent Hash.
|
2986
|
+
#
|
2987
|
+
# @param request [::Google::Cloud::BackupDR::V1::InitializeServiceRequest, ::Hash]
|
2988
|
+
# A request object representing the call parameters. Required. To specify no
|
2989
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2990
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2991
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2992
|
+
#
|
2993
|
+
# @overload initialize_service(name: nil, resource_type: nil, request_id: nil)
|
2994
|
+
# Pass arguments to `initialize_service` via keyword arguments. Note that at
|
2995
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2996
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2997
|
+
#
|
2998
|
+
# @param name [::String]
|
2999
|
+
# Required. The resource name of the serviceConfig used to initialize the
|
3000
|
+
# service. Format:
|
3001
|
+
# `projects/{project_id}/locations/{location}/serviceConfig`.
|
3002
|
+
# @param resource_type [::String]
|
3003
|
+
# Required. The resource type to which the default service config will be
|
3004
|
+
# applied. Examples include, "compute.googleapis.com/Instance" and
|
3005
|
+
# "storage.googleapis.com/Bucket".
|
3006
|
+
# @param request_id [::String]
|
3007
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3008
|
+
# request ID so that if you must retry your request, the server will know to
|
3009
|
+
# ignore the request if it has already been completed. The server will
|
3010
|
+
# guarantee that for at least 60 minutes since the first request.
|
3011
|
+
#
|
3012
|
+
# For example, consider a situation where you make an initial request and t
|
3013
|
+
# he request times out. If you make the request again with the same request
|
3014
|
+
# ID, the server can check if original operation with the same request ID
|
3015
|
+
# was received, and if so, will ignore the second request. This prevents
|
3016
|
+
# clients from accidentally creating duplicate commitments.
|
3017
|
+
#
|
3018
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3019
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3020
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
3021
|
+
# @yieldparam result [::Gapic::Operation]
|
3022
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
3023
|
+
#
|
3024
|
+
# @return [::Gapic::Operation]
|
3025
|
+
#
|
3026
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
3027
|
+
#
|
3028
|
+
# @example Basic example
|
3029
|
+
# require "google/cloud/backupdr/v1"
|
3030
|
+
#
|
3031
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3032
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new
|
3033
|
+
#
|
3034
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3035
|
+
# request = Google::Cloud::BackupDR::V1::InitializeServiceRequest.new
|
3036
|
+
#
|
3037
|
+
# # Call the initialize_service method.
|
3038
|
+
# result = client.initialize_service request
|
3039
|
+
#
|
3040
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3041
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3042
|
+
# # Here is how to wait for a response.
|
3043
|
+
# result.wait_until_done! timeout: 60
|
3044
|
+
# if result.response?
|
3045
|
+
# p result.response
|
3046
|
+
# else
|
3047
|
+
# puts "No response received."
|
3048
|
+
# end
|
3049
|
+
#
|
3050
|
+
def initialize_service request, options = nil
|
3051
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3052
|
+
|
3053
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::InitializeServiceRequest
|
3054
|
+
|
3055
|
+
# Converts hash and nil to an options object
|
3056
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3057
|
+
|
3058
|
+
# Customize the options with defaults
|
3059
|
+
call_metadata = @config.rpcs.initialize_service.metadata.to_h
|
3060
|
+
|
3061
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3062
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3063
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3064
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
|
3065
|
+
transports_version_send: [:rest]
|
3066
|
+
|
3067
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3068
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3069
|
+
|
3070
|
+
options.apply_defaults timeout: @config.rpcs.initialize_service.timeout,
|
3071
|
+
metadata: call_metadata,
|
3072
|
+
retry_policy: @config.rpcs.initialize_service.retry_policy
|
3073
|
+
|
3074
|
+
options.apply_defaults timeout: @config.timeout,
|
3075
|
+
metadata: @config.metadata,
|
3076
|
+
retry_policy: @config.retry_policy
|
3077
|
+
|
3078
|
+
@backup_dr_stub.initialize_service request, options do |result, operation|
|
3079
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
3080
|
+
yield result, operation if block_given?
|
3081
|
+
throw :response, result
|
3082
|
+
end
|
3083
|
+
rescue ::Gapic::Rest::Error => e
|
3084
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3085
|
+
end
|
3086
|
+
|
2958
3087
|
##
|
2959
3088
|
# Configuration class for the BackupDR REST API.
|
2960
3089
|
#
|
@@ -2997,6 +3126,13 @@ module Google
|
|
2997
3126
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
2998
3127
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
2999
3128
|
# * (`nil`) indicating no credentials
|
3129
|
+
#
|
3130
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
3131
|
+
# external source for authentication to Google Cloud, you must validate it before
|
3132
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
3133
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
3134
|
+
# For more information, refer to [Validate credential configurations from external
|
3135
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
3000
3136
|
# @return [::Object]
|
3001
3137
|
# @!attribute [rw] scope
|
3002
3138
|
# The OAuth scopes
|
@@ -3236,6 +3372,11 @@ module Google
|
|
3236
3372
|
# @return [::Gapic::Config::Method]
|
3237
3373
|
#
|
3238
3374
|
attr_reader :trigger_backup
|
3375
|
+
##
|
3376
|
+
# RPC-specific configuration for `initialize_service`
|
3377
|
+
# @return [::Gapic::Config::Method]
|
3378
|
+
#
|
3379
|
+
attr_reader :initialize_service
|
3239
3380
|
|
3240
3381
|
# @private
|
3241
3382
|
def initialize parent_rpcs = nil
|
@@ -3293,6 +3434,8 @@ module Google
|
|
3293
3434
|
@delete_backup_plan_association = ::Gapic::Config::Method.new delete_backup_plan_association_config
|
3294
3435
|
trigger_backup_config = parent_rpcs.trigger_backup if parent_rpcs.respond_to? :trigger_backup
|
3295
3436
|
@trigger_backup = ::Gapic::Config::Method.new trigger_backup_config
|
3437
|
+
initialize_service_config = parent_rpcs.initialize_service if parent_rpcs.respond_to? :initialize_service
|
3438
|
+
@initialize_service = ::Gapic::Config::Method.new initialize_service_config
|
3296
3439
|
|
3297
3440
|
yield self if block_given?
|
3298
3441
|
end
|
@@ -502,6 +502,13 @@ module Google
|
|
502
502
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
503
503
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
504
504
|
# * (`nil`) indicating no credentials
|
505
|
+
#
|
506
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
507
|
+
# external source for authentication to Google Cloud, you must validate it before
|
508
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
509
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
510
|
+
# For more information, refer to [Validate credential configurations from external
|
511
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
505
512
|
# @return [::Object]
|
506
513
|
# @!attribute [rw] scope
|
507
514
|
# The OAuth scopes
|
@@ -1153,6 +1153,46 @@ module Google
|
|
1153
1153
|
end
|
1154
1154
|
end
|
1155
1155
|
|
1156
|
+
##
|
1157
|
+
# Baseline implementation for the initialize_service REST call
|
1158
|
+
#
|
1159
|
+
# @param request_pb [::Google::Cloud::BackupDR::V1::InitializeServiceRequest]
|
1160
|
+
# A request object representing the call parameters. Required.
|
1161
|
+
# @param options [::Gapic::CallOptions]
|
1162
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1163
|
+
#
|
1164
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1165
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
1166
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1167
|
+
#
|
1168
|
+
# @return [::Google::Longrunning::Operation]
|
1169
|
+
# A result object deserialized from the server's reply
|
1170
|
+
def initialize_service request_pb, options = nil
|
1171
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
1172
|
+
|
1173
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_initialize_service_request request_pb
|
1174
|
+
query_string_params = if query_string_params.any?
|
1175
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
1176
|
+
else
|
1177
|
+
{}
|
1178
|
+
end
|
1179
|
+
|
1180
|
+
response = @client_stub.make_http_request(
|
1181
|
+
verb,
|
1182
|
+
uri: uri,
|
1183
|
+
body: body || "",
|
1184
|
+
params: query_string_params,
|
1185
|
+
method_name: "initialize_service",
|
1186
|
+
options: options
|
1187
|
+
)
|
1188
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
1189
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
1190
|
+
catch :response do
|
1191
|
+
yield result, operation if block_given?
|
1192
|
+
result
|
1193
|
+
end
|
1194
|
+
end
|
1195
|
+
|
1156
1196
|
##
|
1157
1197
|
# @private
|
1158
1198
|
#
|
@@ -1728,6 +1768,28 @@ module Google
|
|
1728
1768
|
)
|
1729
1769
|
transcoder.transcode request_pb
|
1730
1770
|
end
|
1771
|
+
|
1772
|
+
##
|
1773
|
+
# @private
|
1774
|
+
#
|
1775
|
+
# GRPC transcoding helper method for the initialize_service REST call
|
1776
|
+
#
|
1777
|
+
# @param request_pb [::Google::Cloud::BackupDR::V1::InitializeServiceRequest]
|
1778
|
+
# A request object representing the call parameters. Required.
|
1779
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
1780
|
+
# Uri, Body, Query string parameters
|
1781
|
+
def self.transcode_initialize_service_request request_pb
|
1782
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
1783
|
+
.with_bindings(
|
1784
|
+
uri_method: :post,
|
1785
|
+
uri_template: "/v1/{name}:initialize",
|
1786
|
+
body: "*",
|
1787
|
+
matches: [
|
1788
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/serviceConfig/?$}, false]
|
1789
|
+
]
|
1790
|
+
)
|
1791
|
+
transcoder.transcode request_pb
|
1792
|
+
end
|
1731
1793
|
end
|
1732
1794
|
end
|
1733
1795
|
end
|