google-cloud-backupdr-v1 0.2.0 → 0.3.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/lib/google/cloud/backupdr/v1/backupdr/client.rb +2829 -157
- data/lib/google/cloud/backupdr/v1/backupdr/operations.rb +3 -10
- data/lib/google/cloud/backupdr/v1/backupdr/paths.rb +101 -0
- data/lib/google/cloud/backupdr/v1/backupdr/rest/client.rb +2656 -151
- data/lib/google/cloud/backupdr/v1/backupdr/rest/operations.rb +3 -10
- data/lib/google/cloud/backupdr/v1/backupdr/rest/service_stub.rb +1382 -17
- data/lib/google/cloud/backupdr/v1/backupdr_pb.rb +5 -1
- data/lib/google/cloud/backupdr/v1/backupdr_services_pb.rb +48 -0
- data/lib/google/cloud/backupdr/v1/backupplan_pb.rb +62 -0
- data/lib/google/cloud/backupdr/v1/backupplanassociation_pb.rb +59 -0
- data/lib/google/cloud/backupdr/v1/backupvault_ba_pb.rb +46 -0
- data/lib/google/cloud/backupdr/v1/backupvault_gce_pb.rb +87 -0
- data/lib/google/cloud/backupdr/v1/backupvault_pb.rb +99 -0
- data/lib/google/cloud/backupdr/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +51 -10
- data/proto_docs/google/api/field_info.rb +88 -0
- data/proto_docs/google/api/resource.rb +7 -2
- data/proto_docs/google/cloud/backupdr/v1/backupdr.rb +11 -10
- data/proto_docs/google/cloud/backupdr/v1/backupplan.rb +414 -0
- data/proto_docs/google/cloud/backupdr/v1/backupplanassociation.rb +272 -0
- data/proto_docs/google/cloud/backupdr/v1/backupvault.rb +1103 -0
- data/proto_docs/google/cloud/backupdr/v1/backupvault_ba.rb +47 -0
- data/proto_docs/google/cloud/backupdr/v1/backupvault_gce.rb +993 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- data/proto_docs/google/type/dayofweek.rb +49 -0
- data/proto_docs/google/type/month.rb +64 -0
- metadata +16 -3
@@ -86,6 +86,59 @@ module Google
|
|
86
86
|
|
87
87
|
default_config.rpcs.delete_management_server.timeout = 60.0
|
88
88
|
|
89
|
+
default_config.rpcs.create_backup_vault.timeout = 60.0
|
90
|
+
default_config.rpcs.create_backup_vault.retry_policy = {
|
91
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
92
|
+
}
|
93
|
+
|
94
|
+
default_config.rpcs.list_backup_vaults.timeout = 60.0
|
95
|
+
default_config.rpcs.list_backup_vaults.retry_policy = {
|
96
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
97
|
+
}
|
98
|
+
|
99
|
+
default_config.rpcs.fetch_usable_backup_vaults.timeout = 60.0
|
100
|
+
default_config.rpcs.fetch_usable_backup_vaults.retry_policy = {
|
101
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
102
|
+
}
|
103
|
+
|
104
|
+
default_config.rpcs.get_backup_vault.timeout = 60.0
|
105
|
+
default_config.rpcs.get_backup_vault.retry_policy = {
|
106
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
107
|
+
}
|
108
|
+
|
109
|
+
default_config.rpcs.update_backup_vault.timeout = 60.0
|
110
|
+
|
111
|
+
default_config.rpcs.delete_backup_vault.timeout = 60.0
|
112
|
+
default_config.rpcs.delete_backup_vault.retry_policy = {
|
113
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
114
|
+
}
|
115
|
+
|
116
|
+
default_config.rpcs.list_data_sources.timeout = 60.0
|
117
|
+
default_config.rpcs.list_data_sources.retry_policy = {
|
118
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
119
|
+
}
|
120
|
+
|
121
|
+
default_config.rpcs.get_data_source.timeout = 60.0
|
122
|
+
default_config.rpcs.get_data_source.retry_policy = {
|
123
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
124
|
+
}
|
125
|
+
|
126
|
+
default_config.rpcs.update_data_source.timeout = 60.0
|
127
|
+
|
128
|
+
default_config.rpcs.list_backups.timeout = 60.0
|
129
|
+
default_config.rpcs.list_backups.retry_policy = {
|
130
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
131
|
+
}
|
132
|
+
|
133
|
+
default_config.rpcs.get_backup.timeout = 60.0
|
134
|
+
default_config.rpcs.get_backup.retry_policy = {
|
135
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
136
|
+
}
|
137
|
+
|
138
|
+
default_config.rpcs.update_backup.timeout = 60.0
|
139
|
+
|
140
|
+
default_config.rpcs.restore_backup.timeout = 60.0
|
141
|
+
|
89
142
|
default_config
|
90
143
|
end
|
91
144
|
yield @configure if block_given?
|
@@ -241,10 +294,11 @@ module Google
|
|
241
294
|
#
|
242
295
|
# @param parent [::String]
|
243
296
|
# Required. The project and location for which to retrieve management servers
|
244
|
-
# information, in the format
|
245
|
-
# Cloud BackupDR, locations map to
|
246
|
-
# To retrieve management servers for all locations, use "-"
|
247
|
-
#
|
297
|
+
# information, in the format 'projects/\\{project_id}/locations/\\{location}'. In
|
298
|
+
# Cloud BackupDR, locations map to Google Cloud regions, for example
|
299
|
+
# **us-central1**. To retrieve management servers for all locations, use "-"
|
300
|
+
# for the
|
301
|
+
# '\\{location}' value.
|
248
302
|
# @param page_size [::Integer]
|
249
303
|
# Optional. Requested page size. Server may return fewer items than
|
250
304
|
# requested. If unspecified, server will pick an appropriate default.
|
@@ -345,7 +399,7 @@ module Google
|
|
345
399
|
#
|
346
400
|
# @param name [::String]
|
347
401
|
# Required. Name of the management server resource name, in the format
|
348
|
-
#
|
402
|
+
# 'projects/\\{project_id}/locations/\\{location}/managementServers/\\{resource_name}'
|
349
403
|
#
|
350
404
|
# @yield [response, operation] Access the result along with the RPC operation
|
351
405
|
# @yieldparam response [::Google::Cloud::BackupDR::V1::ManagementServer]
|
@@ -432,8 +486,8 @@ module Google
|
|
432
486
|
#
|
433
487
|
# @param parent [::String]
|
434
488
|
# Required. The management server project and location in the format
|
435
|
-
#
|
436
|
-
# locations map to
|
489
|
+
# 'projects/\\{project_id}/locations/\\{location}'. In Cloud Backup and DR
|
490
|
+
# locations map to Google Cloud regions, for example **us-central1**.
|
437
491
|
# @param management_server_id [::String]
|
438
492
|
# Required. The name of the management server to create. The name must be
|
439
493
|
# unique for the specified project and location.
|
@@ -637,178 +691,2750 @@ module Google
|
|
637
691
|
end
|
638
692
|
|
639
693
|
##
|
640
|
-
#
|
694
|
+
# Creates a new BackupVault in a given project and location.
|
641
695
|
#
|
642
|
-
#
|
643
|
-
#
|
644
|
-
#
|
645
|
-
# applied individually to specific RPCs. See
|
646
|
-
# {::Google::Cloud::BackupDR::V1::BackupDR::Client::Configuration::Rpcs}
|
647
|
-
# for a list of RPCs that can be configured independently.
|
696
|
+
# @overload create_backup_vault(request, options = nil)
|
697
|
+
# Pass arguments to `create_backup_vault` via a request object, either of type
|
698
|
+
# {::Google::Cloud::BackupDR::V1::CreateBackupVaultRequest} or an equivalent Hash.
|
648
699
|
#
|
649
|
-
#
|
650
|
-
#
|
700
|
+
# @param request [::Google::Cloud::BackupDR::V1::CreateBackupVaultRequest, ::Hash]
|
701
|
+
# A request object representing the call parameters. Required. To specify no
|
702
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
703
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
704
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
651
705
|
#
|
652
|
-
# @
|
706
|
+
# @overload create_backup_vault(parent: nil, backup_vault_id: nil, backup_vault: nil, request_id: nil, validate_only: nil)
|
707
|
+
# Pass arguments to `create_backup_vault` via keyword arguments. Note that at
|
708
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
709
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
653
710
|
#
|
654
|
-
#
|
655
|
-
#
|
656
|
-
#
|
657
|
-
#
|
658
|
-
#
|
659
|
-
#
|
660
|
-
#
|
711
|
+
# @param parent [::String]
|
712
|
+
# Required. Value for parent.
|
713
|
+
# @param backup_vault_id [::String]
|
714
|
+
# Required. ID of the requesting object
|
715
|
+
# If auto-generating ID server-side, remove this field and
|
716
|
+
# backup_vault_id from the method_signature of Create RPC
|
717
|
+
# @param backup_vault [::Google::Cloud::BackupDR::V1::BackupVault, ::Hash]
|
718
|
+
# Required. The resource being created
|
719
|
+
# @param request_id [::String]
|
720
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
721
|
+
# request ID so that if you must retry your request, the server will know to
|
722
|
+
# ignore the request if it has already been completed. The server will
|
723
|
+
# guarantee that for at least 60 minutes since the first request.
|
661
724
|
#
|
662
|
-
#
|
663
|
-
#
|
664
|
-
#
|
665
|
-
#
|
666
|
-
#
|
725
|
+
# For example, consider a situation where you make an initial request and
|
726
|
+
# the request times out. If you make the request again with the same request
|
727
|
+
# ID, the server can check if original operation with the same request ID
|
728
|
+
# was received, and if so, will ignore the second request. This prevents
|
729
|
+
# clients from accidentally creating duplicate commitments.
|
667
730
|
#
|
668
|
-
#
|
669
|
-
#
|
670
|
-
#
|
671
|
-
#
|
672
|
-
#
|
673
|
-
# Credentials to send with calls. You may provide any of the following types:
|
674
|
-
# * (`String`) The path to a service account key file in JSON format
|
675
|
-
# * (`Hash`) A service account key as a Hash
|
676
|
-
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
677
|
-
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
678
|
-
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
679
|
-
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
680
|
-
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
681
|
-
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
682
|
-
# * (`nil`) indicating no credentials
|
683
|
-
# @return [::Object]
|
684
|
-
# @!attribute [rw] scope
|
685
|
-
# The OAuth scopes
|
686
|
-
# @return [::Array<::String>]
|
687
|
-
# @!attribute [rw] lib_name
|
688
|
-
# The library name as recorded in instrumentation and logging
|
689
|
-
# @return [::String]
|
690
|
-
# @!attribute [rw] lib_version
|
691
|
-
# The library version as recorded in instrumentation and logging
|
692
|
-
# @return [::String]
|
693
|
-
# @!attribute [rw] channel_args
|
694
|
-
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
695
|
-
# `GRPC::Core::Channel` object is provided as the credential.
|
696
|
-
# @return [::Hash]
|
697
|
-
# @!attribute [rw] interceptors
|
698
|
-
# An array of interceptors that are run before calls are executed.
|
699
|
-
# @return [::Array<::GRPC::ClientInterceptor>]
|
700
|
-
# @!attribute [rw] timeout
|
701
|
-
# The call timeout in seconds.
|
702
|
-
# @return [::Numeric]
|
703
|
-
# @!attribute [rw] metadata
|
704
|
-
# Additional gRPC headers to be sent with the call.
|
705
|
-
# @return [::Hash{::Symbol=>::String}]
|
706
|
-
# @!attribute [rw] retry_policy
|
707
|
-
# The retry policy. The value is a hash with the following keys:
|
708
|
-
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
709
|
-
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
710
|
-
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
711
|
-
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
712
|
-
# trigger a retry.
|
713
|
-
# @return [::Hash]
|
714
|
-
# @!attribute [rw] quota_project
|
715
|
-
# A separate project against which to charge quota.
|
716
|
-
# @return [::String]
|
717
|
-
# @!attribute [rw] universe_domain
|
718
|
-
# The universe domain within which to make requests. This determines the
|
719
|
-
# default endpoint URL. The default value of nil uses the environment
|
720
|
-
# universe (usually the default "googleapis.com" universe).
|
721
|
-
# @return [::String,nil]
|
731
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
732
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
733
|
+
# @param validate_only [::Boolean]
|
734
|
+
# Optional. Only validate the request, but do not perform mutations.
|
735
|
+
# The default is 'false'.
|
722
736
|
#
|
723
|
-
|
724
|
-
|
737
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
738
|
+
# @yieldparam response [::Gapic::Operation]
|
739
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
740
|
+
#
|
741
|
+
# @return [::Gapic::Operation]
|
742
|
+
#
|
743
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
744
|
+
#
|
745
|
+
# @example Basic example
|
746
|
+
# require "google/cloud/backupdr/v1"
|
747
|
+
#
|
748
|
+
# # Create a client object. The client can be reused for multiple calls.
|
749
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
750
|
+
#
|
751
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
752
|
+
# request = Google::Cloud::BackupDR::V1::CreateBackupVaultRequest.new
|
753
|
+
#
|
754
|
+
# # Call the create_backup_vault method.
|
755
|
+
# result = client.create_backup_vault request
|
756
|
+
#
|
757
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
758
|
+
# # check the status of an operation, cancel it, or wait for results.
|
759
|
+
# # Here is how to wait for a response.
|
760
|
+
# result.wait_until_done! timeout: 60
|
761
|
+
# if result.response?
|
762
|
+
# p result.response
|
763
|
+
# else
|
764
|
+
# puts "No response received."
|
765
|
+
# end
|
766
|
+
#
|
767
|
+
def create_backup_vault request, options = nil
|
768
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
725
769
|
|
726
|
-
|
727
|
-
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
728
|
-
DEFAULT_ENDPOINT = "backupdr.googleapis.com"
|
770
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateBackupVaultRequest
|
729
771
|
|
730
|
-
|
731
|
-
|
732
|
-
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
733
|
-
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
734
|
-
allowed.any? { |klass| klass === value }
|
735
|
-
end
|
736
|
-
config_attr :scope, nil, ::String, ::Array, nil
|
737
|
-
config_attr :lib_name, nil, ::String, nil
|
738
|
-
config_attr :lib_version, nil, ::String, nil
|
739
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
740
|
-
config_attr :interceptors, nil, ::Array, nil
|
741
|
-
config_attr :timeout, nil, ::Numeric, nil
|
742
|
-
config_attr :metadata, nil, ::Hash, nil
|
743
|
-
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
744
|
-
config_attr :quota_project, nil, ::String, nil
|
745
|
-
config_attr :universe_domain, nil, ::String, nil
|
772
|
+
# Converts hash and nil to an options object
|
773
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
746
774
|
|
747
|
-
#
|
748
|
-
|
749
|
-
@parent_config = parent_config unless parent_config.nil?
|
775
|
+
# Customize the options with defaults
|
776
|
+
metadata = @config.rpcs.create_backup_vault.metadata.to_h
|
750
777
|
|
751
|
-
|
752
|
-
|
778
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
779
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
780
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
781
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
782
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
783
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
753
784
|
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
#
|
758
|
-
def rpcs
|
759
|
-
@rpcs ||= begin
|
760
|
-
parent_rpcs = nil
|
761
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
762
|
-
Rpcs.new parent_rpcs
|
763
|
-
end
|
785
|
+
header_params = {}
|
786
|
+
if request.parent
|
787
|
+
header_params["parent"] = request.parent
|
764
788
|
end
|
765
789
|
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
790
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
791
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
792
|
+
|
793
|
+
options.apply_defaults timeout: @config.rpcs.create_backup_vault.timeout,
|
794
|
+
metadata: metadata,
|
795
|
+
retry_policy: @config.rpcs.create_backup_vault.retry_policy
|
796
|
+
|
797
|
+
options.apply_defaults timeout: @config.timeout,
|
798
|
+
metadata: @config.metadata,
|
799
|
+
retry_policy: @config.retry_policy
|
800
|
+
|
801
|
+
@backup_dr_stub.call_rpc :create_backup_vault, request, options: options do |response, operation|
|
802
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
803
|
+
yield response, operation if block_given?
|
804
|
+
return response
|
772
805
|
end
|
806
|
+
rescue ::GRPC::BadStatus => e
|
807
|
+
raise ::Google::Cloud::Error.from_error(e)
|
808
|
+
end
|
773
809
|
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
810
|
+
##
|
811
|
+
# Lists BackupVaults in a given project and location.
|
812
|
+
#
|
813
|
+
# @overload list_backup_vaults(request, options = nil)
|
814
|
+
# Pass arguments to `list_backup_vaults` via a request object, either of type
|
815
|
+
# {::Google::Cloud::BackupDR::V1::ListBackupVaultsRequest} or an equivalent Hash.
|
816
|
+
#
|
817
|
+
# @param request [::Google::Cloud::BackupDR::V1::ListBackupVaultsRequest, ::Hash]
|
818
|
+
# A request object representing the call parameters. Required. To specify no
|
819
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
820
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
821
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
822
|
+
#
|
823
|
+
# @overload list_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil)
|
824
|
+
# Pass arguments to `list_backup_vaults` via keyword arguments. Note that at
|
825
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
826
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
827
|
+
#
|
828
|
+
# @param parent [::String]
|
829
|
+
# Required. The project and location for which to retrieve backupvault stores
|
830
|
+
# information, in the format 'projects/\\{project_id}/locations/\\{location}'. In
|
831
|
+
# Cloud Backup and DR, locations map to Google Cloud regions, for example
|
832
|
+
# **us-central1**.
|
833
|
+
# To retrieve backupvault stores for all locations, use "-" for the
|
834
|
+
# '\\{location}' value.
|
835
|
+
# @param page_size [::Integer]
|
836
|
+
# Optional. Requested page size. Server may return fewer items than
|
837
|
+
# requested. If unspecified, server will pick an appropriate default.
|
838
|
+
# @param page_token [::String]
|
839
|
+
# Optional. A token identifying a page of results the server should return.
|
840
|
+
# @param filter [::String]
|
841
|
+
# Optional. Filtering results.
|
842
|
+
# @param order_by [::String]
|
843
|
+
# Optional. Hint for how to order the results.
|
844
|
+
# @param view [::Google::Cloud::BackupDR::V1::BackupVaultView]
|
845
|
+
# Optional. Reserved for future use to provide a BASIC & FULL view of Backup
|
846
|
+
# Vault.
|
847
|
+
#
|
848
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
849
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>]
|
850
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
851
|
+
#
|
852
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>]
|
853
|
+
#
|
854
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
855
|
+
#
|
856
|
+
# @example Basic example
|
857
|
+
# require "google/cloud/backupdr/v1"
|
858
|
+
#
|
859
|
+
# # Create a client object. The client can be reused for multiple calls.
|
860
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
861
|
+
#
|
862
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
863
|
+
# request = Google::Cloud::BackupDR::V1::ListBackupVaultsRequest.new
|
864
|
+
#
|
865
|
+
# # Call the list_backup_vaults method.
|
866
|
+
# result = client.list_backup_vaults request
|
867
|
+
#
|
868
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
869
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
870
|
+
# result.each do |item|
|
871
|
+
# # Each element is of type ::Google::Cloud::BackupDR::V1::BackupVault.
|
872
|
+
# p item
|
873
|
+
# end
|
874
|
+
#
|
875
|
+
def list_backup_vaults request, options = nil
|
876
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
877
|
+
|
878
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupVaultsRequest
|
879
|
+
|
880
|
+
# Converts hash and nil to an options object
|
881
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
882
|
+
|
883
|
+
# Customize the options with defaults
|
884
|
+
metadata = @config.rpcs.list_backup_vaults.metadata.to_h
|
885
|
+
|
886
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
887
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
888
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
889
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
890
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
891
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
892
|
+
|
893
|
+
header_params = {}
|
894
|
+
if request.parent
|
895
|
+
header_params["parent"] = request.parent
|
896
|
+
end
|
897
|
+
|
898
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
899
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
900
|
+
|
901
|
+
options.apply_defaults timeout: @config.rpcs.list_backup_vaults.timeout,
|
902
|
+
metadata: metadata,
|
903
|
+
retry_policy: @config.rpcs.list_backup_vaults.retry_policy
|
904
|
+
|
905
|
+
options.apply_defaults timeout: @config.timeout,
|
906
|
+
metadata: @config.metadata,
|
907
|
+
retry_policy: @config.retry_policy
|
908
|
+
|
909
|
+
@backup_dr_stub.call_rpc :list_backup_vaults, request, options: options do |response, operation|
|
910
|
+
response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backup_vaults, request, response, operation, options
|
911
|
+
yield response, operation if block_given?
|
912
|
+
return response
|
913
|
+
end
|
914
|
+
rescue ::GRPC::BadStatus => e
|
915
|
+
raise ::Google::Cloud::Error.from_error(e)
|
916
|
+
end
|
917
|
+
|
918
|
+
##
|
919
|
+
# FetchUsableBackupVaults lists usable BackupVaults in a given project and
|
920
|
+
# location. Usable BackupVault are the ones that user has
|
921
|
+
# backupdr.backupVaults.get permission.
|
922
|
+
#
|
923
|
+
# @overload fetch_usable_backup_vaults(request, options = nil)
|
924
|
+
# Pass arguments to `fetch_usable_backup_vaults` via a request object, either of type
|
925
|
+
# {::Google::Cloud::BackupDR::V1::FetchUsableBackupVaultsRequest} or an equivalent Hash.
|
926
|
+
#
|
927
|
+
# @param request [::Google::Cloud::BackupDR::V1::FetchUsableBackupVaultsRequest, ::Hash]
|
928
|
+
# A request object representing the call parameters. Required. To specify no
|
929
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
930
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
931
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
932
|
+
#
|
933
|
+
# @overload fetch_usable_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
934
|
+
# Pass arguments to `fetch_usable_backup_vaults` via keyword arguments. Note that at
|
935
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
936
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
937
|
+
#
|
938
|
+
# @param parent [::String]
|
939
|
+
# Required. The project and location for which to retrieve backupvault stores
|
940
|
+
# information, in the format 'projects/\\{project_id}/locations/\\{location}'. In
|
941
|
+
# Cloud Backup and DR, locations map to Google Cloud regions, for example
|
942
|
+
# **us-central1**.
|
943
|
+
# To retrieve backupvault stores for all locations, use "-" for the
|
944
|
+
# '\\{location}' value.
|
945
|
+
# @param page_size [::Integer]
|
946
|
+
# Optional. Requested page size. Server may return fewer items than
|
947
|
+
# requested. If unspecified, server will pick an appropriate default.
|
948
|
+
# @param page_token [::String]
|
949
|
+
# Optional. A token identifying a page of results the server should return.
|
950
|
+
# @param filter [::String]
|
951
|
+
# Optional. Filtering results.
|
952
|
+
# @param order_by [::String]
|
953
|
+
# Optional. Hint for how to order the results.
|
954
|
+
#
|
955
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
956
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>]
|
957
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
958
|
+
#
|
959
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>]
|
960
|
+
#
|
961
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
962
|
+
#
|
963
|
+
# @example Basic example
|
964
|
+
# require "google/cloud/backupdr/v1"
|
965
|
+
#
|
966
|
+
# # Create a client object. The client can be reused for multiple calls.
|
967
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
968
|
+
#
|
969
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
970
|
+
# request = Google::Cloud::BackupDR::V1::FetchUsableBackupVaultsRequest.new
|
971
|
+
#
|
972
|
+
# # Call the fetch_usable_backup_vaults method.
|
973
|
+
# result = client.fetch_usable_backup_vaults request
|
974
|
+
#
|
975
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
976
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
977
|
+
# result.each do |item|
|
978
|
+
# # Each element is of type ::Google::Cloud::BackupDR::V1::BackupVault.
|
979
|
+
# p item
|
980
|
+
# end
|
981
|
+
#
|
982
|
+
def fetch_usable_backup_vaults request, options = nil
|
983
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
984
|
+
|
985
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::FetchUsableBackupVaultsRequest
|
986
|
+
|
987
|
+
# Converts hash and nil to an options object
|
988
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
989
|
+
|
990
|
+
# Customize the options with defaults
|
991
|
+
metadata = @config.rpcs.fetch_usable_backup_vaults.metadata.to_h
|
992
|
+
|
993
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
994
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
995
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
996
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
997
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
998
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
999
|
+
|
1000
|
+
header_params = {}
|
1001
|
+
if request.parent
|
1002
|
+
header_params["parent"] = request.parent
|
1003
|
+
end
|
1004
|
+
|
1005
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1006
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1007
|
+
|
1008
|
+
options.apply_defaults timeout: @config.rpcs.fetch_usable_backup_vaults.timeout,
|
1009
|
+
metadata: metadata,
|
1010
|
+
retry_policy: @config.rpcs.fetch_usable_backup_vaults.retry_policy
|
1011
|
+
|
1012
|
+
options.apply_defaults timeout: @config.timeout,
|
1013
|
+
metadata: @config.metadata,
|
1014
|
+
retry_policy: @config.retry_policy
|
1015
|
+
|
1016
|
+
@backup_dr_stub.call_rpc :fetch_usable_backup_vaults, request, options: options do |response, operation|
|
1017
|
+
response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :fetch_usable_backup_vaults, request, response, operation, options
|
1018
|
+
yield response, operation if block_given?
|
1019
|
+
return response
|
1020
|
+
end
|
1021
|
+
rescue ::GRPC::BadStatus => e
|
1022
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
##
|
1026
|
+
# Gets details of a BackupVault.
|
1027
|
+
#
|
1028
|
+
# @overload get_backup_vault(request, options = nil)
|
1029
|
+
# Pass arguments to `get_backup_vault` via a request object, either of type
|
1030
|
+
# {::Google::Cloud::BackupDR::V1::GetBackupVaultRequest} or an equivalent Hash.
|
1031
|
+
#
|
1032
|
+
# @param request [::Google::Cloud::BackupDR::V1::GetBackupVaultRequest, ::Hash]
|
1033
|
+
# A request object representing the call parameters. Required. To specify no
|
1034
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1035
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1036
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1037
|
+
#
|
1038
|
+
# @overload get_backup_vault(name: nil, view: nil)
|
1039
|
+
# Pass arguments to `get_backup_vault` via keyword arguments. Note that at
|
1040
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1041
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1042
|
+
#
|
1043
|
+
# @param name [::String]
|
1044
|
+
# Required. Name of the backupvault store resource name, in the format
|
1045
|
+
# 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{resource_name}'
|
1046
|
+
# @param view [::Google::Cloud::BackupDR::V1::BackupVaultView]
|
1047
|
+
# Optional. Reserved for future use to provide a BASIC & FULL view of Backup
|
1048
|
+
# Vault
|
1049
|
+
#
|
1050
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1051
|
+
# @yieldparam response [::Google::Cloud::BackupDR::V1::BackupVault]
|
1052
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1053
|
+
#
|
1054
|
+
# @return [::Google::Cloud::BackupDR::V1::BackupVault]
|
1055
|
+
#
|
1056
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1057
|
+
#
|
1058
|
+
# @example Basic example
|
1059
|
+
# require "google/cloud/backupdr/v1"
|
1060
|
+
#
|
1061
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1062
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
1063
|
+
#
|
1064
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1065
|
+
# request = Google::Cloud::BackupDR::V1::GetBackupVaultRequest.new
|
1066
|
+
#
|
1067
|
+
# # Call the get_backup_vault method.
|
1068
|
+
# result = client.get_backup_vault request
|
1069
|
+
#
|
1070
|
+
# # The returned object is of type Google::Cloud::BackupDR::V1::BackupVault.
|
1071
|
+
# p result
|
1072
|
+
#
|
1073
|
+
def get_backup_vault request, options = nil
|
1074
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1075
|
+
|
1076
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupVaultRequest
|
1077
|
+
|
1078
|
+
# Converts hash and nil to an options object
|
1079
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1080
|
+
|
1081
|
+
# Customize the options with defaults
|
1082
|
+
metadata = @config.rpcs.get_backup_vault.metadata.to_h
|
1083
|
+
|
1084
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1085
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1086
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1087
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
1088
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1089
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1090
|
+
|
1091
|
+
header_params = {}
|
1092
|
+
if request.name
|
1093
|
+
header_params["name"] = request.name
|
1094
|
+
end
|
1095
|
+
|
1096
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1097
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1098
|
+
|
1099
|
+
options.apply_defaults timeout: @config.rpcs.get_backup_vault.timeout,
|
1100
|
+
metadata: metadata,
|
1101
|
+
retry_policy: @config.rpcs.get_backup_vault.retry_policy
|
1102
|
+
|
1103
|
+
options.apply_defaults timeout: @config.timeout,
|
1104
|
+
metadata: @config.metadata,
|
1105
|
+
retry_policy: @config.retry_policy
|
1106
|
+
|
1107
|
+
@backup_dr_stub.call_rpc :get_backup_vault, request, options: options do |response, operation|
|
1108
|
+
yield response, operation if block_given?
|
1109
|
+
return response
|
1110
|
+
end
|
1111
|
+
rescue ::GRPC::BadStatus => e
|
1112
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1113
|
+
end
|
1114
|
+
|
1115
|
+
##
|
1116
|
+
# Updates the settings of a BackupVault.
|
1117
|
+
#
|
1118
|
+
# @overload update_backup_vault(request, options = nil)
|
1119
|
+
# Pass arguments to `update_backup_vault` via a request object, either of type
|
1120
|
+
# {::Google::Cloud::BackupDR::V1::UpdateBackupVaultRequest} or an equivalent Hash.
|
1121
|
+
#
|
1122
|
+
# @param request [::Google::Cloud::BackupDR::V1::UpdateBackupVaultRequest, ::Hash]
|
1123
|
+
# A request object representing the call parameters. Required. To specify no
|
1124
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1125
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1126
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1127
|
+
#
|
1128
|
+
# @overload update_backup_vault(update_mask: nil, backup_vault: nil, request_id: nil, validate_only: nil, force: nil)
|
1129
|
+
# Pass arguments to `update_backup_vault` via keyword arguments. Note that at
|
1130
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1131
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1132
|
+
#
|
1133
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1134
|
+
# Required. Field mask is used to specify the fields to be overwritten in the
|
1135
|
+
# BackupVault resource by the update.
|
1136
|
+
# The fields specified in the update_mask are relative to the resource, not
|
1137
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
1138
|
+
# user does not provide a mask then the request will fail.
|
1139
|
+
# @param backup_vault [::Google::Cloud::BackupDR::V1::BackupVault, ::Hash]
|
1140
|
+
# Required. The resource being updated
|
1141
|
+
# @param request_id [::String]
|
1142
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1143
|
+
# request ID so that if you must retry your request, the server will know to
|
1144
|
+
# ignore the request if it has already been completed. The server will
|
1145
|
+
# guarantee that for at least 60 minutes since the first request.
|
1146
|
+
#
|
1147
|
+
# For example, consider a situation where you make an initial request and
|
1148
|
+
# the request times out. If you make the request again with the same request
|
1149
|
+
# ID, the server can check if original operation with the same request ID
|
1150
|
+
# was received, and if so, will ignore the second request. This prevents
|
1151
|
+
# clients from accidentally creating duplicate commitments.
|
1152
|
+
#
|
1153
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1154
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1155
|
+
# @param validate_only [::Boolean]
|
1156
|
+
# Optional. Only validate the request, but do not perform mutations.
|
1157
|
+
# The default is 'false'.
|
1158
|
+
# @param force [::Boolean]
|
1159
|
+
# Optional. If set to true, will not check plan duration against backup vault
|
1160
|
+
# enforcement duration.
|
1161
|
+
#
|
1162
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1163
|
+
# @yieldparam response [::Gapic::Operation]
|
1164
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1165
|
+
#
|
1166
|
+
# @return [::Gapic::Operation]
|
1167
|
+
#
|
1168
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1169
|
+
#
|
1170
|
+
# @example Basic example
|
1171
|
+
# require "google/cloud/backupdr/v1"
|
1172
|
+
#
|
1173
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1174
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
1175
|
+
#
|
1176
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1177
|
+
# request = Google::Cloud::BackupDR::V1::UpdateBackupVaultRequest.new
|
1178
|
+
#
|
1179
|
+
# # Call the update_backup_vault method.
|
1180
|
+
# result = client.update_backup_vault request
|
1181
|
+
#
|
1182
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1183
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1184
|
+
# # Here is how to wait for a response.
|
1185
|
+
# result.wait_until_done! timeout: 60
|
1186
|
+
# if result.response?
|
1187
|
+
# p result.response
|
1188
|
+
# else
|
1189
|
+
# puts "No response received."
|
1190
|
+
# end
|
1191
|
+
#
|
1192
|
+
def update_backup_vault request, options = nil
|
1193
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1194
|
+
|
1195
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateBackupVaultRequest
|
1196
|
+
|
1197
|
+
# Converts hash and nil to an options object
|
1198
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1199
|
+
|
1200
|
+
# Customize the options with defaults
|
1201
|
+
metadata = @config.rpcs.update_backup_vault.metadata.to_h
|
1202
|
+
|
1203
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1204
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1205
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1206
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
1207
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1208
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1209
|
+
|
1210
|
+
header_params = {}
|
1211
|
+
if request.backup_vault&.name
|
1212
|
+
header_params["backup_vault.name"] = request.backup_vault.name
|
1213
|
+
end
|
1214
|
+
|
1215
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1216
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1217
|
+
|
1218
|
+
options.apply_defaults timeout: @config.rpcs.update_backup_vault.timeout,
|
1219
|
+
metadata: metadata,
|
1220
|
+
retry_policy: @config.rpcs.update_backup_vault.retry_policy
|
1221
|
+
|
1222
|
+
options.apply_defaults timeout: @config.timeout,
|
1223
|
+
metadata: @config.metadata,
|
1224
|
+
retry_policy: @config.retry_policy
|
1225
|
+
|
1226
|
+
@backup_dr_stub.call_rpc :update_backup_vault, request, options: options do |response, operation|
|
1227
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1228
|
+
yield response, operation if block_given?
|
1229
|
+
return response
|
1230
|
+
end
|
1231
|
+
rescue ::GRPC::BadStatus => e
|
1232
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1233
|
+
end
|
1234
|
+
|
1235
|
+
##
|
1236
|
+
# Deletes a BackupVault.
|
1237
|
+
#
|
1238
|
+
# @overload delete_backup_vault(request, options = nil)
|
1239
|
+
# Pass arguments to `delete_backup_vault` via a request object, either of type
|
1240
|
+
# {::Google::Cloud::BackupDR::V1::DeleteBackupVaultRequest} or an equivalent Hash.
|
1241
|
+
#
|
1242
|
+
# @param request [::Google::Cloud::BackupDR::V1::DeleteBackupVaultRequest, ::Hash]
|
1243
|
+
# A request object representing the call parameters. Required. To specify no
|
1244
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1245
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1246
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1247
|
+
#
|
1248
|
+
# @overload delete_backup_vault(name: nil, request_id: nil, force: nil, etag: nil, validate_only: nil, allow_missing: nil)
|
1249
|
+
# Pass arguments to `delete_backup_vault` via keyword arguments. Note that at
|
1250
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1251
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1252
|
+
#
|
1253
|
+
# @param name [::String]
|
1254
|
+
# Required. Name of the resource.
|
1255
|
+
# @param request_id [::String]
|
1256
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1257
|
+
# request ID so that if you must retry your request, the server will know to
|
1258
|
+
# ignore the request if it has already been completed. The server will
|
1259
|
+
# guarantee that for at least 60 minutes after the first request.
|
1260
|
+
#
|
1261
|
+
# For example, consider a situation where you make an initial request and
|
1262
|
+
# the request times out. If you make the request again with the same request
|
1263
|
+
# ID, the server can check if original operation with the same request ID
|
1264
|
+
# was received, and if so, will ignore the second request. This prevents
|
1265
|
+
# clients from accidentally creating duplicate commitments.
|
1266
|
+
#
|
1267
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1268
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1269
|
+
# @param force [::Boolean]
|
1270
|
+
# Optional. If set to true, any data source from this backup vault will also
|
1271
|
+
# be deleted.
|
1272
|
+
# @param etag [::String]
|
1273
|
+
# The current etag of the backup vault.
|
1274
|
+
# If an etag is provided and does not match the current etag of the
|
1275
|
+
# connection, deletion will be blocked.
|
1276
|
+
# @param validate_only [::Boolean]
|
1277
|
+
# Optional. Only validate the request, but do not perform mutations.
|
1278
|
+
# The default is 'false'.
|
1279
|
+
# @param allow_missing [::Boolean]
|
1280
|
+
# Optional. If true and the BackupVault is not found, the request will
|
1281
|
+
# succeed but no action will be taken.
|
1282
|
+
#
|
1283
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1284
|
+
# @yieldparam response [::Gapic::Operation]
|
1285
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1286
|
+
#
|
1287
|
+
# @return [::Gapic::Operation]
|
1288
|
+
#
|
1289
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1290
|
+
#
|
1291
|
+
# @example Basic example
|
1292
|
+
# require "google/cloud/backupdr/v1"
|
1293
|
+
#
|
1294
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1295
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
1296
|
+
#
|
1297
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1298
|
+
# request = Google::Cloud::BackupDR::V1::DeleteBackupVaultRequest.new
|
1299
|
+
#
|
1300
|
+
# # Call the delete_backup_vault method.
|
1301
|
+
# result = client.delete_backup_vault request
|
1302
|
+
#
|
1303
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1304
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1305
|
+
# # Here is how to wait for a response.
|
1306
|
+
# result.wait_until_done! timeout: 60
|
1307
|
+
# if result.response?
|
1308
|
+
# p result.response
|
1309
|
+
# else
|
1310
|
+
# puts "No response received."
|
1311
|
+
# end
|
1312
|
+
#
|
1313
|
+
def delete_backup_vault request, options = nil
|
1314
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1315
|
+
|
1316
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteBackupVaultRequest
|
1317
|
+
|
1318
|
+
# Converts hash and nil to an options object
|
1319
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1320
|
+
|
1321
|
+
# Customize the options with defaults
|
1322
|
+
metadata = @config.rpcs.delete_backup_vault.metadata.to_h
|
1323
|
+
|
1324
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1325
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1326
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1327
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
1328
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1329
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1330
|
+
|
1331
|
+
header_params = {}
|
1332
|
+
if request.name
|
1333
|
+
header_params["name"] = request.name
|
1334
|
+
end
|
1335
|
+
|
1336
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1337
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1338
|
+
|
1339
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup_vault.timeout,
|
1340
|
+
metadata: metadata,
|
1341
|
+
retry_policy: @config.rpcs.delete_backup_vault.retry_policy
|
1342
|
+
|
1343
|
+
options.apply_defaults timeout: @config.timeout,
|
1344
|
+
metadata: @config.metadata,
|
1345
|
+
retry_policy: @config.retry_policy
|
1346
|
+
|
1347
|
+
@backup_dr_stub.call_rpc :delete_backup_vault, request, options: options do |response, operation|
|
1348
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1349
|
+
yield response, operation if block_given?
|
1350
|
+
return response
|
1351
|
+
end
|
1352
|
+
rescue ::GRPC::BadStatus => e
|
1353
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1354
|
+
end
|
1355
|
+
|
1356
|
+
##
|
1357
|
+
# Lists DataSources in a given project and location.
|
1358
|
+
#
|
1359
|
+
# @overload list_data_sources(request, options = nil)
|
1360
|
+
# Pass arguments to `list_data_sources` via a request object, either of type
|
1361
|
+
# {::Google::Cloud::BackupDR::V1::ListDataSourcesRequest} or an equivalent Hash.
|
1362
|
+
#
|
1363
|
+
# @param request [::Google::Cloud::BackupDR::V1::ListDataSourcesRequest, ::Hash]
|
1364
|
+
# A request object representing the call parameters. Required. To specify no
|
1365
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1366
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1367
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1368
|
+
#
|
1369
|
+
# @overload list_data_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
1370
|
+
# Pass arguments to `list_data_sources` via keyword arguments. Note that at
|
1371
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1372
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1373
|
+
#
|
1374
|
+
# @param parent [::String]
|
1375
|
+
# Required. The project and location for which to retrieve data
|
1376
|
+
# sources information, in the format
|
1377
|
+
# 'projects/\\{project_id}/locations/\\{location}'. In Cloud Backup and DR,
|
1378
|
+
# locations map to Google Cloud regions, for example **us-central1**.
|
1379
|
+
# To retrieve data sources for all locations, use "-" for the
|
1380
|
+
# '\\{location}' value.
|
1381
|
+
# @param page_size [::Integer]
|
1382
|
+
# Optional. Requested page size. Server may return fewer items than
|
1383
|
+
# requested. If unspecified, server will pick an appropriate default.
|
1384
|
+
# @param page_token [::String]
|
1385
|
+
# Optional. A token identifying a page of results the server should return.
|
1386
|
+
# @param filter [::String]
|
1387
|
+
# Optional. Filtering results.
|
1388
|
+
# @param order_by [::String]
|
1389
|
+
# Optional. Hint for how to order the results.
|
1390
|
+
#
|
1391
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1392
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSource>]
|
1393
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1394
|
+
#
|
1395
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSource>]
|
1396
|
+
#
|
1397
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1398
|
+
#
|
1399
|
+
# @example Basic example
|
1400
|
+
# require "google/cloud/backupdr/v1"
|
1401
|
+
#
|
1402
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1403
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
1404
|
+
#
|
1405
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1406
|
+
# request = Google::Cloud::BackupDR::V1::ListDataSourcesRequest.new
|
1407
|
+
#
|
1408
|
+
# # Call the list_data_sources method.
|
1409
|
+
# result = client.list_data_sources request
|
1410
|
+
#
|
1411
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1412
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1413
|
+
# result.each do |item|
|
1414
|
+
# # Each element is of type ::Google::Cloud::BackupDR::V1::DataSource.
|
1415
|
+
# p item
|
1416
|
+
# end
|
1417
|
+
#
|
1418
|
+
def list_data_sources request, options = nil
|
1419
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1420
|
+
|
1421
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListDataSourcesRequest
|
1422
|
+
|
1423
|
+
# Converts hash and nil to an options object
|
1424
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1425
|
+
|
1426
|
+
# Customize the options with defaults
|
1427
|
+
metadata = @config.rpcs.list_data_sources.metadata.to_h
|
1428
|
+
|
1429
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1430
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1431
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1432
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
1433
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1434
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1435
|
+
|
1436
|
+
header_params = {}
|
1437
|
+
if request.parent
|
1438
|
+
header_params["parent"] = request.parent
|
1439
|
+
end
|
1440
|
+
|
1441
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1442
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1443
|
+
|
1444
|
+
options.apply_defaults timeout: @config.rpcs.list_data_sources.timeout,
|
1445
|
+
metadata: metadata,
|
1446
|
+
retry_policy: @config.rpcs.list_data_sources.retry_policy
|
1447
|
+
|
1448
|
+
options.apply_defaults timeout: @config.timeout,
|
1449
|
+
metadata: @config.metadata,
|
1450
|
+
retry_policy: @config.retry_policy
|
1451
|
+
|
1452
|
+
@backup_dr_stub.call_rpc :list_data_sources, request, options: options do |response, operation|
|
1453
|
+
response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_data_sources, request, response, operation, options
|
1454
|
+
yield response, operation if block_given?
|
1455
|
+
return response
|
1456
|
+
end
|
1457
|
+
rescue ::GRPC::BadStatus => e
|
1458
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1459
|
+
end
|
1460
|
+
|
1461
|
+
##
|
1462
|
+
# Gets details of a DataSource.
|
1463
|
+
#
|
1464
|
+
# @overload get_data_source(request, options = nil)
|
1465
|
+
# Pass arguments to `get_data_source` via a request object, either of type
|
1466
|
+
# {::Google::Cloud::BackupDR::V1::GetDataSourceRequest} or an equivalent Hash.
|
1467
|
+
#
|
1468
|
+
# @param request [::Google::Cloud::BackupDR::V1::GetDataSourceRequest, ::Hash]
|
1469
|
+
# A request object representing the call parameters. Required. To specify no
|
1470
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1471
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1472
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1473
|
+
#
|
1474
|
+
# @overload get_data_source(name: nil)
|
1475
|
+
# Pass arguments to `get_data_source` via keyword arguments. Note that at
|
1476
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1477
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1478
|
+
#
|
1479
|
+
# @param name [::String]
|
1480
|
+
# Required. Name of the data source resource name, in the format
|
1481
|
+
# 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{resource_name}/dataSource/\\{resource_name}'
|
1482
|
+
#
|
1483
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1484
|
+
# @yieldparam response [::Google::Cloud::BackupDR::V1::DataSource]
|
1485
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1486
|
+
#
|
1487
|
+
# @return [::Google::Cloud::BackupDR::V1::DataSource]
|
1488
|
+
#
|
1489
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1490
|
+
#
|
1491
|
+
# @example Basic example
|
1492
|
+
# require "google/cloud/backupdr/v1"
|
1493
|
+
#
|
1494
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1495
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
1496
|
+
#
|
1497
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1498
|
+
# request = Google::Cloud::BackupDR::V1::GetDataSourceRequest.new
|
1499
|
+
#
|
1500
|
+
# # Call the get_data_source method.
|
1501
|
+
# result = client.get_data_source request
|
1502
|
+
#
|
1503
|
+
# # The returned object is of type Google::Cloud::BackupDR::V1::DataSource.
|
1504
|
+
# p result
|
1505
|
+
#
|
1506
|
+
def get_data_source request, options = nil
|
1507
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1508
|
+
|
1509
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetDataSourceRequest
|
1510
|
+
|
1511
|
+
# Converts hash and nil to an options object
|
1512
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1513
|
+
|
1514
|
+
# Customize the options with defaults
|
1515
|
+
metadata = @config.rpcs.get_data_source.metadata.to_h
|
1516
|
+
|
1517
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1518
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1519
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1520
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
1521
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1522
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1523
|
+
|
1524
|
+
header_params = {}
|
1525
|
+
if request.name
|
1526
|
+
header_params["name"] = request.name
|
1527
|
+
end
|
1528
|
+
|
1529
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1530
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1531
|
+
|
1532
|
+
options.apply_defaults timeout: @config.rpcs.get_data_source.timeout,
|
1533
|
+
metadata: metadata,
|
1534
|
+
retry_policy: @config.rpcs.get_data_source.retry_policy
|
1535
|
+
|
1536
|
+
options.apply_defaults timeout: @config.timeout,
|
1537
|
+
metadata: @config.metadata,
|
1538
|
+
retry_policy: @config.retry_policy
|
1539
|
+
|
1540
|
+
@backup_dr_stub.call_rpc :get_data_source, request, options: options do |response, operation|
|
1541
|
+
yield response, operation if block_given?
|
1542
|
+
return response
|
1543
|
+
end
|
1544
|
+
rescue ::GRPC::BadStatus => e
|
1545
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1546
|
+
end
|
1547
|
+
|
1548
|
+
##
|
1549
|
+
# Updates the settings of a DataSource.
|
1550
|
+
#
|
1551
|
+
# @overload update_data_source(request, options = nil)
|
1552
|
+
# Pass arguments to `update_data_source` via a request object, either of type
|
1553
|
+
# {::Google::Cloud::BackupDR::V1::UpdateDataSourceRequest} or an equivalent Hash.
|
1554
|
+
#
|
1555
|
+
# @param request [::Google::Cloud::BackupDR::V1::UpdateDataSourceRequest, ::Hash]
|
1556
|
+
# A request object representing the call parameters. Required. To specify no
|
1557
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1558
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1559
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1560
|
+
#
|
1561
|
+
# @overload update_data_source(update_mask: nil, data_source: nil, request_id: nil, allow_missing: nil)
|
1562
|
+
# Pass arguments to `update_data_source` via keyword arguments. Note that at
|
1563
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1564
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1565
|
+
#
|
1566
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1567
|
+
# Required. Field mask is used to specify the fields to be overwritten in the
|
1568
|
+
# DataSource resource by the update.
|
1569
|
+
# The fields specified in the update_mask are relative to the resource, not
|
1570
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
1571
|
+
# user does not provide a mask then the request will fail.
|
1572
|
+
# @param data_source [::Google::Cloud::BackupDR::V1::DataSource, ::Hash]
|
1573
|
+
# Required. The resource being updated
|
1574
|
+
# @param request_id [::String]
|
1575
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1576
|
+
# request ID so that if you must retry your request, the server will know to
|
1577
|
+
# ignore the request if it has already been completed. The server will
|
1578
|
+
# guarantee that for at least 60 minutes since the first request.
|
1579
|
+
#
|
1580
|
+
# For example, consider a situation where you make an initial request and
|
1581
|
+
# the request times out. If you make the request again with the same request
|
1582
|
+
# ID, the server can check if original operation with the same request ID
|
1583
|
+
# was received, and if so, will ignore the second request. This prevents
|
1584
|
+
# clients from accidentally creating duplicate commitments.
|
1585
|
+
#
|
1586
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1587
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1588
|
+
# @param allow_missing [::Boolean]
|
1589
|
+
# Optional. Enable upsert.
|
1590
|
+
#
|
1591
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1592
|
+
# @yieldparam response [::Gapic::Operation]
|
1593
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1594
|
+
#
|
1595
|
+
# @return [::Gapic::Operation]
|
1596
|
+
#
|
1597
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1598
|
+
#
|
1599
|
+
# @example Basic example
|
1600
|
+
# require "google/cloud/backupdr/v1"
|
1601
|
+
#
|
1602
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1603
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
1604
|
+
#
|
1605
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1606
|
+
# request = Google::Cloud::BackupDR::V1::UpdateDataSourceRequest.new
|
1607
|
+
#
|
1608
|
+
# # Call the update_data_source method.
|
1609
|
+
# result = client.update_data_source request
|
1610
|
+
#
|
1611
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1612
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1613
|
+
# # Here is how to wait for a response.
|
1614
|
+
# result.wait_until_done! timeout: 60
|
1615
|
+
# if result.response?
|
1616
|
+
# p result.response
|
1617
|
+
# else
|
1618
|
+
# puts "No response received."
|
1619
|
+
# end
|
1620
|
+
#
|
1621
|
+
def update_data_source request, options = nil
|
1622
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1623
|
+
|
1624
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateDataSourceRequest
|
1625
|
+
|
1626
|
+
# Converts hash and nil to an options object
|
1627
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1628
|
+
|
1629
|
+
# Customize the options with defaults
|
1630
|
+
metadata = @config.rpcs.update_data_source.metadata.to_h
|
1631
|
+
|
1632
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1633
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1634
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1635
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
1636
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1637
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1638
|
+
|
1639
|
+
header_params = {}
|
1640
|
+
if request.data_source&.name
|
1641
|
+
header_params["data_source.name"] = request.data_source.name
|
1642
|
+
end
|
1643
|
+
|
1644
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1645
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1646
|
+
|
1647
|
+
options.apply_defaults timeout: @config.rpcs.update_data_source.timeout,
|
1648
|
+
metadata: metadata,
|
1649
|
+
retry_policy: @config.rpcs.update_data_source.retry_policy
|
1650
|
+
|
1651
|
+
options.apply_defaults timeout: @config.timeout,
|
1652
|
+
metadata: @config.metadata,
|
1653
|
+
retry_policy: @config.retry_policy
|
1654
|
+
|
1655
|
+
@backup_dr_stub.call_rpc :update_data_source, request, options: options do |response, operation|
|
1656
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1657
|
+
yield response, operation if block_given?
|
1658
|
+
return response
|
1659
|
+
end
|
1660
|
+
rescue ::GRPC::BadStatus => e
|
1661
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1662
|
+
end
|
1663
|
+
|
1664
|
+
##
|
1665
|
+
# Lists Backups in a given project and location.
|
1666
|
+
#
|
1667
|
+
# @overload list_backups(request, options = nil)
|
1668
|
+
# Pass arguments to `list_backups` via a request object, either of type
|
1669
|
+
# {::Google::Cloud::BackupDR::V1::ListBackupsRequest} or an equivalent Hash.
|
1670
|
+
#
|
1671
|
+
# @param request [::Google::Cloud::BackupDR::V1::ListBackupsRequest, ::Hash]
|
1672
|
+
# A request object representing the call parameters. Required. To specify no
|
1673
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1674
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1675
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1676
|
+
#
|
1677
|
+
# @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil)
|
1678
|
+
# Pass arguments to `list_backups` via keyword arguments. Note that at
|
1679
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1680
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1681
|
+
#
|
1682
|
+
# @param parent [::String]
|
1683
|
+
# Required. The project and location for which to retrieve backup
|
1684
|
+
# information, in the format
|
1685
|
+
# 'projects/\\{project_id}/locations/\\{location}'. In Cloud Backup and DR,
|
1686
|
+
# locations map to Google Cloud regions, for example **us-central1**.
|
1687
|
+
# To retrieve data sources for all locations, use "-" for the
|
1688
|
+
# '\\{location}' value.
|
1689
|
+
# @param page_size [::Integer]
|
1690
|
+
# Optional. Requested page size. Server may return fewer items than
|
1691
|
+
# requested. If unspecified, server will pick an appropriate default.
|
1692
|
+
# @param page_token [::String]
|
1693
|
+
# Optional. A token identifying a page of results the server should return.
|
1694
|
+
# @param filter [::String]
|
1695
|
+
# Optional. Filtering results.
|
1696
|
+
# @param order_by [::String]
|
1697
|
+
# Optional. Hint for how to order the results.
|
1698
|
+
# @param view [::Google::Cloud::BackupDR::V1::BackupView]
|
1699
|
+
# Optional. Reserved for future use to provide a BASIC & FULL view of Backup
|
1700
|
+
# resource.
|
1701
|
+
#
|
1702
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1703
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>]
|
1704
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1705
|
+
#
|
1706
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>]
|
1707
|
+
#
|
1708
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1709
|
+
#
|
1710
|
+
# @example Basic example
|
1711
|
+
# require "google/cloud/backupdr/v1"
|
1712
|
+
#
|
1713
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1714
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
1715
|
+
#
|
1716
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1717
|
+
# request = Google::Cloud::BackupDR::V1::ListBackupsRequest.new
|
1718
|
+
#
|
1719
|
+
# # Call the list_backups method.
|
1720
|
+
# result = client.list_backups request
|
1721
|
+
#
|
1722
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1723
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1724
|
+
# result.each do |item|
|
1725
|
+
# # Each element is of type ::Google::Cloud::BackupDR::V1::Backup.
|
1726
|
+
# p item
|
1727
|
+
# end
|
1728
|
+
#
|
1729
|
+
def list_backups request, options = nil
|
1730
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1731
|
+
|
1732
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupsRequest
|
1733
|
+
|
1734
|
+
# Converts hash and nil to an options object
|
1735
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1736
|
+
|
1737
|
+
# Customize the options with defaults
|
1738
|
+
metadata = @config.rpcs.list_backups.metadata.to_h
|
1739
|
+
|
1740
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1741
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1742
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1743
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
1744
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1745
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1746
|
+
|
1747
|
+
header_params = {}
|
1748
|
+
if request.parent
|
1749
|
+
header_params["parent"] = request.parent
|
1750
|
+
end
|
1751
|
+
|
1752
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1753
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1754
|
+
|
1755
|
+
options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
|
1756
|
+
metadata: metadata,
|
1757
|
+
retry_policy: @config.rpcs.list_backups.retry_policy
|
1758
|
+
|
1759
|
+
options.apply_defaults timeout: @config.timeout,
|
1760
|
+
metadata: @config.metadata,
|
1761
|
+
retry_policy: @config.retry_policy
|
1762
|
+
|
1763
|
+
@backup_dr_stub.call_rpc :list_backups, request, options: options do |response, operation|
|
1764
|
+
response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backups, request, response, operation, options
|
1765
|
+
yield response, operation if block_given?
|
1766
|
+
return response
|
1767
|
+
end
|
1768
|
+
rescue ::GRPC::BadStatus => e
|
1769
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1770
|
+
end
|
1771
|
+
|
1772
|
+
##
|
1773
|
+
# Gets details of a Backup.
|
1774
|
+
#
|
1775
|
+
# @overload get_backup(request, options = nil)
|
1776
|
+
# Pass arguments to `get_backup` via a request object, either of type
|
1777
|
+
# {::Google::Cloud::BackupDR::V1::GetBackupRequest} or an equivalent Hash.
|
1778
|
+
#
|
1779
|
+
# @param request [::Google::Cloud::BackupDR::V1::GetBackupRequest, ::Hash]
|
1780
|
+
# A request object representing the call parameters. Required. To specify no
|
1781
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1782
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1783
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1784
|
+
#
|
1785
|
+
# @overload get_backup(name: nil, view: nil)
|
1786
|
+
# Pass arguments to `get_backup` via keyword arguments. Note that at
|
1787
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1788
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1789
|
+
#
|
1790
|
+
# @param name [::String]
|
1791
|
+
# Required. Name of the data source resource name, in the format
|
1792
|
+
# 'projects/\\{project_id}/locations/\\{location}/backupVaults/\\{backupVault}/dataSources/\\{datasource}/backups/\\{backup}'
|
1793
|
+
# @param view [::Google::Cloud::BackupDR::V1::BackupView]
|
1794
|
+
# Optional. Reserved for future use to provide a BASIC & FULL view of Backup
|
1795
|
+
# resource.
|
1796
|
+
#
|
1797
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1798
|
+
# @yieldparam response [::Google::Cloud::BackupDR::V1::Backup]
|
1799
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1800
|
+
#
|
1801
|
+
# @return [::Google::Cloud::BackupDR::V1::Backup]
|
1802
|
+
#
|
1803
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1804
|
+
#
|
1805
|
+
# @example Basic example
|
1806
|
+
# require "google/cloud/backupdr/v1"
|
1807
|
+
#
|
1808
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1809
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
1810
|
+
#
|
1811
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1812
|
+
# request = Google::Cloud::BackupDR::V1::GetBackupRequest.new
|
1813
|
+
#
|
1814
|
+
# # Call the get_backup method.
|
1815
|
+
# result = client.get_backup request
|
1816
|
+
#
|
1817
|
+
# # The returned object is of type Google::Cloud::BackupDR::V1::Backup.
|
1818
|
+
# p result
|
1819
|
+
#
|
1820
|
+
def get_backup request, options = nil
|
1821
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1822
|
+
|
1823
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupRequest
|
1824
|
+
|
1825
|
+
# Converts hash and nil to an options object
|
1826
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1827
|
+
|
1828
|
+
# Customize the options with defaults
|
1829
|
+
metadata = @config.rpcs.get_backup.metadata.to_h
|
1830
|
+
|
1831
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1832
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1833
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1834
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
1835
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1836
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1837
|
+
|
1838
|
+
header_params = {}
|
1839
|
+
if request.name
|
1840
|
+
header_params["name"] = request.name
|
1841
|
+
end
|
1842
|
+
|
1843
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1844
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1845
|
+
|
1846
|
+
options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
|
1847
|
+
metadata: metadata,
|
1848
|
+
retry_policy: @config.rpcs.get_backup.retry_policy
|
1849
|
+
|
1850
|
+
options.apply_defaults timeout: @config.timeout,
|
1851
|
+
metadata: @config.metadata,
|
1852
|
+
retry_policy: @config.retry_policy
|
1853
|
+
|
1854
|
+
@backup_dr_stub.call_rpc :get_backup, request, options: options do |response, operation|
|
1855
|
+
yield response, operation if block_given?
|
1856
|
+
return response
|
1857
|
+
end
|
1858
|
+
rescue ::GRPC::BadStatus => e
|
1859
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1860
|
+
end
|
1861
|
+
|
1862
|
+
##
|
1863
|
+
# Updates the settings of a Backup.
|
1864
|
+
#
|
1865
|
+
# @overload update_backup(request, options = nil)
|
1866
|
+
# Pass arguments to `update_backup` via a request object, either of type
|
1867
|
+
# {::Google::Cloud::BackupDR::V1::UpdateBackupRequest} or an equivalent Hash.
|
1868
|
+
#
|
1869
|
+
# @param request [::Google::Cloud::BackupDR::V1::UpdateBackupRequest, ::Hash]
|
1870
|
+
# A request object representing the call parameters. Required. To specify no
|
1871
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1872
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1873
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1874
|
+
#
|
1875
|
+
# @overload update_backup(update_mask: nil, backup: nil, request_id: nil)
|
1876
|
+
# Pass arguments to `update_backup` via keyword arguments. Note that at
|
1877
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1878
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1879
|
+
#
|
1880
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1881
|
+
# Required. Field mask is used to specify the fields to be overwritten in the
|
1882
|
+
# Backup resource by the update.
|
1883
|
+
# The fields specified in the update_mask are relative to the resource, not
|
1884
|
+
# the full request. A field will be overwritten if it is in the mask. If the
|
1885
|
+
# user does not provide a mask then the request will fail.
|
1886
|
+
# @param backup [::Google::Cloud::BackupDR::V1::Backup, ::Hash]
|
1887
|
+
# Required. The resource being updated
|
1888
|
+
# @param request_id [::String]
|
1889
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1890
|
+
# request ID so that if you must retry your request, the server will know to
|
1891
|
+
# ignore the request if it has already been completed. The server will
|
1892
|
+
# guarantee that for at least 60 minutes since the first request.
|
1893
|
+
#
|
1894
|
+
# For example, consider a situation where you make an initial request and
|
1895
|
+
# the request times out. If you make the request again with the same request
|
1896
|
+
# ID, the server can check if original operation with the same request ID
|
1897
|
+
# was received, and if so, will ignore the second request. This prevents
|
1898
|
+
# clients from accidentally creating duplicate commitments.
|
1899
|
+
#
|
1900
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
1901
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
1902
|
+
#
|
1903
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1904
|
+
# @yieldparam response [::Gapic::Operation]
|
1905
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1906
|
+
#
|
1907
|
+
# @return [::Gapic::Operation]
|
1908
|
+
#
|
1909
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1910
|
+
#
|
1911
|
+
# @example Basic example
|
1912
|
+
# require "google/cloud/backupdr/v1"
|
1913
|
+
#
|
1914
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1915
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
1916
|
+
#
|
1917
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1918
|
+
# request = Google::Cloud::BackupDR::V1::UpdateBackupRequest.new
|
1919
|
+
#
|
1920
|
+
# # Call the update_backup method.
|
1921
|
+
# result = client.update_backup request
|
1922
|
+
#
|
1923
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1924
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1925
|
+
# # Here is how to wait for a response.
|
1926
|
+
# result.wait_until_done! timeout: 60
|
1927
|
+
# if result.response?
|
1928
|
+
# p result.response
|
1929
|
+
# else
|
1930
|
+
# puts "No response received."
|
1931
|
+
# end
|
1932
|
+
#
|
1933
|
+
def update_backup request, options = nil
|
1934
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1935
|
+
|
1936
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateBackupRequest
|
1937
|
+
|
1938
|
+
# Converts hash and nil to an options object
|
1939
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1940
|
+
|
1941
|
+
# Customize the options with defaults
|
1942
|
+
metadata = @config.rpcs.update_backup.metadata.to_h
|
1943
|
+
|
1944
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1945
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1946
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1947
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
1948
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1949
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1950
|
+
|
1951
|
+
header_params = {}
|
1952
|
+
if request.backup&.name
|
1953
|
+
header_params["backup.name"] = request.backup.name
|
1954
|
+
end
|
1955
|
+
|
1956
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1957
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1958
|
+
|
1959
|
+
options.apply_defaults timeout: @config.rpcs.update_backup.timeout,
|
1960
|
+
metadata: metadata,
|
1961
|
+
retry_policy: @config.rpcs.update_backup.retry_policy
|
1962
|
+
|
1963
|
+
options.apply_defaults timeout: @config.timeout,
|
1964
|
+
metadata: @config.metadata,
|
1965
|
+
retry_policy: @config.retry_policy
|
1966
|
+
|
1967
|
+
@backup_dr_stub.call_rpc :update_backup, request, options: options do |response, operation|
|
1968
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1969
|
+
yield response, operation if block_given?
|
1970
|
+
return response
|
1971
|
+
end
|
1972
|
+
rescue ::GRPC::BadStatus => e
|
1973
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1974
|
+
end
|
1975
|
+
|
1976
|
+
##
|
1977
|
+
# Deletes a Backup.
|
1978
|
+
#
|
1979
|
+
# @overload delete_backup(request, options = nil)
|
1980
|
+
# Pass arguments to `delete_backup` via a request object, either of type
|
1981
|
+
# {::Google::Cloud::BackupDR::V1::DeleteBackupRequest} or an equivalent Hash.
|
1982
|
+
#
|
1983
|
+
# @param request [::Google::Cloud::BackupDR::V1::DeleteBackupRequest, ::Hash]
|
1984
|
+
# A request object representing the call parameters. Required. To specify no
|
1985
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1986
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1987
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1988
|
+
#
|
1989
|
+
# @overload delete_backup(name: nil, request_id: nil)
|
1990
|
+
# Pass arguments to `delete_backup` via keyword arguments. Note that at
|
1991
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1992
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1993
|
+
#
|
1994
|
+
# @param name [::String]
|
1995
|
+
# Required. Name of the resource.
|
1996
|
+
# @param request_id [::String]
|
1997
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
1998
|
+
# request ID so that if you must retry your request, the server will know to
|
1999
|
+
# ignore the request if it has already been completed. The server will
|
2000
|
+
# guarantee that for at least 60 minutes after the first request.
|
2001
|
+
#
|
2002
|
+
# For example, consider a situation where you make an initial request and
|
2003
|
+
# the request times out. If you make the request again with the same request
|
2004
|
+
# ID, the server can check if original operation with the same request ID
|
2005
|
+
# was received, and if so, will ignore the second request. This prevents
|
2006
|
+
# clients from accidentally creating duplicate commitments.
|
2007
|
+
#
|
2008
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2009
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2010
|
+
#
|
2011
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2012
|
+
# @yieldparam response [::Gapic::Operation]
|
2013
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2014
|
+
#
|
2015
|
+
# @return [::Gapic::Operation]
|
2016
|
+
#
|
2017
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2018
|
+
#
|
2019
|
+
# @example Basic example
|
2020
|
+
# require "google/cloud/backupdr/v1"
|
2021
|
+
#
|
2022
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2023
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2024
|
+
#
|
2025
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2026
|
+
# request = Google::Cloud::BackupDR::V1::DeleteBackupRequest.new
|
2027
|
+
#
|
2028
|
+
# # Call the delete_backup method.
|
2029
|
+
# result = client.delete_backup request
|
2030
|
+
#
|
2031
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2032
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2033
|
+
# # Here is how to wait for a response.
|
2034
|
+
# result.wait_until_done! timeout: 60
|
2035
|
+
# if result.response?
|
2036
|
+
# p result.response
|
2037
|
+
# else
|
2038
|
+
# puts "No response received."
|
2039
|
+
# end
|
2040
|
+
#
|
2041
|
+
def delete_backup request, options = nil
|
2042
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2043
|
+
|
2044
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteBackupRequest
|
2045
|
+
|
2046
|
+
# Converts hash and nil to an options object
|
2047
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2048
|
+
|
2049
|
+
# Customize the options with defaults
|
2050
|
+
metadata = @config.rpcs.delete_backup.metadata.to_h
|
2051
|
+
|
2052
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2053
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2054
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2055
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
2056
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2057
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2058
|
+
|
2059
|
+
header_params = {}
|
2060
|
+
if request.name
|
2061
|
+
header_params["name"] = request.name
|
2062
|
+
end
|
2063
|
+
|
2064
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2065
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2066
|
+
|
2067
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
|
2068
|
+
metadata: metadata,
|
2069
|
+
retry_policy: @config.rpcs.delete_backup.retry_policy
|
2070
|
+
|
2071
|
+
options.apply_defaults timeout: @config.timeout,
|
2072
|
+
metadata: @config.metadata,
|
2073
|
+
retry_policy: @config.retry_policy
|
2074
|
+
|
2075
|
+
@backup_dr_stub.call_rpc :delete_backup, request, options: options do |response, operation|
|
2076
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2077
|
+
yield response, operation if block_given?
|
2078
|
+
return response
|
2079
|
+
end
|
2080
|
+
rescue ::GRPC::BadStatus => e
|
2081
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2082
|
+
end
|
2083
|
+
|
2084
|
+
##
|
2085
|
+
# Restore from a Backup
|
2086
|
+
#
|
2087
|
+
# @overload restore_backup(request, options = nil)
|
2088
|
+
# Pass arguments to `restore_backup` via a request object, either of type
|
2089
|
+
# {::Google::Cloud::BackupDR::V1::RestoreBackupRequest} or an equivalent Hash.
|
2090
|
+
#
|
2091
|
+
# @param request [::Google::Cloud::BackupDR::V1::RestoreBackupRequest, ::Hash]
|
2092
|
+
# A request object representing the call parameters. Required. To specify no
|
2093
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2094
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2095
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2096
|
+
#
|
2097
|
+
# @overload restore_backup(name: nil, request_id: nil, compute_instance_target_environment: nil, compute_instance_restore_properties: nil)
|
2098
|
+
# Pass arguments to `restore_backup` via keyword arguments. Note that at
|
2099
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2100
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2101
|
+
#
|
2102
|
+
# @param name [::String]
|
2103
|
+
# Required. The resource name of the Backup instance, in the format
|
2104
|
+
# 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'.
|
2105
|
+
# @param request_id [::String]
|
2106
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2107
|
+
# request ID so that if you must retry your request, the server will know to
|
2108
|
+
# ignore the request if it has already been completed. The server will
|
2109
|
+
# guarantee that for at least 60 minutes after the first request.
|
2110
|
+
#
|
2111
|
+
# For example, consider a situation where you make an initial request and
|
2112
|
+
# the request times out. If you make the request again with the same request
|
2113
|
+
# ID, the server can check if original operation with the same request ID
|
2114
|
+
# was received, and if so, will ignore the second request. This prevents
|
2115
|
+
# clients from accidentally creating duplicate commitments.
|
2116
|
+
#
|
2117
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2118
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2119
|
+
# @param compute_instance_target_environment [::Google::Cloud::BackupDR::V1::ComputeInstanceTargetEnvironment, ::Hash]
|
2120
|
+
# Compute Engine target environment to be used during restore.
|
2121
|
+
# @param compute_instance_restore_properties [::Google::Cloud::BackupDR::V1::ComputeInstanceRestoreProperties, ::Hash]
|
2122
|
+
# Compute Engine instance properties to be overridden during restore.
|
2123
|
+
#
|
2124
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2125
|
+
# @yieldparam response [::Gapic::Operation]
|
2126
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2127
|
+
#
|
2128
|
+
# @return [::Gapic::Operation]
|
2129
|
+
#
|
2130
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2131
|
+
#
|
2132
|
+
# @example Basic example
|
2133
|
+
# require "google/cloud/backupdr/v1"
|
2134
|
+
#
|
2135
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2136
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2137
|
+
#
|
2138
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2139
|
+
# request = Google::Cloud::BackupDR::V1::RestoreBackupRequest.new
|
2140
|
+
#
|
2141
|
+
# # Call the restore_backup method.
|
2142
|
+
# result = client.restore_backup request
|
2143
|
+
#
|
2144
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2145
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2146
|
+
# # Here is how to wait for a response.
|
2147
|
+
# result.wait_until_done! timeout: 60
|
2148
|
+
# if result.response?
|
2149
|
+
# p result.response
|
2150
|
+
# else
|
2151
|
+
# puts "No response received."
|
2152
|
+
# end
|
2153
|
+
#
|
2154
|
+
def restore_backup request, options = nil
|
2155
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2156
|
+
|
2157
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::RestoreBackupRequest
|
2158
|
+
|
2159
|
+
# Converts hash and nil to an options object
|
2160
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2161
|
+
|
2162
|
+
# Customize the options with defaults
|
2163
|
+
metadata = @config.rpcs.restore_backup.metadata.to_h
|
2164
|
+
|
2165
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2166
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2167
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2168
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
2169
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2170
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2171
|
+
|
2172
|
+
header_params = {}
|
2173
|
+
if request.name
|
2174
|
+
header_params["name"] = request.name
|
2175
|
+
end
|
2176
|
+
|
2177
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2178
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2179
|
+
|
2180
|
+
options.apply_defaults timeout: @config.rpcs.restore_backup.timeout,
|
2181
|
+
metadata: metadata,
|
2182
|
+
retry_policy: @config.rpcs.restore_backup.retry_policy
|
2183
|
+
|
2184
|
+
options.apply_defaults timeout: @config.timeout,
|
2185
|
+
metadata: @config.metadata,
|
2186
|
+
retry_policy: @config.retry_policy
|
2187
|
+
|
2188
|
+
@backup_dr_stub.call_rpc :restore_backup, request, options: options do |response, operation|
|
2189
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2190
|
+
yield response, operation if block_given?
|
2191
|
+
return response
|
2192
|
+
end
|
2193
|
+
rescue ::GRPC::BadStatus => e
|
2194
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2195
|
+
end
|
2196
|
+
|
2197
|
+
##
|
2198
|
+
# Create a BackupPlan
|
2199
|
+
#
|
2200
|
+
# @overload create_backup_plan(request, options = nil)
|
2201
|
+
# Pass arguments to `create_backup_plan` via a request object, either of type
|
2202
|
+
# {::Google::Cloud::BackupDR::V1::CreateBackupPlanRequest} or an equivalent Hash.
|
2203
|
+
#
|
2204
|
+
# @param request [::Google::Cloud::BackupDR::V1::CreateBackupPlanRequest, ::Hash]
|
2205
|
+
# A request object representing the call parameters. Required. To specify no
|
2206
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2207
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2208
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2209
|
+
#
|
2210
|
+
# @overload create_backup_plan(parent: nil, backup_plan_id: nil, backup_plan: nil, request_id: nil)
|
2211
|
+
# Pass arguments to `create_backup_plan` via keyword arguments. Note that at
|
2212
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2213
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2214
|
+
#
|
2215
|
+
# @param parent [::String]
|
2216
|
+
# Required. The `BackupPlan` project and location in the format
|
2217
|
+
# `projects/{project}/locations/{location}`. In Cloud BackupDR locations
|
2218
|
+
# map to GCP regions, for example **us-central1**.
|
2219
|
+
# @param backup_plan_id [::String]
|
2220
|
+
# Required. The name of the `BackupPlan` to create. The name must be unique
|
2221
|
+
# for the specified project and location.The name must start with a lowercase
|
2222
|
+
# letter followed by up to 62 lowercase letters, numbers, or hyphens.
|
2223
|
+
# Pattern, /[a-z][a-z0-9-]\\{,62}/.
|
2224
|
+
# @param backup_plan [::Google::Cloud::BackupDR::V1::BackupPlan, ::Hash]
|
2225
|
+
# Required. The `BackupPlan` resource object to create.
|
2226
|
+
# @param request_id [::String]
|
2227
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2228
|
+
# request ID so that if you must retry your request, the server will know to
|
2229
|
+
# ignore the request if it has already been completed. The server will
|
2230
|
+
# guarantee that for at least 60 minutes since the first request.
|
2231
|
+
#
|
2232
|
+
# For example, consider a situation where you make an initial request and t
|
2233
|
+
# he request times out. If you make the request again with the same request
|
2234
|
+
# ID, the server can check if original operation with the same request ID
|
2235
|
+
# was received, and if so, will ignore the second request. This prevents
|
2236
|
+
# clients from accidentally creating duplicate commitments.
|
2237
|
+
#
|
2238
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2239
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2240
|
+
#
|
2241
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2242
|
+
# @yieldparam response [::Gapic::Operation]
|
2243
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2244
|
+
#
|
2245
|
+
# @return [::Gapic::Operation]
|
2246
|
+
#
|
2247
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2248
|
+
#
|
2249
|
+
# @example Basic example
|
2250
|
+
# require "google/cloud/backupdr/v1"
|
2251
|
+
#
|
2252
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2253
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2254
|
+
#
|
2255
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2256
|
+
# request = Google::Cloud::BackupDR::V1::CreateBackupPlanRequest.new
|
2257
|
+
#
|
2258
|
+
# # Call the create_backup_plan method.
|
2259
|
+
# result = client.create_backup_plan request
|
2260
|
+
#
|
2261
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2262
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2263
|
+
# # Here is how to wait for a response.
|
2264
|
+
# result.wait_until_done! timeout: 60
|
2265
|
+
# if result.response?
|
2266
|
+
# p result.response
|
2267
|
+
# else
|
2268
|
+
# puts "No response received."
|
2269
|
+
# end
|
2270
|
+
#
|
2271
|
+
def create_backup_plan request, options = nil
|
2272
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2273
|
+
|
2274
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateBackupPlanRequest
|
2275
|
+
|
2276
|
+
# Converts hash and nil to an options object
|
2277
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2278
|
+
|
2279
|
+
# Customize the options with defaults
|
2280
|
+
metadata = @config.rpcs.create_backup_plan.metadata.to_h
|
2281
|
+
|
2282
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2283
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2284
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2285
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
2286
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2287
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2288
|
+
|
2289
|
+
header_params = {}
|
2290
|
+
if request.parent
|
2291
|
+
header_params["parent"] = request.parent
|
2292
|
+
end
|
2293
|
+
|
2294
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2295
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2296
|
+
|
2297
|
+
options.apply_defaults timeout: @config.rpcs.create_backup_plan.timeout,
|
2298
|
+
metadata: metadata,
|
2299
|
+
retry_policy: @config.rpcs.create_backup_plan.retry_policy
|
2300
|
+
|
2301
|
+
options.apply_defaults timeout: @config.timeout,
|
2302
|
+
metadata: @config.metadata,
|
2303
|
+
retry_policy: @config.retry_policy
|
2304
|
+
|
2305
|
+
@backup_dr_stub.call_rpc :create_backup_plan, request, options: options do |response, operation|
|
2306
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2307
|
+
yield response, operation if block_given?
|
2308
|
+
return response
|
2309
|
+
end
|
2310
|
+
rescue ::GRPC::BadStatus => e
|
2311
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2312
|
+
end
|
2313
|
+
|
2314
|
+
##
|
2315
|
+
# Gets details of a single BackupPlan.
|
2316
|
+
#
|
2317
|
+
# @overload get_backup_plan(request, options = nil)
|
2318
|
+
# Pass arguments to `get_backup_plan` via a request object, either of type
|
2319
|
+
# {::Google::Cloud::BackupDR::V1::GetBackupPlanRequest} or an equivalent Hash.
|
2320
|
+
#
|
2321
|
+
# @param request [::Google::Cloud::BackupDR::V1::GetBackupPlanRequest, ::Hash]
|
2322
|
+
# A request object representing the call parameters. Required. To specify no
|
2323
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2324
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2325
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2326
|
+
#
|
2327
|
+
# @overload get_backup_plan(name: nil)
|
2328
|
+
# Pass arguments to `get_backup_plan` via keyword arguments. Note that at
|
2329
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2330
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2331
|
+
#
|
2332
|
+
# @param name [::String]
|
2333
|
+
# Required. The resource name of the `BackupPlan` to retrieve.
|
2334
|
+
#
|
2335
|
+
# Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`
|
2336
|
+
#
|
2337
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2338
|
+
# @yieldparam response [::Google::Cloud::BackupDR::V1::BackupPlan]
|
2339
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2340
|
+
#
|
2341
|
+
# @return [::Google::Cloud::BackupDR::V1::BackupPlan]
|
2342
|
+
#
|
2343
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2344
|
+
#
|
2345
|
+
# @example Basic example
|
2346
|
+
# require "google/cloud/backupdr/v1"
|
2347
|
+
#
|
2348
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2349
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2350
|
+
#
|
2351
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2352
|
+
# request = Google::Cloud::BackupDR::V1::GetBackupPlanRequest.new
|
2353
|
+
#
|
2354
|
+
# # Call the get_backup_plan method.
|
2355
|
+
# result = client.get_backup_plan request
|
2356
|
+
#
|
2357
|
+
# # The returned object is of type Google::Cloud::BackupDR::V1::BackupPlan.
|
2358
|
+
# p result
|
2359
|
+
#
|
2360
|
+
def get_backup_plan request, options = nil
|
2361
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2362
|
+
|
2363
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupPlanRequest
|
2364
|
+
|
2365
|
+
# Converts hash and nil to an options object
|
2366
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2367
|
+
|
2368
|
+
# Customize the options with defaults
|
2369
|
+
metadata = @config.rpcs.get_backup_plan.metadata.to_h
|
2370
|
+
|
2371
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2372
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2373
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2374
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
2375
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2376
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2377
|
+
|
2378
|
+
header_params = {}
|
2379
|
+
if request.name
|
2380
|
+
header_params["name"] = request.name
|
2381
|
+
end
|
2382
|
+
|
2383
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2384
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2385
|
+
|
2386
|
+
options.apply_defaults timeout: @config.rpcs.get_backup_plan.timeout,
|
2387
|
+
metadata: metadata,
|
2388
|
+
retry_policy: @config.rpcs.get_backup_plan.retry_policy
|
2389
|
+
|
2390
|
+
options.apply_defaults timeout: @config.timeout,
|
2391
|
+
metadata: @config.metadata,
|
2392
|
+
retry_policy: @config.retry_policy
|
2393
|
+
|
2394
|
+
@backup_dr_stub.call_rpc :get_backup_plan, request, options: options do |response, operation|
|
2395
|
+
yield response, operation if block_given?
|
2396
|
+
return response
|
2397
|
+
end
|
2398
|
+
rescue ::GRPC::BadStatus => e
|
2399
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2400
|
+
end
|
2401
|
+
|
2402
|
+
##
|
2403
|
+
# Lists BackupPlans in a given project and location.
|
2404
|
+
#
|
2405
|
+
# @overload list_backup_plans(request, options = nil)
|
2406
|
+
# Pass arguments to `list_backup_plans` via a request object, either of type
|
2407
|
+
# {::Google::Cloud::BackupDR::V1::ListBackupPlansRequest} or an equivalent Hash.
|
2408
|
+
#
|
2409
|
+
# @param request [::Google::Cloud::BackupDR::V1::ListBackupPlansRequest, ::Hash]
|
2410
|
+
# A request object representing the call parameters. Required. To specify no
|
2411
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2412
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2413
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2414
|
+
#
|
2415
|
+
# @overload list_backup_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
2416
|
+
# Pass arguments to `list_backup_plans` via keyword arguments. Note that at
|
2417
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2418
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2419
|
+
#
|
2420
|
+
# @param parent [::String]
|
2421
|
+
# Required. The project and location for which to retrieve `BackupPlans`
|
2422
|
+
# information. Format: `projects/{project}/locations/{location}`. In Cloud
|
2423
|
+
# BackupDR, locations map to GCP regions, for e.g. **us-central1**. To
|
2424
|
+
# retrieve backup plans for all locations, use "-" for the
|
2425
|
+
# `{location}` value.
|
2426
|
+
# @param page_size [::Integer]
|
2427
|
+
# Optional. The maximum number of `BackupPlans` to return in a single
|
2428
|
+
# response. If not specified, a default value will be chosen by the service.
|
2429
|
+
# Note that the response may include a partial list and a caller should
|
2430
|
+
# only rely on the response's
|
2431
|
+
# {::Google::Cloud::BackupDR::V1::ListBackupPlansResponse#next_page_token next_page_token}
|
2432
|
+
# to determine if there are more instances left to be queried.
|
2433
|
+
# @param page_token [::String]
|
2434
|
+
# Optional. The value of
|
2435
|
+
# {::Google::Cloud::BackupDR::V1::ListBackupPlansResponse#next_page_token next_page_token}
|
2436
|
+
# received from a previous `ListBackupPlans` call.
|
2437
|
+
# Provide this to retrieve the subsequent page in a multi-page list of
|
2438
|
+
# results. When paginating, all other parameters provided to
|
2439
|
+
# `ListBackupPlans` must match the call that provided the page token.
|
2440
|
+
# @param filter [::String]
|
2441
|
+
# Optional. Field match expression used to filter the results.
|
2442
|
+
# @param order_by [::String]
|
2443
|
+
# Optional. Field by which to sort the results.
|
2444
|
+
#
|
2445
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2446
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlan>]
|
2447
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2448
|
+
#
|
2449
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlan>]
|
2450
|
+
#
|
2451
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2452
|
+
#
|
2453
|
+
# @example Basic example
|
2454
|
+
# require "google/cloud/backupdr/v1"
|
2455
|
+
#
|
2456
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2457
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2458
|
+
#
|
2459
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2460
|
+
# request = Google::Cloud::BackupDR::V1::ListBackupPlansRequest.new
|
2461
|
+
#
|
2462
|
+
# # Call the list_backup_plans method.
|
2463
|
+
# result = client.list_backup_plans request
|
2464
|
+
#
|
2465
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
2466
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
2467
|
+
# result.each do |item|
|
2468
|
+
# # Each element is of type ::Google::Cloud::BackupDR::V1::BackupPlan.
|
2469
|
+
# p item
|
2470
|
+
# end
|
2471
|
+
#
|
2472
|
+
def list_backup_plans request, options = nil
|
2473
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2474
|
+
|
2475
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupPlansRequest
|
2476
|
+
|
2477
|
+
# Converts hash and nil to an options object
|
2478
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2479
|
+
|
2480
|
+
# Customize the options with defaults
|
2481
|
+
metadata = @config.rpcs.list_backup_plans.metadata.to_h
|
2482
|
+
|
2483
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2484
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2485
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2486
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
2487
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2488
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2489
|
+
|
2490
|
+
header_params = {}
|
2491
|
+
if request.parent
|
2492
|
+
header_params["parent"] = request.parent
|
2493
|
+
end
|
2494
|
+
|
2495
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2496
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2497
|
+
|
2498
|
+
options.apply_defaults timeout: @config.rpcs.list_backup_plans.timeout,
|
2499
|
+
metadata: metadata,
|
2500
|
+
retry_policy: @config.rpcs.list_backup_plans.retry_policy
|
2501
|
+
|
2502
|
+
options.apply_defaults timeout: @config.timeout,
|
2503
|
+
metadata: @config.metadata,
|
2504
|
+
retry_policy: @config.retry_policy
|
2505
|
+
|
2506
|
+
@backup_dr_stub.call_rpc :list_backup_plans, request, options: options do |response, operation|
|
2507
|
+
response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backup_plans, request, response, operation, options
|
2508
|
+
yield response, operation if block_given?
|
2509
|
+
return response
|
2510
|
+
end
|
2511
|
+
rescue ::GRPC::BadStatus => e
|
2512
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2513
|
+
end
|
2514
|
+
|
2515
|
+
##
|
2516
|
+
# Deletes a single BackupPlan.
|
2517
|
+
#
|
2518
|
+
# @overload delete_backup_plan(request, options = nil)
|
2519
|
+
# Pass arguments to `delete_backup_plan` via a request object, either of type
|
2520
|
+
# {::Google::Cloud::BackupDR::V1::DeleteBackupPlanRequest} or an equivalent Hash.
|
2521
|
+
#
|
2522
|
+
# @param request [::Google::Cloud::BackupDR::V1::DeleteBackupPlanRequest, ::Hash]
|
2523
|
+
# A request object representing the call parameters. Required. To specify no
|
2524
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2525
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2526
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2527
|
+
#
|
2528
|
+
# @overload delete_backup_plan(name: nil, request_id: nil)
|
2529
|
+
# Pass arguments to `delete_backup_plan` via keyword arguments. Note that at
|
2530
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2531
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2532
|
+
#
|
2533
|
+
# @param name [::String]
|
2534
|
+
# Required. The resource name of the `BackupPlan` to delete.
|
2535
|
+
#
|
2536
|
+
# Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`
|
2537
|
+
# @param request_id [::String]
|
2538
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2539
|
+
# request ID so that if you must retry your request, the server will know to
|
2540
|
+
# ignore the request if it has already been completed. The server will
|
2541
|
+
# guarantee that for at least 60 minutes after the first request.
|
2542
|
+
#
|
2543
|
+
# For example, consider a situation where you make an initial request and
|
2544
|
+
# the request times out. If you make the request again with the same request
|
2545
|
+
# ID, the server can check if original operation with the same request ID
|
2546
|
+
# was received, and if so, will ignore the second request. This prevents
|
2547
|
+
# clients from accidentally creating duplicate commitments.
|
2548
|
+
#
|
2549
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2550
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2551
|
+
#
|
2552
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2553
|
+
# @yieldparam response [::Gapic::Operation]
|
2554
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2555
|
+
#
|
2556
|
+
# @return [::Gapic::Operation]
|
2557
|
+
#
|
2558
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2559
|
+
#
|
2560
|
+
# @example Basic example
|
2561
|
+
# require "google/cloud/backupdr/v1"
|
2562
|
+
#
|
2563
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2564
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2565
|
+
#
|
2566
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2567
|
+
# request = Google::Cloud::BackupDR::V1::DeleteBackupPlanRequest.new
|
2568
|
+
#
|
2569
|
+
# # Call the delete_backup_plan method.
|
2570
|
+
# result = client.delete_backup_plan request
|
2571
|
+
#
|
2572
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2573
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2574
|
+
# # Here is how to wait for a response.
|
2575
|
+
# result.wait_until_done! timeout: 60
|
2576
|
+
# if result.response?
|
2577
|
+
# p result.response
|
2578
|
+
# else
|
2579
|
+
# puts "No response received."
|
2580
|
+
# end
|
2581
|
+
#
|
2582
|
+
def delete_backup_plan request, options = nil
|
2583
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2584
|
+
|
2585
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteBackupPlanRequest
|
2586
|
+
|
2587
|
+
# Converts hash and nil to an options object
|
2588
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2589
|
+
|
2590
|
+
# Customize the options with defaults
|
2591
|
+
metadata = @config.rpcs.delete_backup_plan.metadata.to_h
|
2592
|
+
|
2593
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2594
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2595
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2596
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
2597
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2598
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2599
|
+
|
2600
|
+
header_params = {}
|
2601
|
+
if request.name
|
2602
|
+
header_params["name"] = request.name
|
2603
|
+
end
|
2604
|
+
|
2605
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2606
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2607
|
+
|
2608
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup_plan.timeout,
|
2609
|
+
metadata: metadata,
|
2610
|
+
retry_policy: @config.rpcs.delete_backup_plan.retry_policy
|
2611
|
+
|
2612
|
+
options.apply_defaults timeout: @config.timeout,
|
2613
|
+
metadata: @config.metadata,
|
2614
|
+
retry_policy: @config.retry_policy
|
2615
|
+
|
2616
|
+
@backup_dr_stub.call_rpc :delete_backup_plan, request, options: options do |response, operation|
|
2617
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2618
|
+
yield response, operation if block_given?
|
2619
|
+
return response
|
2620
|
+
end
|
2621
|
+
rescue ::GRPC::BadStatus => e
|
2622
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2623
|
+
end
|
2624
|
+
|
2625
|
+
##
|
2626
|
+
# Create a BackupPlanAssociation
|
2627
|
+
#
|
2628
|
+
# @overload create_backup_plan_association(request, options = nil)
|
2629
|
+
# Pass arguments to `create_backup_plan_association` via a request object, either of type
|
2630
|
+
# {::Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest} or an equivalent Hash.
|
2631
|
+
#
|
2632
|
+
# @param request [::Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest, ::Hash]
|
2633
|
+
# A request object representing the call parameters. Required. To specify no
|
2634
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2635
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2636
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2637
|
+
#
|
2638
|
+
# @overload create_backup_plan_association(parent: nil, backup_plan_association_id: nil, backup_plan_association: nil, request_id: nil)
|
2639
|
+
# Pass arguments to `create_backup_plan_association` via keyword arguments. Note that at
|
2640
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2641
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2642
|
+
#
|
2643
|
+
# @param parent [::String]
|
2644
|
+
# Required. The backup plan association project and location in the format
|
2645
|
+
# `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations
|
2646
|
+
# map to GCP regions, for example **us-central1**.
|
2647
|
+
# @param backup_plan_association_id [::String]
|
2648
|
+
# Required. The name of the backup plan association to create. The name must
|
2649
|
+
# be unique for the specified project and location.
|
2650
|
+
# @param backup_plan_association [::Google::Cloud::BackupDR::V1::BackupPlanAssociation, ::Hash]
|
2651
|
+
# Required. The resource being created
|
2652
|
+
# @param request_id [::String]
|
2653
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2654
|
+
# request ID so that if you must retry your request, the server will know to
|
2655
|
+
# ignore the request if it has already been completed. The server will
|
2656
|
+
# guarantee that for at least 60 minutes since the first request.
|
2657
|
+
#
|
2658
|
+
# For example, consider a situation where you make an initial request and t
|
2659
|
+
# he request times out. If you make the request again with the same request
|
2660
|
+
# ID, the server can check if original operation with the same request ID
|
2661
|
+
# was received, and if so, will ignore the second request. This prevents
|
2662
|
+
# clients from accidentally creating duplicate commitments.
|
2663
|
+
#
|
2664
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2665
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2666
|
+
#
|
2667
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2668
|
+
# @yieldparam response [::Gapic::Operation]
|
2669
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2670
|
+
#
|
2671
|
+
# @return [::Gapic::Operation]
|
2672
|
+
#
|
2673
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2674
|
+
#
|
2675
|
+
# @example Basic example
|
2676
|
+
# require "google/cloud/backupdr/v1"
|
2677
|
+
#
|
2678
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2679
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2680
|
+
#
|
2681
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2682
|
+
# request = Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest.new
|
2683
|
+
#
|
2684
|
+
# # Call the create_backup_plan_association method.
|
2685
|
+
# result = client.create_backup_plan_association request
|
2686
|
+
#
|
2687
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2688
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2689
|
+
# # Here is how to wait for a response.
|
2690
|
+
# result.wait_until_done! timeout: 60
|
2691
|
+
# if result.response?
|
2692
|
+
# p result.response
|
2693
|
+
# else
|
2694
|
+
# puts "No response received."
|
2695
|
+
# end
|
2696
|
+
#
|
2697
|
+
def create_backup_plan_association request, options = nil
|
2698
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2699
|
+
|
2700
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest
|
2701
|
+
|
2702
|
+
# Converts hash and nil to an options object
|
2703
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2704
|
+
|
2705
|
+
# Customize the options with defaults
|
2706
|
+
metadata = @config.rpcs.create_backup_plan_association.metadata.to_h
|
2707
|
+
|
2708
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2709
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2710
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2711
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
2712
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2713
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2714
|
+
|
2715
|
+
header_params = {}
|
2716
|
+
if request.parent
|
2717
|
+
header_params["parent"] = request.parent
|
2718
|
+
end
|
2719
|
+
|
2720
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2721
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2722
|
+
|
2723
|
+
options.apply_defaults timeout: @config.rpcs.create_backup_plan_association.timeout,
|
2724
|
+
metadata: metadata,
|
2725
|
+
retry_policy: @config.rpcs.create_backup_plan_association.retry_policy
|
2726
|
+
|
2727
|
+
options.apply_defaults timeout: @config.timeout,
|
2728
|
+
metadata: @config.metadata,
|
2729
|
+
retry_policy: @config.retry_policy
|
2730
|
+
|
2731
|
+
@backup_dr_stub.call_rpc :create_backup_plan_association, request, options: options do |response, operation|
|
2732
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2733
|
+
yield response, operation if block_given?
|
2734
|
+
return response
|
2735
|
+
end
|
2736
|
+
rescue ::GRPC::BadStatus => e
|
2737
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2738
|
+
end
|
2739
|
+
|
2740
|
+
##
|
2741
|
+
# Gets details of a single BackupPlanAssociation.
|
2742
|
+
#
|
2743
|
+
# @overload get_backup_plan_association(request, options = nil)
|
2744
|
+
# Pass arguments to `get_backup_plan_association` via a request object, either of type
|
2745
|
+
# {::Google::Cloud::BackupDR::V1::GetBackupPlanAssociationRequest} or an equivalent Hash.
|
2746
|
+
#
|
2747
|
+
# @param request [::Google::Cloud::BackupDR::V1::GetBackupPlanAssociationRequest, ::Hash]
|
2748
|
+
# A request object representing the call parameters. Required. To specify no
|
2749
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2750
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2751
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2752
|
+
#
|
2753
|
+
# @overload get_backup_plan_association(name: nil)
|
2754
|
+
# Pass arguments to `get_backup_plan_association` via keyword arguments. Note that at
|
2755
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2756
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2757
|
+
#
|
2758
|
+
# @param name [::String]
|
2759
|
+
# Required. Name of the backup plan association resource, in the format
|
2760
|
+
# `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
|
2761
|
+
#
|
2762
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2763
|
+
# @yieldparam response [::Google::Cloud::BackupDR::V1::BackupPlanAssociation]
|
2764
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2765
|
+
#
|
2766
|
+
# @return [::Google::Cloud::BackupDR::V1::BackupPlanAssociation]
|
2767
|
+
#
|
2768
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2769
|
+
#
|
2770
|
+
# @example Basic example
|
2771
|
+
# require "google/cloud/backupdr/v1"
|
2772
|
+
#
|
2773
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2774
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2775
|
+
#
|
2776
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2777
|
+
# request = Google::Cloud::BackupDR::V1::GetBackupPlanAssociationRequest.new
|
2778
|
+
#
|
2779
|
+
# # Call the get_backup_plan_association method.
|
2780
|
+
# result = client.get_backup_plan_association request
|
2781
|
+
#
|
2782
|
+
# # The returned object is of type Google::Cloud::BackupDR::V1::BackupPlanAssociation.
|
2783
|
+
# p result
|
2784
|
+
#
|
2785
|
+
def get_backup_plan_association request, options = nil
|
2786
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2787
|
+
|
2788
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupPlanAssociationRequest
|
2789
|
+
|
2790
|
+
# Converts hash and nil to an options object
|
2791
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2792
|
+
|
2793
|
+
# Customize the options with defaults
|
2794
|
+
metadata = @config.rpcs.get_backup_plan_association.metadata.to_h
|
2795
|
+
|
2796
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2797
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2798
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2799
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
2800
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2801
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2802
|
+
|
2803
|
+
header_params = {}
|
2804
|
+
if request.name
|
2805
|
+
header_params["name"] = request.name
|
2806
|
+
end
|
2807
|
+
|
2808
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2809
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2810
|
+
|
2811
|
+
options.apply_defaults timeout: @config.rpcs.get_backup_plan_association.timeout,
|
2812
|
+
metadata: metadata,
|
2813
|
+
retry_policy: @config.rpcs.get_backup_plan_association.retry_policy
|
2814
|
+
|
2815
|
+
options.apply_defaults timeout: @config.timeout,
|
2816
|
+
metadata: @config.metadata,
|
2817
|
+
retry_policy: @config.retry_policy
|
2818
|
+
|
2819
|
+
@backup_dr_stub.call_rpc :get_backup_plan_association, request, options: options do |response, operation|
|
2820
|
+
yield response, operation if block_given?
|
2821
|
+
return response
|
2822
|
+
end
|
2823
|
+
rescue ::GRPC::BadStatus => e
|
2824
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2825
|
+
end
|
2826
|
+
|
2827
|
+
##
|
2828
|
+
# Lists BackupPlanAssociations in a given project and location.
|
2829
|
+
#
|
2830
|
+
# @overload list_backup_plan_associations(request, options = nil)
|
2831
|
+
# Pass arguments to `list_backup_plan_associations` via a request object, either of type
|
2832
|
+
# {::Google::Cloud::BackupDR::V1::ListBackupPlanAssociationsRequest} or an equivalent Hash.
|
2833
|
+
#
|
2834
|
+
# @param request [::Google::Cloud::BackupDR::V1::ListBackupPlanAssociationsRequest, ::Hash]
|
2835
|
+
# A request object representing the call parameters. Required. To specify no
|
2836
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2837
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2838
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2839
|
+
#
|
2840
|
+
# @overload list_backup_plan_associations(parent: nil, page_size: nil, page_token: nil, filter: nil)
|
2841
|
+
# Pass arguments to `list_backup_plan_associations` via keyword arguments. Note that at
|
2842
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2843
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2844
|
+
#
|
2845
|
+
# @param parent [::String]
|
2846
|
+
# Required. The project and location for which to retrieve backup Plan
|
2847
|
+
# Associations information, in the format
|
2848
|
+
# `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations
|
2849
|
+
# map to GCP regions, for example **us-central1**. To retrieve backup plan
|
2850
|
+
# associations for all locations, use "-" for the
|
2851
|
+
# `{location}` value.
|
2852
|
+
# @param page_size [::Integer]
|
2853
|
+
# Optional. Requested page size. Server may return fewer items than
|
2854
|
+
# requested. If unspecified, server will pick an appropriate default.
|
2855
|
+
# @param page_token [::String]
|
2856
|
+
# Optional. A token identifying a page of results the server should return.
|
2857
|
+
# @param filter [::String]
|
2858
|
+
# Optional. Filtering results
|
2859
|
+
#
|
2860
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2861
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>]
|
2862
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2863
|
+
#
|
2864
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>]
|
2865
|
+
#
|
2866
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2867
|
+
#
|
2868
|
+
# @example Basic example
|
2869
|
+
# require "google/cloud/backupdr/v1"
|
2870
|
+
#
|
2871
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2872
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2873
|
+
#
|
2874
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2875
|
+
# request = Google::Cloud::BackupDR::V1::ListBackupPlanAssociationsRequest.new
|
2876
|
+
#
|
2877
|
+
# # Call the list_backup_plan_associations method.
|
2878
|
+
# result = client.list_backup_plan_associations request
|
2879
|
+
#
|
2880
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
2881
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
2882
|
+
# result.each do |item|
|
2883
|
+
# # Each element is of type ::Google::Cloud::BackupDR::V1::BackupPlanAssociation.
|
2884
|
+
# p item
|
2885
|
+
# end
|
2886
|
+
#
|
2887
|
+
def list_backup_plan_associations request, options = nil
|
2888
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2889
|
+
|
2890
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupPlanAssociationsRequest
|
2891
|
+
|
2892
|
+
# Converts hash and nil to an options object
|
2893
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2894
|
+
|
2895
|
+
# Customize the options with defaults
|
2896
|
+
metadata = @config.rpcs.list_backup_plan_associations.metadata.to_h
|
2897
|
+
|
2898
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2899
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2900
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2901
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
2902
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2903
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2904
|
+
|
2905
|
+
header_params = {}
|
2906
|
+
if request.parent
|
2907
|
+
header_params["parent"] = request.parent
|
2908
|
+
end
|
2909
|
+
|
2910
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2911
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2912
|
+
|
2913
|
+
options.apply_defaults timeout: @config.rpcs.list_backup_plan_associations.timeout,
|
2914
|
+
metadata: metadata,
|
2915
|
+
retry_policy: @config.rpcs.list_backup_plan_associations.retry_policy
|
2916
|
+
|
2917
|
+
options.apply_defaults timeout: @config.timeout,
|
2918
|
+
metadata: @config.metadata,
|
2919
|
+
retry_policy: @config.retry_policy
|
2920
|
+
|
2921
|
+
@backup_dr_stub.call_rpc :list_backup_plan_associations, request, options: options do |response, operation|
|
2922
|
+
response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_backup_plan_associations, request, response, operation, options
|
2923
|
+
yield response, operation if block_given?
|
2924
|
+
return response
|
2925
|
+
end
|
2926
|
+
rescue ::GRPC::BadStatus => e
|
2927
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2928
|
+
end
|
2929
|
+
|
2930
|
+
##
|
2931
|
+
# Deletes a single BackupPlanAssociation.
|
2932
|
+
#
|
2933
|
+
# @overload delete_backup_plan_association(request, options = nil)
|
2934
|
+
# Pass arguments to `delete_backup_plan_association` via a request object, either of type
|
2935
|
+
# {::Google::Cloud::BackupDR::V1::DeleteBackupPlanAssociationRequest} or an equivalent Hash.
|
2936
|
+
#
|
2937
|
+
# @param request [::Google::Cloud::BackupDR::V1::DeleteBackupPlanAssociationRequest, ::Hash]
|
2938
|
+
# A request object representing the call parameters. Required. To specify no
|
2939
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2940
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2941
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2942
|
+
#
|
2943
|
+
# @overload delete_backup_plan_association(name: nil, request_id: nil)
|
2944
|
+
# Pass arguments to `delete_backup_plan_association` via keyword arguments. Note that at
|
2945
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2946
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2947
|
+
#
|
2948
|
+
# @param name [::String]
|
2949
|
+
# Required. Name of the backup plan association resource, in the format
|
2950
|
+
# `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
|
2951
|
+
# @param request_id [::String]
|
2952
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
2953
|
+
# request ID so that if you must retry your request, the server will know to
|
2954
|
+
# ignore the request if it has already been completed. The server will
|
2955
|
+
# guarantee that for at least 60 minutes after the first request.
|
2956
|
+
#
|
2957
|
+
# For example, consider a situation where you make an initial request and
|
2958
|
+
# the request times out. If you make the request again with the same request
|
2959
|
+
# ID, the server can check if original operation with the same request ID
|
2960
|
+
# was received, and if so, will ignore the second request. This prevents
|
2961
|
+
# clients from accidentally creating duplicate commitments.
|
2962
|
+
#
|
2963
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
2964
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2965
|
+
#
|
2966
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2967
|
+
# @yieldparam response [::Gapic::Operation]
|
2968
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2969
|
+
#
|
2970
|
+
# @return [::Gapic::Operation]
|
2971
|
+
#
|
2972
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2973
|
+
#
|
2974
|
+
# @example Basic example
|
2975
|
+
# require "google/cloud/backupdr/v1"
|
2976
|
+
#
|
2977
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2978
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
2979
|
+
#
|
2980
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2981
|
+
# request = Google::Cloud::BackupDR::V1::DeleteBackupPlanAssociationRequest.new
|
2982
|
+
#
|
2983
|
+
# # Call the delete_backup_plan_association method.
|
2984
|
+
# result = client.delete_backup_plan_association request
|
2985
|
+
#
|
2986
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2987
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2988
|
+
# # Here is how to wait for a response.
|
2989
|
+
# result.wait_until_done! timeout: 60
|
2990
|
+
# if result.response?
|
2991
|
+
# p result.response
|
2992
|
+
# else
|
2993
|
+
# puts "No response received."
|
2994
|
+
# end
|
2995
|
+
#
|
2996
|
+
def delete_backup_plan_association request, options = nil
|
2997
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2998
|
+
|
2999
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteBackupPlanAssociationRequest
|
3000
|
+
|
3001
|
+
# Converts hash and nil to an options object
|
3002
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3003
|
+
|
3004
|
+
# Customize the options with defaults
|
3005
|
+
metadata = @config.rpcs.delete_backup_plan_association.metadata.to_h
|
3006
|
+
|
3007
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3008
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3009
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3010
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
3011
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3012
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3013
|
+
|
3014
|
+
header_params = {}
|
3015
|
+
if request.name
|
3016
|
+
header_params["name"] = request.name
|
3017
|
+
end
|
3018
|
+
|
3019
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3020
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3021
|
+
|
3022
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup_plan_association.timeout,
|
3023
|
+
metadata: metadata,
|
3024
|
+
retry_policy: @config.rpcs.delete_backup_plan_association.retry_policy
|
3025
|
+
|
3026
|
+
options.apply_defaults timeout: @config.timeout,
|
3027
|
+
metadata: @config.metadata,
|
3028
|
+
retry_policy: @config.retry_policy
|
3029
|
+
|
3030
|
+
@backup_dr_stub.call_rpc :delete_backup_plan_association, request, options: options do |response, operation|
|
3031
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
3032
|
+
yield response, operation if block_given?
|
3033
|
+
return response
|
3034
|
+
end
|
3035
|
+
rescue ::GRPC::BadStatus => e
|
3036
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3037
|
+
end
|
3038
|
+
|
3039
|
+
##
|
3040
|
+
# Triggers a new Backup.
|
3041
|
+
#
|
3042
|
+
# @overload trigger_backup(request, options = nil)
|
3043
|
+
# Pass arguments to `trigger_backup` via a request object, either of type
|
3044
|
+
# {::Google::Cloud::BackupDR::V1::TriggerBackupRequest} or an equivalent Hash.
|
3045
|
+
#
|
3046
|
+
# @param request [::Google::Cloud::BackupDR::V1::TriggerBackupRequest, ::Hash]
|
3047
|
+
# A request object representing the call parameters. Required. To specify no
|
3048
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3049
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3050
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3051
|
+
#
|
3052
|
+
# @overload trigger_backup(name: nil, rule_id: nil, request_id: nil)
|
3053
|
+
# Pass arguments to `trigger_backup` via keyword arguments. Note that at
|
3054
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3055
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3056
|
+
#
|
3057
|
+
# @param name [::String]
|
3058
|
+
# Required. Name of the backup plan association resource, in the format
|
3059
|
+
# `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
|
3060
|
+
# @param rule_id [::String]
|
3061
|
+
# Required. backup rule_id for which a backup needs to be triggered.
|
3062
|
+
# @param request_id [::String]
|
3063
|
+
# Optional. An optional request ID to identify requests. Specify a unique
|
3064
|
+
# request ID so that if you must retry your request, the server will know to
|
3065
|
+
# ignore the request if it has already been completed. The server will
|
3066
|
+
# guarantee that for at least 60 minutes after the first request.
|
3067
|
+
#
|
3068
|
+
# For example, consider a situation where you make an initial request and
|
3069
|
+
# the request times out. If you make the request again with the same request
|
3070
|
+
# ID, the server can check if original operation with the same request ID
|
3071
|
+
# was received, and if so, will ignore the second request. This prevents
|
3072
|
+
# clients from accidentally creating duplicate commitments.
|
3073
|
+
#
|
3074
|
+
# The request ID must be a valid UUID with the exception that zero UUID is
|
3075
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
3076
|
+
#
|
3077
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3078
|
+
# @yieldparam response [::Gapic::Operation]
|
3079
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3080
|
+
#
|
3081
|
+
# @return [::Gapic::Operation]
|
3082
|
+
#
|
3083
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3084
|
+
#
|
3085
|
+
# @example Basic example
|
3086
|
+
# require "google/cloud/backupdr/v1"
|
3087
|
+
#
|
3088
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3089
|
+
# client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
|
3090
|
+
#
|
3091
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3092
|
+
# request = Google::Cloud::BackupDR::V1::TriggerBackupRequest.new
|
3093
|
+
#
|
3094
|
+
# # Call the trigger_backup method.
|
3095
|
+
# result = client.trigger_backup request
|
3096
|
+
#
|
3097
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3098
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3099
|
+
# # Here is how to wait for a response.
|
3100
|
+
# result.wait_until_done! timeout: 60
|
3101
|
+
# if result.response?
|
3102
|
+
# p result.response
|
3103
|
+
# else
|
3104
|
+
# puts "No response received."
|
3105
|
+
# end
|
3106
|
+
#
|
3107
|
+
def trigger_backup request, options = nil
|
3108
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3109
|
+
|
3110
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::TriggerBackupRequest
|
3111
|
+
|
3112
|
+
# Converts hash and nil to an options object
|
3113
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3114
|
+
|
3115
|
+
# Customize the options with defaults
|
3116
|
+
metadata = @config.rpcs.trigger_backup.metadata.to_h
|
3117
|
+
|
3118
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3119
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3120
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3121
|
+
gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
|
3122
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3123
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3124
|
+
|
3125
|
+
header_params = {}
|
3126
|
+
if request.name
|
3127
|
+
header_params["name"] = request.name
|
3128
|
+
end
|
3129
|
+
|
3130
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3131
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3132
|
+
|
3133
|
+
options.apply_defaults timeout: @config.rpcs.trigger_backup.timeout,
|
3134
|
+
metadata: metadata,
|
3135
|
+
retry_policy: @config.rpcs.trigger_backup.retry_policy
|
3136
|
+
|
3137
|
+
options.apply_defaults timeout: @config.timeout,
|
3138
|
+
metadata: @config.metadata,
|
3139
|
+
retry_policy: @config.retry_policy
|
3140
|
+
|
3141
|
+
@backup_dr_stub.call_rpc :trigger_backup, request, options: options do |response, operation|
|
3142
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
3143
|
+
yield response, operation if block_given?
|
3144
|
+
return response
|
3145
|
+
end
|
3146
|
+
rescue ::GRPC::BadStatus => e
|
3147
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3148
|
+
end
|
3149
|
+
|
3150
|
+
##
|
3151
|
+
# Configuration class for the BackupDR API.
|
3152
|
+
#
|
3153
|
+
# This class represents the configuration for BackupDR,
|
3154
|
+
# providing control over timeouts, retry behavior, logging, transport
|
3155
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
3156
|
+
# applied individually to specific RPCs. See
|
3157
|
+
# {::Google::Cloud::BackupDR::V1::BackupDR::Client::Configuration::Rpcs}
|
3158
|
+
# for a list of RPCs that can be configured independently.
|
3159
|
+
#
|
3160
|
+
# Configuration can be applied globally to all clients, or to a single client
|
3161
|
+
# on construction.
|
3162
|
+
#
|
3163
|
+
# @example
|
3164
|
+
#
|
3165
|
+
# # Modify the global config, setting the timeout for
|
3166
|
+
# # list_management_servers to 20 seconds,
|
3167
|
+
# # and all remaining timeouts to 10 seconds.
|
3168
|
+
# ::Google::Cloud::BackupDR::V1::BackupDR::Client.configure do |config|
|
3169
|
+
# config.timeout = 10.0
|
3170
|
+
# config.rpcs.list_management_servers.timeout = 20.0
|
3171
|
+
# end
|
3172
|
+
#
|
3173
|
+
# # Apply the above configuration only to a new client.
|
3174
|
+
# client = ::Google::Cloud::BackupDR::V1::BackupDR::Client.new do |config|
|
3175
|
+
# config.timeout = 10.0
|
3176
|
+
# config.rpcs.list_management_servers.timeout = 20.0
|
3177
|
+
# end
|
3178
|
+
#
|
3179
|
+
# @!attribute [rw] endpoint
|
3180
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
3181
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
3182
|
+
# @return [::String,nil]
|
3183
|
+
# @!attribute [rw] credentials
|
3184
|
+
# Credentials to send with calls. You may provide any of the following types:
|
3185
|
+
# * (`String`) The path to a service account key file in JSON format
|
3186
|
+
# * (`Hash`) A service account key as a Hash
|
3187
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
3188
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
3189
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
3190
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
3191
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
3192
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
3193
|
+
# * (`nil`) indicating no credentials
|
3194
|
+
# @return [::Object]
|
3195
|
+
# @!attribute [rw] scope
|
3196
|
+
# The OAuth scopes
|
3197
|
+
# @return [::Array<::String>]
|
3198
|
+
# @!attribute [rw] lib_name
|
3199
|
+
# The library name as recorded in instrumentation and logging
|
3200
|
+
# @return [::String]
|
3201
|
+
# @!attribute [rw] lib_version
|
3202
|
+
# The library version as recorded in instrumentation and logging
|
3203
|
+
# @return [::String]
|
3204
|
+
# @!attribute [rw] channel_args
|
3205
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
3206
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
3207
|
+
# @return [::Hash]
|
3208
|
+
# @!attribute [rw] interceptors
|
3209
|
+
# An array of interceptors that are run before calls are executed.
|
3210
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
3211
|
+
# @!attribute [rw] timeout
|
3212
|
+
# The call timeout in seconds.
|
3213
|
+
# @return [::Numeric]
|
3214
|
+
# @!attribute [rw] metadata
|
3215
|
+
# Additional gRPC headers to be sent with the call.
|
3216
|
+
# @return [::Hash{::Symbol=>::String}]
|
3217
|
+
# @!attribute [rw] retry_policy
|
3218
|
+
# The retry policy. The value is a hash with the following keys:
|
3219
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
3220
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
3221
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
3222
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
3223
|
+
# trigger a retry.
|
3224
|
+
# @return [::Hash]
|
3225
|
+
# @!attribute [rw] quota_project
|
3226
|
+
# A separate project against which to charge quota.
|
3227
|
+
# @return [::String]
|
3228
|
+
# @!attribute [rw] universe_domain
|
3229
|
+
# The universe domain within which to make requests. This determines the
|
3230
|
+
# default endpoint URL. The default value of nil uses the environment
|
3231
|
+
# universe (usually the default "googleapis.com" universe).
|
3232
|
+
# @return [::String,nil]
|
3233
|
+
#
|
3234
|
+
class Configuration
|
3235
|
+
extend ::Gapic::Config
|
3236
|
+
|
3237
|
+
# @private
|
3238
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
3239
|
+
DEFAULT_ENDPOINT = "backupdr.googleapis.com"
|
3240
|
+
|
3241
|
+
config_attr :endpoint, nil, ::String, nil
|
3242
|
+
config_attr :credentials, nil do |value|
|
3243
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
3244
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
3245
|
+
allowed.any? { |klass| klass === value }
|
3246
|
+
end
|
3247
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
3248
|
+
config_attr :lib_name, nil, ::String, nil
|
3249
|
+
config_attr :lib_version, nil, ::String, nil
|
3250
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
3251
|
+
config_attr :interceptors, nil, ::Array, nil
|
3252
|
+
config_attr :timeout, nil, ::Numeric, nil
|
3253
|
+
config_attr :metadata, nil, ::Hash, nil
|
3254
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
3255
|
+
config_attr :quota_project, nil, ::String, nil
|
3256
|
+
config_attr :universe_domain, nil, ::String, nil
|
3257
|
+
|
3258
|
+
# @private
|
3259
|
+
def initialize parent_config = nil
|
3260
|
+
@parent_config = parent_config unless parent_config.nil?
|
3261
|
+
|
3262
|
+
yield self if block_given?
|
3263
|
+
end
|
3264
|
+
|
3265
|
+
##
|
3266
|
+
# Configurations for individual RPCs
|
3267
|
+
# @return [Rpcs]
|
3268
|
+
#
|
3269
|
+
def rpcs
|
3270
|
+
@rpcs ||= begin
|
3271
|
+
parent_rpcs = nil
|
3272
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
3273
|
+
Rpcs.new parent_rpcs
|
3274
|
+
end
|
3275
|
+
end
|
3276
|
+
|
3277
|
+
##
|
3278
|
+
# Configuration for the channel pool
|
3279
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
3280
|
+
#
|
3281
|
+
def channel_pool
|
3282
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
3283
|
+
end
|
3284
|
+
|
3285
|
+
##
|
3286
|
+
# Configuration RPC class for the BackupDR API.
|
3287
|
+
#
|
3288
|
+
# Includes fields providing the configuration for each RPC in this service.
|
3289
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
3290
|
+
# the following configuration fields:
|
3291
|
+
#
|
3292
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
3293
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
3294
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
3295
|
+
# include the following keys:
|
3296
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
3297
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
3298
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
3299
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
3300
|
+
# trigger a retry.
|
3301
|
+
#
|
3302
|
+
class Rpcs
|
3303
|
+
##
|
3304
|
+
# RPC-specific configuration for `list_management_servers`
|
3305
|
+
# @return [::Gapic::Config::Method]
|
3306
|
+
#
|
3307
|
+
attr_reader :list_management_servers
|
3308
|
+
##
|
3309
|
+
# RPC-specific configuration for `get_management_server`
|
3310
|
+
# @return [::Gapic::Config::Method]
|
3311
|
+
#
|
3312
|
+
attr_reader :get_management_server
|
3313
|
+
##
|
3314
|
+
# RPC-specific configuration for `create_management_server`
|
3315
|
+
# @return [::Gapic::Config::Method]
|
3316
|
+
#
|
806
3317
|
attr_reader :create_management_server
|
807
3318
|
##
|
808
3319
|
# RPC-specific configuration for `delete_management_server`
|
809
3320
|
# @return [::Gapic::Config::Method]
|
810
3321
|
#
|
811
3322
|
attr_reader :delete_management_server
|
3323
|
+
##
|
3324
|
+
# RPC-specific configuration for `create_backup_vault`
|
3325
|
+
# @return [::Gapic::Config::Method]
|
3326
|
+
#
|
3327
|
+
attr_reader :create_backup_vault
|
3328
|
+
##
|
3329
|
+
# RPC-specific configuration for `list_backup_vaults`
|
3330
|
+
# @return [::Gapic::Config::Method]
|
3331
|
+
#
|
3332
|
+
attr_reader :list_backup_vaults
|
3333
|
+
##
|
3334
|
+
# RPC-specific configuration for `fetch_usable_backup_vaults`
|
3335
|
+
# @return [::Gapic::Config::Method]
|
3336
|
+
#
|
3337
|
+
attr_reader :fetch_usable_backup_vaults
|
3338
|
+
##
|
3339
|
+
# RPC-specific configuration for `get_backup_vault`
|
3340
|
+
# @return [::Gapic::Config::Method]
|
3341
|
+
#
|
3342
|
+
attr_reader :get_backup_vault
|
3343
|
+
##
|
3344
|
+
# RPC-specific configuration for `update_backup_vault`
|
3345
|
+
# @return [::Gapic::Config::Method]
|
3346
|
+
#
|
3347
|
+
attr_reader :update_backup_vault
|
3348
|
+
##
|
3349
|
+
# RPC-specific configuration for `delete_backup_vault`
|
3350
|
+
# @return [::Gapic::Config::Method]
|
3351
|
+
#
|
3352
|
+
attr_reader :delete_backup_vault
|
3353
|
+
##
|
3354
|
+
# RPC-specific configuration for `list_data_sources`
|
3355
|
+
# @return [::Gapic::Config::Method]
|
3356
|
+
#
|
3357
|
+
attr_reader :list_data_sources
|
3358
|
+
##
|
3359
|
+
# RPC-specific configuration for `get_data_source`
|
3360
|
+
# @return [::Gapic::Config::Method]
|
3361
|
+
#
|
3362
|
+
attr_reader :get_data_source
|
3363
|
+
##
|
3364
|
+
# RPC-specific configuration for `update_data_source`
|
3365
|
+
# @return [::Gapic::Config::Method]
|
3366
|
+
#
|
3367
|
+
attr_reader :update_data_source
|
3368
|
+
##
|
3369
|
+
# RPC-specific configuration for `list_backups`
|
3370
|
+
# @return [::Gapic::Config::Method]
|
3371
|
+
#
|
3372
|
+
attr_reader :list_backups
|
3373
|
+
##
|
3374
|
+
# RPC-specific configuration for `get_backup`
|
3375
|
+
# @return [::Gapic::Config::Method]
|
3376
|
+
#
|
3377
|
+
attr_reader :get_backup
|
3378
|
+
##
|
3379
|
+
# RPC-specific configuration for `update_backup`
|
3380
|
+
# @return [::Gapic::Config::Method]
|
3381
|
+
#
|
3382
|
+
attr_reader :update_backup
|
3383
|
+
##
|
3384
|
+
# RPC-specific configuration for `delete_backup`
|
3385
|
+
# @return [::Gapic::Config::Method]
|
3386
|
+
#
|
3387
|
+
attr_reader :delete_backup
|
3388
|
+
##
|
3389
|
+
# RPC-specific configuration for `restore_backup`
|
3390
|
+
# @return [::Gapic::Config::Method]
|
3391
|
+
#
|
3392
|
+
attr_reader :restore_backup
|
3393
|
+
##
|
3394
|
+
# RPC-specific configuration for `create_backup_plan`
|
3395
|
+
# @return [::Gapic::Config::Method]
|
3396
|
+
#
|
3397
|
+
attr_reader :create_backup_plan
|
3398
|
+
##
|
3399
|
+
# RPC-specific configuration for `get_backup_plan`
|
3400
|
+
# @return [::Gapic::Config::Method]
|
3401
|
+
#
|
3402
|
+
attr_reader :get_backup_plan
|
3403
|
+
##
|
3404
|
+
# RPC-specific configuration for `list_backup_plans`
|
3405
|
+
# @return [::Gapic::Config::Method]
|
3406
|
+
#
|
3407
|
+
attr_reader :list_backup_plans
|
3408
|
+
##
|
3409
|
+
# RPC-specific configuration for `delete_backup_plan`
|
3410
|
+
# @return [::Gapic::Config::Method]
|
3411
|
+
#
|
3412
|
+
attr_reader :delete_backup_plan
|
3413
|
+
##
|
3414
|
+
# RPC-specific configuration for `create_backup_plan_association`
|
3415
|
+
# @return [::Gapic::Config::Method]
|
3416
|
+
#
|
3417
|
+
attr_reader :create_backup_plan_association
|
3418
|
+
##
|
3419
|
+
# RPC-specific configuration for `get_backup_plan_association`
|
3420
|
+
# @return [::Gapic::Config::Method]
|
3421
|
+
#
|
3422
|
+
attr_reader :get_backup_plan_association
|
3423
|
+
##
|
3424
|
+
# RPC-specific configuration for `list_backup_plan_associations`
|
3425
|
+
# @return [::Gapic::Config::Method]
|
3426
|
+
#
|
3427
|
+
attr_reader :list_backup_plan_associations
|
3428
|
+
##
|
3429
|
+
# RPC-specific configuration for `delete_backup_plan_association`
|
3430
|
+
# @return [::Gapic::Config::Method]
|
3431
|
+
#
|
3432
|
+
attr_reader :delete_backup_plan_association
|
3433
|
+
##
|
3434
|
+
# RPC-specific configuration for `trigger_backup`
|
3435
|
+
# @return [::Gapic::Config::Method]
|
3436
|
+
#
|
3437
|
+
attr_reader :trigger_backup
|
812
3438
|
|
813
3439
|
# @private
|
814
3440
|
def initialize parent_rpcs = nil
|
@@ -820,6 +3446,52 @@ module Google
|
|
820
3446
|
@create_management_server = ::Gapic::Config::Method.new create_management_server_config
|
821
3447
|
delete_management_server_config = parent_rpcs.delete_management_server if parent_rpcs.respond_to? :delete_management_server
|
822
3448
|
@delete_management_server = ::Gapic::Config::Method.new delete_management_server_config
|
3449
|
+
create_backup_vault_config = parent_rpcs.create_backup_vault if parent_rpcs.respond_to? :create_backup_vault
|
3450
|
+
@create_backup_vault = ::Gapic::Config::Method.new create_backup_vault_config
|
3451
|
+
list_backup_vaults_config = parent_rpcs.list_backup_vaults if parent_rpcs.respond_to? :list_backup_vaults
|
3452
|
+
@list_backup_vaults = ::Gapic::Config::Method.new list_backup_vaults_config
|
3453
|
+
fetch_usable_backup_vaults_config = parent_rpcs.fetch_usable_backup_vaults if parent_rpcs.respond_to? :fetch_usable_backup_vaults
|
3454
|
+
@fetch_usable_backup_vaults = ::Gapic::Config::Method.new fetch_usable_backup_vaults_config
|
3455
|
+
get_backup_vault_config = parent_rpcs.get_backup_vault if parent_rpcs.respond_to? :get_backup_vault
|
3456
|
+
@get_backup_vault = ::Gapic::Config::Method.new get_backup_vault_config
|
3457
|
+
update_backup_vault_config = parent_rpcs.update_backup_vault if parent_rpcs.respond_to? :update_backup_vault
|
3458
|
+
@update_backup_vault = ::Gapic::Config::Method.new update_backup_vault_config
|
3459
|
+
delete_backup_vault_config = parent_rpcs.delete_backup_vault if parent_rpcs.respond_to? :delete_backup_vault
|
3460
|
+
@delete_backup_vault = ::Gapic::Config::Method.new delete_backup_vault_config
|
3461
|
+
list_data_sources_config = parent_rpcs.list_data_sources if parent_rpcs.respond_to? :list_data_sources
|
3462
|
+
@list_data_sources = ::Gapic::Config::Method.new list_data_sources_config
|
3463
|
+
get_data_source_config = parent_rpcs.get_data_source if parent_rpcs.respond_to? :get_data_source
|
3464
|
+
@get_data_source = ::Gapic::Config::Method.new get_data_source_config
|
3465
|
+
update_data_source_config = parent_rpcs.update_data_source if parent_rpcs.respond_to? :update_data_source
|
3466
|
+
@update_data_source = ::Gapic::Config::Method.new update_data_source_config
|
3467
|
+
list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
|
3468
|
+
@list_backups = ::Gapic::Config::Method.new list_backups_config
|
3469
|
+
get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
|
3470
|
+
@get_backup = ::Gapic::Config::Method.new get_backup_config
|
3471
|
+
update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup
|
3472
|
+
@update_backup = ::Gapic::Config::Method.new update_backup_config
|
3473
|
+
delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
|
3474
|
+
@delete_backup = ::Gapic::Config::Method.new delete_backup_config
|
3475
|
+
restore_backup_config = parent_rpcs.restore_backup if parent_rpcs.respond_to? :restore_backup
|
3476
|
+
@restore_backup = ::Gapic::Config::Method.new restore_backup_config
|
3477
|
+
create_backup_plan_config = parent_rpcs.create_backup_plan if parent_rpcs.respond_to? :create_backup_plan
|
3478
|
+
@create_backup_plan = ::Gapic::Config::Method.new create_backup_plan_config
|
3479
|
+
get_backup_plan_config = parent_rpcs.get_backup_plan if parent_rpcs.respond_to? :get_backup_plan
|
3480
|
+
@get_backup_plan = ::Gapic::Config::Method.new get_backup_plan_config
|
3481
|
+
list_backup_plans_config = parent_rpcs.list_backup_plans if parent_rpcs.respond_to? :list_backup_plans
|
3482
|
+
@list_backup_plans = ::Gapic::Config::Method.new list_backup_plans_config
|
3483
|
+
delete_backup_plan_config = parent_rpcs.delete_backup_plan if parent_rpcs.respond_to? :delete_backup_plan
|
3484
|
+
@delete_backup_plan = ::Gapic::Config::Method.new delete_backup_plan_config
|
3485
|
+
create_backup_plan_association_config = parent_rpcs.create_backup_plan_association if parent_rpcs.respond_to? :create_backup_plan_association
|
3486
|
+
@create_backup_plan_association = ::Gapic::Config::Method.new create_backup_plan_association_config
|
3487
|
+
get_backup_plan_association_config = parent_rpcs.get_backup_plan_association if parent_rpcs.respond_to? :get_backup_plan_association
|
3488
|
+
@get_backup_plan_association = ::Gapic::Config::Method.new get_backup_plan_association_config
|
3489
|
+
list_backup_plan_associations_config = parent_rpcs.list_backup_plan_associations if parent_rpcs.respond_to? :list_backup_plan_associations
|
3490
|
+
@list_backup_plan_associations = ::Gapic::Config::Method.new list_backup_plan_associations_config
|
3491
|
+
delete_backup_plan_association_config = parent_rpcs.delete_backup_plan_association if parent_rpcs.respond_to? :delete_backup_plan_association
|
3492
|
+
@delete_backup_plan_association = ::Gapic::Config::Method.new delete_backup_plan_association_config
|
3493
|
+
trigger_backup_config = parent_rpcs.trigger_backup if parent_rpcs.respond_to? :trigger_backup
|
3494
|
+
@trigger_backup = ::Gapic::Config::Method.new trigger_backup_config
|
823
3495
|
|
824
3496
|
yield self if block_given?
|
825
3497
|
end
|