Class: Google::Cloud::BackupDR::V1::BackupDR::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/backupdr/v1/backupdr/rest/client.rb

Overview

REST client for the BackupDR service.

The BackupDR Service

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#backup_path, #backup_plan_association_path, #backup_plan_path, #backup_plan_revision_path, #backup_vault_path, #cluster_path, #crypto_key_path, #crypto_key_version_path, #data_source_path, #data_source_reference_path, #instance_path, #location_path, #management_server_path, #storage_pool_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new BackupDR REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the BackupDR client.

Yield Parameters:



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 200

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::BackupDR::V1::BackupDR::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @backup_dr_stub = ::Google::Cloud::BackupDR::V1::BackupDR::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @backup_dr_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @backup_dr_stub.endpoint
    config.universe_domain = @backup_dr_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @backup_dr_stub.logger if config.respond_to? :logger=
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @backup_dr_stub.endpoint
    config.universe_domain = @backup_dr_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @backup_dr_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Rest::Client (readonly)

Get the associated client for mix-in of the IAMPolicy.

Returns:

  • (Google::Iam::V1::IAMPolicy::Rest::Client)


286
287
288
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 286

def iam_policy_client
  @iam_policy_client
end

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Rest::Client)


279
280
281
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 279

def location_client
  @location_client
end

#operations_client::Google::Cloud::BackupDR::V1::BackupDR::Rest::Operations (readonly)

Get the associated client for long-running operations.



272
273
274
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 272

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the BackupDR Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all BackupDR clients
::Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 66

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "BackupDR", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.list_management_servers.timeout = 60.0
    default_config.rpcs.list_management_servers.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_management_server.timeout = 60.0
    default_config.rpcs.get_management_server.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_management_server.timeout = 60.0

    default_config.rpcs.delete_management_server.timeout = 60.0

    default_config.rpcs.create_backup_vault.timeout = 60.0
    default_config.rpcs.create_backup_vault.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_backup_vaults.timeout = 60.0
    default_config.rpcs.list_backup_vaults.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.fetch_usable_backup_vaults.timeout = 60.0
    default_config.rpcs.fetch_usable_backup_vaults.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_backup_vault.timeout = 60.0
    default_config.rpcs.get_backup_vault.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.update_backup_vault.timeout = 60.0

    default_config.rpcs.delete_backup_vault.timeout = 60.0
    default_config.rpcs.delete_backup_vault.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_data_sources.timeout = 60.0
    default_config.rpcs.list_data_sources.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_data_source.timeout = 60.0
    default_config.rpcs.get_data_source.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.update_data_source.timeout = 60.0

    default_config.rpcs.list_backups.timeout = 60.0
    default_config.rpcs.list_backups.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_backup.timeout = 60.0
    default_config.rpcs.get_backup.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.update_backup.timeout = 60.0

    default_config.rpcs.restore_backup.timeout = 60.0

    default_config.rpcs.initialize_service.timeout = 60.0
    default_config.rpcs.initialize_service.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the BackupDR Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



170
171
172
173
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 170

def configure
  yield @config if block_given?
  @config
end

#create_backup_plan(request, options = nil) ⇒ ::Gapic::Operation #create_backup_plan(parent: nil, backup_plan_id: nil, backup_plan: nil, request_id: nil) ⇒ ::Gapic::Operation

Create a BackupPlan

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::CreateBackupPlanRequest.new

# Call the create_backup_plan method.
result = client.create_backup_plan request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_backup_plan(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_backup_plan via a request object, either of type CreateBackupPlanRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::CreateBackupPlanRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_backup_plan(parent: nil, backup_plan_id: nil, backup_plan: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_backup_plan via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The BackupPlan project and location in the format projects/{project}/locations/{location}. In Cloud BackupDR locations map to GCP regions, for example us-central1.

    • backup_plan_id (::String) (defaults to: nil)

      Required. The name of the BackupPlan to create. The name must be unique for the specified project and location.The name must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, /[a-z][a-z0-9-]{,62}/.

    • backup_plan (::Google::Cloud::BackupDR::V1::BackupPlan, ::Hash) (defaults to: nil)

      Required. The BackupPlan resource object to create.

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2310

def create_backup_plan request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateBackupPlanRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_backup_plan..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_backup_plan.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_backup_plan.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.create_backup_plan request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_backup_plan_association(request, options = nil) ⇒ ::Gapic::Operation #create_backup_plan_association(parent: nil, backup_plan_association_id: nil, backup_plan_association: nil, request_id: nil) ⇒ ::Gapic::Operation

Create a BackupPlanAssociation

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest.new

# Call the create_backup_plan_association method.
result = client.create_backup_plan_association request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_backup_plan_association(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_backup_plan_association via a request object, either of type CreateBackupPlanAssociationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_backup_plan_association(parent: nil, backup_plan_association_id: nil, backup_plan_association: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_backup_plan_association via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The backup plan association project and location in the format projects/{project_id}/locations/{location}. In Cloud BackupDR locations map to GCP regions, for example us-central1.

    • backup_plan_association_id (::String) (defaults to: nil)

      Required. The name of the backup plan association to create. The name must be unique for the specified project and location.

    • backup_plan_association (::Google::Cloud::BackupDR::V1::BackupPlanAssociation, ::Hash) (defaults to: nil)

      Required. The resource being created

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2999

def create_backup_plan_association request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateBackupPlanAssociationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_backup_plan_association..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_backup_plan_association.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_backup_plan_association.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.create_backup_plan_association request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_backup_vault(request, options = nil) ⇒ ::Gapic::Operation #create_backup_vault(parent: nil, backup_vault_id: nil, backup_vault: nil, request_id: nil, validate_only: nil) ⇒ ::Gapic::Operation

Creates a new BackupVault in a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::CreateBackupVaultRequest.new

# Call the create_backup_vault method.
result = client.create_backup_vault request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_backup_vault(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_backup_vault via a request object, either of type CreateBackupVaultRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::CreateBackupVaultRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_backup_vault(parent: nil, backup_vault_id: nil, backup_vault: nil, request_id: nil, validate_only: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_backup_vault via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Value for parent.

    • backup_vault_id (::String) (defaults to: nil)

      Required. ID of the requesting object If auto-generating ID server-side, remove this field and backup_vault_id from the method_signature of Create RPC

    • backup_vault (::Google::Cloud::BackupDR::V1::BackupVault, ::Hash) (defaults to: nil)

      Required. The resource being created

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • validate_only (::Boolean) (defaults to: nil)

      Optional. Only validate the request, but do not perform mutations. The default is 'false'.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 759

def create_backup_vault request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateBackupVaultRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_backup_vault..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_backup_vault.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_backup_vault.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.create_backup_vault request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_management_server(request, options = nil) ⇒ ::Gapic::Operation #create_management_server(parent: nil, management_server_id: nil, management_server: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new ManagementServer in a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::CreateManagementServerRequest.new

# Call the create_management_server method.
result = client.create_management_server request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_management_server(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_management_server via a request object, either of type CreateManagementServerRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::CreateManagementServerRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_management_server(parent: nil, management_server_id: nil, management_server: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_management_server via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The management server project and location in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR locations map to Google Cloud regions, for example us-central1.

    • management_server_id (::String) (defaults to: nil)

      Required. The name of the management server to create. The name must be unique for the specified project and location.

    • management_server (::Google::Cloud::BackupDR::V1::ManagementServer, ::Hash) (defaults to: nil)

      Required. A [management server resource][google.cloud.backupdr.v1.ManagementServer]

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 548

def create_management_server request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::CreateManagementServerRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_management_server..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_management_server.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_management_server.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.create_management_server request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_backup(request, options = nil) ⇒ ::Gapic::Operation #delete_backup(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a Backup.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::DeleteBackupRequest.new

# Call the delete_backup method.
result = client.delete_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_backup(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup via a request object, either of type DeleteBackupRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::DeleteBackupRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_backup(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource.

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2065

def delete_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_backup..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_backup.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.delete_backup request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_backup_plan(request, options = nil) ⇒ ::Gapic::Operation #delete_backup_plan(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single BackupPlan.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::DeleteBackupPlanRequest.new

# Call the delete_backup_plan method.
result = client.delete_backup_plan request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_backup_plan(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup_plan via a request object, either of type DeleteBackupPlanRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::DeleteBackupPlanRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_backup_plan(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup_plan via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the BackupPlan to delete.

      Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2709

def delete_backup_plan request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteBackupPlanRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_backup_plan..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_backup_plan.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_backup_plan.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.delete_backup_plan request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_backup_plan_association(request, options = nil) ⇒ ::Gapic::Operation #delete_backup_plan_association(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single BackupPlanAssociation.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::DeleteBackupPlanAssociationRequest.new

# Call the delete_backup_plan_association method.
result = client.delete_backup_plan_association request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_backup_plan_association(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup_plan_association via a request object, either of type DeleteBackupPlanAssociationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::DeleteBackupPlanAssociationRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_backup_plan_association(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup_plan_association via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the backup plan association resource, in the format projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 3502

def delete_backup_plan_association request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteBackupPlanAssociationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_backup_plan_association..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_backup_plan_association.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_backup_plan_association.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.delete_backup_plan_association request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_backup_vault(request, options = nil) ⇒ ::Gapic::Operation #delete_backup_vault(name: nil, request_id: nil, force: nil, etag: nil, validate_only: nil, allow_missing: nil, ignore_backup_plan_references: nil) ⇒ ::Gapic::Operation

Deletes a BackupVault.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::DeleteBackupVaultRequest.new

# Call the delete_backup_vault method.
result = client.delete_backup_vault request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_backup_vault(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup_vault via a request object, either of type DeleteBackupVaultRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::DeleteBackupVaultRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_backup_vault(name: nil, request_id: nil, force: nil, etag: nil, validate_only: nil, allow_missing: nil, ignore_backup_plan_references: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_backup_vault via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource.

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • force (::Boolean) (defaults to: nil)

      Optional. If set to true, any data source from this backup vault will also be deleted.

    • etag (::String) (defaults to: nil)

      The current etag of the backup vault. If an etag is provided and does not match the current etag of the connection, deletion will be blocked.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. Only validate the request, but do not perform mutations. The default is 'false'.

    • allow_missing (::Boolean) (defaults to: nil)

      Optional. If true and the BackupVault is not found, the request will succeed but no action will be taken.

    • ignore_backup_plan_references (::Boolean) (defaults to: nil)

      Optional. If set to true, backupvault deletion will proceed even if there are backup plans referencing the backupvault. The default is 'false'.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1275

def delete_backup_vault request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteBackupVaultRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_backup_vault..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_backup_vault.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_backup_vault.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.delete_backup_vault request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_management_server(request, options = nil) ⇒ ::Gapic::Operation #delete_management_server(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single ManagementServer.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::DeleteManagementServerRequest.new

# Call the delete_management_server method.
result = client.delete_management_server request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_management_server(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_management_server via a request object, either of type DeleteManagementServerRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::DeleteManagementServerRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_management_server(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_management_server via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 649

def delete_management_server request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::DeleteManagementServerRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_management_server..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_management_server.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_management_server.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.delete_management_server request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_backup_plan_associations_for_resource_type(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation> #fetch_backup_plan_associations_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>

List BackupPlanAssociations for a given resource type.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::FetchBackupPlanAssociationsForResourceTypeRequest.new

# Call the fetch_backup_plan_associations_for_resource_type method.
result = client.fetch_backup_plan_associations_for_resource_type request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::BackupPlanAssociation.
  p item
end

Overloads:

  • #fetch_backup_plan_associations_for_resource_type(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>

    Pass arguments to fetch_backup_plan_associations_for_resource_type via a request object, either of type FetchBackupPlanAssociationsForResourceTypeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::FetchBackupPlanAssociationsForResourceTypeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #fetch_backup_plan_associations_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>

    Pass arguments to fetch_backup_plan_associations_for_resource_type via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource name. Format: projects/{project}/locations/{location}

    • resource_type (::String) (defaults to: nil)

      Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of BackupPlanAssociations to return. The service may return fewer than this value. If unspecified, at most 50 BackupPlanAssociations will be returned. The maximum value is 100; values above 100 will be coerced to 100.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous call of FetchBackupPlanAssociationsForResourceType. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to FetchBackupPlanAssociationsForResourceType must match the call that provided the page token.

    • filter (::String) (defaults to: nil)

      Optional. A filter expression that filters the results fetched in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. Supported fields:

      • resource
      • backup_plan
      • state
      • data_source
      • cloud_sql_instance_backup_plan_association_properties.instance_create_time
    • order_by (::String) (defaults to: nil)

      Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending.

      Supported fields:

      • name

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 3400

def fetch_backup_plan_associations_for_resource_type request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::FetchBackupPlanAssociationsForResourceTypeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_backup_plan_associations_for_resource_type..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_backup_plan_associations_for_resource_type.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_backup_plan_associations_for_resource_type.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.fetch_backup_plan_associations_for_resource_type request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :fetch_backup_plan_associations_for_resource_type, "backup_plan_associations", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_backups_for_resource_type(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup> #fetch_backups_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>

Fetch Backups for a given resource type.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::FetchBackupsForResourceTypeRequest.new

# Call the fetch_backups_for_resource_type method.
result = client.fetch_backups_for_resource_type request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::Backup.
  p item
end

Overloads:

  • #fetch_backups_for_resource_type(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>

    Pass arguments to fetch_backups_for_resource_type via a request object, either of type FetchBackupsForResourceTypeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::FetchBackupsForResourceTypeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #fetch_backups_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>

    Pass arguments to fetch_backups_for_resource_type via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Datasources are the parent resource for the backups. Format: projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId}

    • resource_type (::String) (defaults to: nil)

      Required. The type of the GCP resource. Ex: sqladmin.googleapis.com/Instance

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of Backups to return. The service may return fewer than this value. If unspecified, at most 50 Backups will be returned. The maximum value is 100; values above 100 will be coerced to 100.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous call of FetchBackupsForResourceType. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to FetchBackupsForResourceType must match the call that provided the page token.

    • filter (::String) (defaults to: nil)

      Optional. A filter expression that filters the results fetched in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. Supported fields:

    • order_by (::String) (defaults to: nil)

      Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending.

    • view (::Google::Cloud::BackupDR::V1::BackupView) (defaults to: nil)

      Optional. This parameter is used to specify the view of the backup. If not specified, the default view is BASIC.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1775

def fetch_backups_for_resource_type request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::FetchBackupsForResourceTypeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_backups_for_resource_type..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_backups_for_resource_type.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_backups_for_resource_type.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.fetch_backups_for_resource_type request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :fetch_backups_for_resource_type, "backups", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_data_source_references_for_resource_type(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference> #fetch_data_source_references_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>

Fetch DataSourceReferences for a given project, location and resource type.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::FetchDataSourceReferencesForResourceTypeRequest.new

# Call the fetch_data_source_references_for_resource_type method.
result = client.fetch_data_source_references_for_resource_type request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::DataSourceReference.
  p item
end

Overloads:

  • #fetch_data_source_references_for_resource_type(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>

    Pass arguments to fetch_data_source_references_for_resource_type via a request object, either of type FetchDataSourceReferencesForResourceTypeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::FetchDataSourceReferencesForResourceTypeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #fetch_data_source_references_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>

    Pass arguments to fetch_data_source_references_for_resource_type via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource name. Format: projects/{project}/locations/{location}

    • resource_type (::String) (defaults to: nil)

      Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of DataSourceReferences to return. The service may return fewer than this value. If unspecified, at most 50 DataSourceReferences will be returned. The maximum value is 100; values above 100 will be coerced to 100.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous call of FetchDataSourceReferencesForResourceType. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to FetchDataSourceReferencesForResourceType must match the call that provided the page token.

    • filter (::String) (defaults to: nil)

      Optional. A filter expression that filters the results fetched in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. Supported fields:

      • data_source
      • data_source_gcp_resource_info.gcp_resourcename
      • data_source_backup_config_state
      • data_source_backup_count
      • data_source_backup_config_info.last_backup_state
      • data_source_gcp_resource_info.gcp_resourcename
      • data_source_gcp_resource_info.type
      • data_source_gcp_resource_info.location
      • data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time
    • order_by (::String) (defaults to: nil)

      Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending.

      Supported fields:

      • name

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 3921

def fetch_data_source_references_for_resource_type request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::FetchDataSourceReferencesForResourceTypeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_data_source_references_for_resource_type..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_data_source_references_for_resource_type.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_data_source_references_for_resource_type.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.fetch_data_source_references_for_resource_type request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :fetch_data_source_references_for_resource_type, "data_source_references", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_usable_backup_vaults(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault> #fetch_usable_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>

FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::FetchUsableBackupVaultsRequest.new

# Call the fetch_usable_backup_vaults method.
result = client.fetch_usable_backup_vaults request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::BackupVault.
  p item
end

Overloads:

  • #fetch_usable_backup_vaults(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>

    Pass arguments to fetch_usable_backup_vaults via a request object, either of type FetchUsableBackupVaultsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::FetchUsableBackupVaultsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #fetch_usable_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>

    Pass arguments to fetch_usable_backup_vaults via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The project and location for which to retrieve backupvault stores information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example us-central1. To retrieve backupvault stores for all locations, use "-" for the '{location}' value.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results.

    • order_by (::String) (defaults to: nil)

      Optional. Hint for how to order the results.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 960

def fetch_usable_backup_vaults request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::FetchUsableBackupVaultsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_usable_backup_vaults..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_usable_backup_vaults.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_usable_backup_vaults.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.fetch_usable_backup_vaults request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :fetch_usable_backup_vaults, "backup_vaults", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_backup(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::Backup #get_backup(name: nil, view: nil) ⇒ ::Google::Cloud::BackupDR::V1::Backup

Gets details of a Backup.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::GetBackupRequest.new

# Call the get_backup method.
result = client.get_backup request

# The returned object is of type Google::Cloud::BackupDR::V1::Backup.
p result

Overloads:

  • #get_backup(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::Backup

    Pass arguments to get_backup via a request object, either of type GetBackupRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::GetBackupRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_backup(name: nil, view: nil) ⇒ ::Google::Cloud::BackupDR::V1::Backup

    Pass arguments to get_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}'

    • view (::Google::Cloud::BackupDR::V1::BackupView) (defaults to: nil)

      Optional. Reserved for future use to provide a BASIC & FULL view of Backup resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1859

def get_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_backup..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_backup.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.get_backup request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_backup_plan(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlan #get_backup_plan(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlan

Gets details of a single BackupPlan.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::GetBackupPlanRequest.new

# Call the get_backup_plan method.
result = client.get_backup_plan request

# The returned object is of type Google::Cloud::BackupDR::V1::BackupPlan.
p result

Overloads:

  • #get_backup_plan(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlan

    Pass arguments to get_backup_plan via a request object, either of type GetBackupPlanRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::GetBackupPlanRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_backup_plan(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlan

    Pass arguments to get_backup_plan via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the BackupPlan to retrieve.

      Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2502

def get_backup_plan request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupPlanRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_backup_plan..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_backup_plan.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_backup_plan.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.get_backup_plan request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_backup_plan_association(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlanAssociation #get_backup_plan_association(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlanAssociation

Gets details of a single BackupPlanAssociation.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::GetBackupPlanAssociationRequest.new

# Call the get_backup_plan_association method.
result = client.get_backup_plan_association request

# The returned object is of type Google::Cloud::BackupDR::V1::BackupPlanAssociation.
p result

Overloads:

  • #get_backup_plan_association(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlanAssociation

    Pass arguments to get_backup_plan_association via a request object, either of type GetBackupPlanAssociationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::GetBackupPlanAssociationRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_backup_plan_association(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlanAssociation

    Pass arguments to get_backup_plan_association via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the backup plan association resource, in the format projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 3189

def get_backup_plan_association request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupPlanAssociationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_backup_plan_association..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_backup_plan_association.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_backup_plan_association.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.get_backup_plan_association request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_backup_plan_revision(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlanRevision #get_backup_plan_revision(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlanRevision

Gets details of a single BackupPlanRevision.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::GetBackupPlanRevisionRequest.new

# Call the get_backup_plan_revision method.
result = client.get_backup_plan_revision request

# The returned object is of type Google::Cloud::BackupDR::V1::BackupPlanRevision.
p result

Overloads:

  • #get_backup_plan_revision(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlanRevision

    Pass arguments to get_backup_plan_revision via a request object, either of type GetBackupPlanRevisionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::GetBackupPlanRevisionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_backup_plan_revision(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupPlanRevision

    Pass arguments to get_backup_plan_revision via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the BackupPlanRevision to retrieve.

      Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2792

def get_backup_plan_revision request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupPlanRevisionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_backup_plan_revision..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_backup_plan_revision.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_backup_plan_revision.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.get_backup_plan_revision request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_backup_vault(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupVault #get_backup_vault(name: nil, view: nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupVault

Gets details of a BackupVault.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::GetBackupVaultRequest.new

# Call the get_backup_vault method.
result = client.get_backup_vault request

# The returned object is of type Google::Cloud::BackupDR::V1::BackupVault.
p result

Overloads:

  • #get_backup_vault(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupVault

    Pass arguments to get_backup_vault via a request object, either of type GetBackupVaultRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::GetBackupVaultRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_backup_vault(name: nil, view: nil) ⇒ ::Google::Cloud::BackupDR::V1::BackupVault

    Pass arguments to get_backup_vault via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the backupvault store resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}'

    • view (::Google::Cloud::BackupDR::V1::BackupVaultView) (defaults to: nil)

      Optional. Reserved for future use to provide a BASIC & FULL view of Backup Vault

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1044

def get_backup_vault request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetBackupVaultRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_backup_vault..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_backup_vault.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_backup_vault.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.get_backup_vault request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_data_source(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::DataSource #get_data_source(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::DataSource

Gets details of a DataSource.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::GetDataSourceRequest.new

# Call the get_data_source method.
result = client.get_data_source request

# The returned object is of type Google::Cloud::BackupDR::V1::DataSource.
p result

Overloads:

  • #get_data_source(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::DataSource

    Pass arguments to get_data_source via a request object, either of type GetDataSourceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::GetDataSourceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_data_source(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::DataSource

    Pass arguments to get_data_source via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}'

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1454

def get_data_source request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetDataSourceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_data_source..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_data_source.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_data_source.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.get_data_source request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_data_source_reference(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::DataSourceReference #get_data_source_reference(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::DataSourceReference

Gets details of a single DataSourceReference.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::GetDataSourceReferenceRequest.new

# Call the get_data_source_reference method.
result = client.get_data_source_reference request

# The returned object is of type Google::Cloud::BackupDR::V1::DataSourceReference.
p result

Overloads:

  • #get_data_source_reference(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::DataSourceReference

    Pass arguments to get_data_source_reference via a request object, either of type GetDataSourceReferenceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::GetDataSourceReferenceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_data_source_reference(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::DataSourceReference

    Pass arguments to get_data_source_reference via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the DataSourceReference to retrieve. Format: projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 3688

def get_data_source_reference request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetDataSourceReferenceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_data_source_reference..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_data_source_reference.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_data_source_reference.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.get_data_source_reference request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_management_server(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::ManagementServer #get_management_server(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::ManagementServer

Gets details of a single ManagementServer.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::GetManagementServerRequest.new

# Call the get_management_server method.
result = client.get_management_server request

# The returned object is of type Google::Cloud::BackupDR::V1::ManagementServer.
p result

Overloads:

  • #get_management_server(request, options = nil) ⇒ ::Google::Cloud::BackupDR::V1::ManagementServer

    Pass arguments to get_management_server via a request object, either of type GetManagementServerRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::GetManagementServerRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_management_server(name: nil) ⇒ ::Google::Cloud::BackupDR::V1::ManagementServer

    Pass arguments to get_management_server via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the management server resource name, in the format 'projects/{project_id}/locations/{location}/managementServers/{resource_name}'

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 441

def get_management_server request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::GetManagementServerRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_management_server..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_management_server.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_management_server.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.get_management_server request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#initialize_service(request, options = nil) ⇒ ::Gapic::Operation #initialize_service(name: nil, resource_type: nil, request_id: nil, cloud_sql_instance_initialization_config: nil) ⇒ ::Gapic::Operation

Initializes the service related config for a project.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::InitializeServiceRequest.new

# Call the initialize_service method.
result = client.initialize_service request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #initialize_service(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to initialize_service via a request object, either of type InitializeServiceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::InitializeServiceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #initialize_service(name: nil, resource_type: nil, request_id: nil, cloud_sql_instance_initialization_config: nil) ⇒ ::Gapic::Operation

    Pass arguments to initialize_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the serviceConfig used to initialize the service. Format: projects/{project_id}/locations/{location}/serviceConfig.

    • resource_type (::String) (defaults to: nil)

      Required. The resource type to which the default service config will be applied. Examples include, "compute.googleapis.com/Instance" and "storage.googleapis.com/Bucket".

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • cloud_sql_instance_initialization_config (::Google::Cloud::BackupDR::V1::CloudSqlInstanceInitializationConfig, ::Hash) (defaults to: nil)

      Optional. The configuration for initializing a Cloud SQL instance.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 4030

def initialize_service request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::InitializeServiceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.initialize_service..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.initialize_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.initialize_service.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.initialize_service request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_backup_plan_associations(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation> #list_backup_plan_associations(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>

Lists BackupPlanAssociations in a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::ListBackupPlanAssociationsRequest.new

# Call the list_backup_plan_associations method.
result = client.list_backup_plan_associations request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::BackupPlanAssociation.
  p item
end

Overloads:

  • #list_backup_plan_associations(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>

    Pass arguments to list_backup_plan_associations via a request object, either of type ListBackupPlanAssociationsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::ListBackupPlanAssociationsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_backup_plan_associations(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanAssociation>

    Pass arguments to list_backup_plan_associations via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The project and location for which to retrieve backup Plan Associations information, in the format projects/{project_id}/locations/{location}. In Cloud BackupDR, locations map to GCP regions, for example us-central1. To retrieve backup plan associations for all locations, use "-" for the {location} value.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 3283

def list_backup_plan_associations request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupPlanAssociationsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_backup_plan_associations..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_backup_plan_associations.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_backup_plan_associations.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.list_backup_plan_associations request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_plan_associations, "backup_plan_associations", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_backup_plan_revisions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanRevision> #list_backup_plan_revisions(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanRevision>

Lists BackupPlanRevisions in a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::ListBackupPlanRevisionsRequest.new

# Call the list_backup_plan_revisions method.
result = client.list_backup_plan_revisions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::BackupPlanRevision.
  p item
end

Overloads:

  • #list_backup_plan_revisions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanRevision>

    Pass arguments to list_backup_plan_revisions via a request object, either of type ListBackupPlanRevisionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::ListBackupPlanRevisionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_backup_plan_revisions(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlanRevision>

    Pass arguments to list_backup_plan_revisions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The project and location for which to retrieve BackupPlanRevisions information. Format: projects/{project}/locations/{location}/backupPlans/{backup_plan}. In Cloud BackupDR, locations map to GCP regions, for e.g. us-central1.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of BackupPlans to return in a single response. If not specified, a default value will be chosen by the service. Note that the response may include a partial list and a caller should only rely on the response's next_page_token to determine if there are more instances left to be queried.

    • page_token (::String) (defaults to: nil)

      Optional. The value of next_page_token received from a previous ListBackupPlans call. Provide this to retrieve the subsequent page in a multi-page list of results. When paginating, all other parameters provided to ListBackupPlans must match the call that provided the page token.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2891

def list_backup_plan_revisions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupPlanRevisionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_backup_plan_revisions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_backup_plan_revisions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_backup_plan_revisions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.list_backup_plan_revisions request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_plan_revisions, "backup_plan_revisions", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_backup_plans(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlan> #list_backup_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlan>

Lists BackupPlans in a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::ListBackupPlansRequest.new

# Call the list_backup_plans method.
result = client.list_backup_plans request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::BackupPlan.
  p item
end

Overloads:

  • #list_backup_plans(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlan>

    Pass arguments to list_backup_plans via a request object, either of type ListBackupPlansRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::ListBackupPlansRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_backup_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupPlan>

    Pass arguments to list_backup_plans via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The project and location for which to retrieve BackupPlans information. Format: projects/{project}/locations/{location}. In Cloud BackupDR, locations map to GCP regions, for e.g. us-central1. To retrieve backup plans for all locations, use "-" for the {location} value.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of BackupPlans to return in a single response. If not specified, a default value will be chosen by the service. Note that the response may include a partial list and a caller should only rely on the response's next_page_token to determine if there are more instances left to be queried.

    • page_token (::String) (defaults to: nil)

      Optional. The value of next_page_token received from a previous ListBackupPlans call. Provide this to retrieve the subsequent page in a multi-page list of results. When paginating, all other parameters provided to ListBackupPlans must match the call that provided the page token.

    • filter (::String) (defaults to: nil)

      Optional. Field match expression used to filter the results.

    • order_by (::String) (defaults to: nil)

      Optional. Field by which to sort the results.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2606

def list_backup_plans request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupPlansRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_backup_plans..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_backup_plans.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_backup_plans.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.list_backup_plans request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_plans, "backup_plans", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_backup_vaults(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault> #list_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>

Lists BackupVaults in a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::ListBackupVaultsRequest.new

# Call the list_backup_vaults method.
result = client.list_backup_vaults request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::BackupVault.
  p item
end

Overloads:

  • #list_backup_vaults(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>

    Pass arguments to list_backup_vaults via a request object, either of type ListBackupVaultsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::ListBackupVaultsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_backup_vaults(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::BackupVault>

    Pass arguments to list_backup_vaults via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The project and location for which to retrieve backupvault stores information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example us-central1. To retrieve backupvault stores for all locations, use "-" for the '{location}' value.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results.

    • order_by (::String) (defaults to: nil)

      Optional. Hint for how to order the results.

    • view (::Google::Cloud::BackupDR::V1::BackupVaultView) (defaults to: nil)

      Optional. Reserved for future use to provide a BASIC & FULL view of Backup Vault.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 860

def list_backup_vaults request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupVaultsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_backup_vaults..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_backup_vaults.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_backup_vaults.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.list_backup_vaults request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backup_vaults, "backup_vaults", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_backups(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup> #list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>

Lists Backups in a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::ListBackupsRequest.new

# Call the list_backups method.
result = client.list_backups request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::Backup.
  p item
end

Overloads:

  • #list_backups(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>

    Pass arguments to list_backups via a request object, either of type ListBackupsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::ListBackupsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>

    Pass arguments to list_backups via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The project and location for which to retrieve backup information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example us-central1. To retrieve data sources for all locations, use "-" for the '{location}' value.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results.

    • order_by (::String) (defaults to: nil)

      Optional. Hint for how to order the results.

    • view (::Google::Cloud::BackupDR::V1::BackupView) (defaults to: nil)

      Optional. Reserved for future use to provide a BASIC & FULL view of Backup resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1662

def list_backups request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListBackupsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_backups..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_backups.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_backups.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.list_backups request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_backups, "backups", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_data_source_references(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference> #list_data_source_references(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>

Lists DataSourceReferences for a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::ListDataSourceReferencesRequest.new

# Call the list_data_source_references method.
result = client.list_data_source_references request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::DataSourceReference.
  p item
end

Overloads:

  • #list_data_source_references(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>

    Pass arguments to list_data_source_references via a request object, either of type ListDataSourceReferencesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::ListDataSourceReferencesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_data_source_references(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>

    Pass arguments to list_data_source_references via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource name. Format: projects/{project}/locations/{location}

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of DataSourceReferences to return. The service may return fewer than this value. If unspecified, at most 50 DataSourceReferences will be returned. The maximum value is 100; values above 100 will be coerced to 100.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous ListDataSourceReferences call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to ListDataSourceReferences must match the call that provided the page token.

    • filter (::String) (defaults to: nil)

      Optional. A filter expression that filters the results listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering.

      The following field and operator combinations are supported:

      • data_source_gcp_resource_info.gcp_resourcename with =, !=
      • data_source_gcp_resource_info.type with =, !=
    • order_by (::String) (defaults to: nil)

      Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending.

      Supported fields:

      • data_source
      • data_source_gcp_resource_info.gcp_resourcename

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 3800

def list_data_source_references request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListDataSourceReferencesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_data_source_references..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_data_source_references.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_data_source_references.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.list_data_source_references request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_data_source_references, "data_source_references", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_data_sources(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSource> #list_data_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSource>

Lists DataSources in a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::ListDataSourcesRequest.new

# Call the list_data_sources method.
result = client.list_data_sources request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::DataSource.
  p item
end

Overloads:

  • #list_data_sources(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSource>

    Pass arguments to list_data_sources via a request object, either of type ListDataSourcesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::ListDataSourcesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_data_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSource>

    Pass arguments to list_data_sources via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The project and location for which to retrieve data sources information, in the format 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, locations map to Google Cloud regions, for example us-central1. To retrieve data sources for all locations, use "-" for the '{location}' value.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results.

    • order_by (::String) (defaults to: nil)

      Optional. Hint for how to order the results.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1373

def list_data_sources request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListDataSourcesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_data_sources..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_data_sources.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_data_sources.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.list_data_sources request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_data_sources, "data_sources", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_management_servers(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::ManagementServer> #list_management_servers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::ManagementServer>

Lists ManagementServers in a given project and location.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::ListManagementServersRequest.new

# Call the list_management_servers method.
result = client.list_management_servers request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::BackupDR::V1::ManagementServer.
  p item
end

Overloads:

  • #list_management_servers(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::ManagementServer>

    Pass arguments to list_management_servers via a request object, either of type ListManagementServersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::ListManagementServersRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_management_servers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BackupDR::V1::ManagementServer>

    Pass arguments to list_management_servers via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The project and location for which to retrieve management servers information, in the format 'projects/{project_id}/locations/{location}'. In Cloud BackupDR, locations map to Google Cloud regions, for example us-central1. To retrieve management servers for all locations, use "-" for the '{location}' value.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results.

    • order_by (::String) (defaults to: nil)

      Optional. Hint for how to order the results.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 360

def list_management_servers request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListManagementServersRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_management_servers..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_management_servers.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_management_servers.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.list_management_servers request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_dr_stub, :list_management_servers, "management_servers", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


293
294
295
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 293

def logger
  @backup_dr_stub.logger
end

#restore_backup(request, options = nil) ⇒ ::Gapic::Operation #restore_backup(name: nil, request_id: nil, compute_instance_target_environment: nil, disk_target_environment: nil, region_disk_target_environment: nil, compute_instance_restore_properties: nil, disk_restore_properties: nil, clear_overrides_field_mask: nil) ⇒ ::Gapic::Operation

Restore from a Backup

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::RestoreBackupRequest.new

# Call the restore_backup method.
result = client.restore_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #restore_backup(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to restore_backup via a request object, either of type RestoreBackupRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::RestoreBackupRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #restore_backup(name: nil, request_id: nil, compute_instance_target_environment: nil, disk_target_environment: nil, region_disk_target_environment: nil, compute_instance_restore_properties: nil, disk_restore_properties: nil, clear_overrides_field_mask: nil) ⇒ ::Gapic::Operation

    Pass arguments to restore_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the Backup instance, in the format 'projects//locations//backupVaults//dataSources//backups/'.

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • compute_instance_target_environment (::Google::Cloud::BackupDR::V1::ComputeInstanceTargetEnvironment, ::Hash) (defaults to: nil)

      Compute Engine target environment to be used during restore.

      Note: The following parameters are mutually exclusive: compute_instance_target_environment, disk_target_environment, region_disk_target_environment. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • disk_target_environment (::Google::Cloud::BackupDR::V1::DiskTargetEnvironment, ::Hash) (defaults to: nil)

      Disk target environment to be used during restore.

      Note: The following parameters are mutually exclusive: disk_target_environment, compute_instance_target_environment, region_disk_target_environment. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • region_disk_target_environment (::Google::Cloud::BackupDR::V1::RegionDiskTargetEnvironment, ::Hash) (defaults to: nil)

      Region disk target environment to be used during restore.

      Note: The following parameters are mutually exclusive: region_disk_target_environment, compute_instance_target_environment, disk_target_environment. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • compute_instance_restore_properties (::Google::Cloud::BackupDR::V1::ComputeInstanceRestoreProperties, ::Hash) (defaults to: nil)

      Compute Engine instance properties to be overridden during restore.

      Note: The following parameters are mutually exclusive: compute_instance_restore_properties, disk_restore_properties. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • disk_restore_properties (::Google::Cloud::BackupDR::V1::DiskRestoreProperties, ::Hash) (defaults to: nil)

      Disk properties to be overridden during restore.

      Note: The following parameters are mutually exclusive: disk_restore_properties, compute_instance_restore_properties. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • clear_overrides_field_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Optional. A field mask used to clear server-side default values for fields within the instance_properties oneof.

      When a field in this mask is cleared, the server will not apply its default logic (like inheriting a value from the source) for that field.

      The most common current use case is clearing default encryption keys.

      Examples of field mask paths:

      • Compute Instance Disks: compute_instance_restore_properties.disks.*.disk_encryption_key
      • Single Disk: disk_restore_properties.disk_encryption_key

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2200

def restore_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::RestoreBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.restore_backup..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.restore_backup.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.restore_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.restore_backup request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#trigger_backup(request, options = nil) ⇒ ::Gapic::Operation #trigger_backup(name: nil, rule_id: nil, request_id: nil) ⇒ ::Gapic::Operation

Triggers a new Backup.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::TriggerBackupRequest.new

# Call the trigger_backup method.
result = client.trigger_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #trigger_backup(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to trigger_backup via a request object, either of type TriggerBackupRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::TriggerBackupRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #trigger_backup(name: nil, rule_id: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to trigger_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the backup plan association resource, in the format projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}

    • rule_id (::String) (defaults to: nil)

      Required. backup rule_id for which a backup needs to be triggered.

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 3606

def trigger_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::TriggerBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.trigger_backup..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.trigger_backup.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.trigger_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.trigger_backup request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


180
181
182
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 180

def universe_domain
  @backup_dr_stub.universe_domain
end

#update_backup(request, options = nil) ⇒ ::Gapic::Operation #update_backup(update_mask: nil, backup: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the settings of a Backup.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::UpdateBackupRequest.new

# Call the update_backup method.
result = client.update_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_backup(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_backup via a request object, either of type UpdateBackupRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::UpdateBackupRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_backup(update_mask: nil, backup: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. Field mask is used to specify the fields to be overwritten in the Backup resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail.

    • backup (::Google::Cloud::BackupDR::V1::Backup, ::Hash) (defaults to: nil)

      Required. The resource being updated

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1964

def update_backup request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateBackupRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_backup..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_backup.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_backup.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.update_backup request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_backup_plan(request, options = nil) ⇒ ::Gapic::Operation #update_backup_plan(backup_plan: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

Update a BackupPlan.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::UpdateBackupPlanRequest.new

# Call the update_backup_plan method.
result = client.update_backup_plan request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_backup_plan(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_backup_plan via a request object, either of type UpdateBackupPlanRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::UpdateBackupPlanRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_backup_plan(backup_plan: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_backup_plan via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • backup_plan (::Google::Cloud::BackupDR::V1::BackupPlan, ::Hash) (defaults to: nil)

      Required. The resource being updated

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. The list of fields to update. Field mask is used to specify the fields to be overwritten in the BackupPlan resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail. Currently, these fields are supported in update: description, schedules, retention period, adding and removing Backup Rules.

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 2420

def update_backup_plan request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateBackupPlanRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_backup_plan..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_backup_plan.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_backup_plan.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.update_backup_plan request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_backup_plan_association(request, options = nil) ⇒ ::Gapic::Operation #update_backup_plan_association(backup_plan_association: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

Update a BackupPlanAssociation.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::UpdateBackupPlanAssociationRequest.new

# Call the update_backup_plan_association method.
result = client.update_backup_plan_association request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_backup_plan_association(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_backup_plan_association via a request object, either of type UpdateBackupPlanAssociationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::UpdateBackupPlanAssociationRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_backup_plan_association(backup_plan_association: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_backup_plan_association via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • backup_plan_association (::Google::Cloud::BackupDR::V1::BackupPlanAssociation, ::Hash) (defaults to: nil)

      Required. The resource being updated

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. The list of fields to update. Field mask is used to specify the fields to be overwritten in the BackupPlanAssociation resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail. Currently backup_plan_association.backup_plan is the only supported field.

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 3108

def update_backup_plan_association request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateBackupPlanAssociationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_backup_plan_association..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_backup_plan_association.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_backup_plan_association.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.update_backup_plan_association request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_backup_vault(request, options = nil) ⇒ ::Gapic::Operation #update_backup_vault(update_mask: nil, backup_vault: nil, request_id: nil, validate_only: nil, force: nil, force_update_access_restriction: nil) ⇒ ::Gapic::Operation

Updates the settings of a BackupVault.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::UpdateBackupVaultRequest.new

# Call the update_backup_vault method.
result = client.update_backup_vault request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_backup_vault(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_backup_vault via a request object, either of type UpdateBackupVaultRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::UpdateBackupVaultRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_backup_vault(update_mask: nil, backup_vault: nil, request_id: nil, validate_only: nil, force: nil, force_update_access_restriction: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_backup_vault via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. Field mask is used to specify the fields to be overwritten in the BackupVault resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail.

    • backup_vault (::Google::Cloud::BackupDR::V1::BackupVault, ::Hash) (defaults to: nil)

      Required. The resource being updated

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • validate_only (::Boolean) (defaults to: nil)

      Optional. Only validate the request, but do not perform mutations. The default is 'false'.

    • force (::Boolean) (defaults to: nil)

      Optional. If set to true, will not check plan duration against backup vault enforcement duration.

    • force_update_access_restriction (::Boolean) (defaults to: nil)

      Optional. If set to true, we will force update access restriction even if some non compliant data sources are present. The default is 'false'.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1158

def update_backup_vault request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateBackupVaultRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_backup_vault..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_backup_vault.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_backup_vault.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.update_backup_vault request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_data_source(request, options = nil) ⇒ ::Gapic::Operation #update_data_source(update_mask: nil, data_source: nil, request_id: nil, allow_missing: nil) ⇒ ::Gapic::Operation

Updates the settings of a DataSource.

Examples:

Basic example

require "google/cloud/backupdr/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BackupDR::V1::BackupDR::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BackupDR::V1::UpdateDataSourceRequest.new

# Call the update_data_source method.
result = client.update_data_source request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_data_source(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_data_source via a request object, either of type UpdateDataSourceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BackupDR::V1::UpdateDataSourceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_data_source(update_mask: nil, data_source: nil, request_id: nil, allow_missing: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_data_source via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. Field mask is used to specify the fields to be overwritten in the DataSource resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then the request will fail.

    • data_source (::Google::Cloud::BackupDR::V1::DataSource, ::Hash) (defaults to: nil)

      Required. The resource being updated

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • allow_missing (::Boolean) (defaults to: nil)

      Optional. Enable upsert.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
# File 'lib/google/cloud/backupdr/v1/backupdr/rest/client.rb', line 1561

def update_data_source request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::UpdateDataSourceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_data_source..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BackupDR::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_data_source.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_data_source.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @backup_dr_stub.update_data_source request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end