Class: Google::Cloud::GkeBackup::V1::BackupForGKE::Client

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

Overview

Client for the BackupForGKE service.

BackupForGKE allows Kubernetes administrators to configure, execute, and manage backup and restore operations for their GKE clusters.

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_path, #cluster_path, #crypto_key_path, #location_path, #restore_path, #restore_plan_path, #volume_backup_path, #volume_restore_path

Constructor Details

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

Create a new BackupForGKE client object.

Examples:


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

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

Yields:

  • (config)

    Configure the BackupForGKE client.

Yield Parameters:



194
195
196
197
198
199
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
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 194

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/gkebackup/v1/gkebackup_services_pb"

  # 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 == Client.configure.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 = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @backup_for_gke_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::GkeBackup::V1::BackupForGKE::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::GkeBackup::V1::BackupForGKE::Operations (readonly)

Get the associated client for long-running operations.



241
242
243
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 241

def operations_client
  @operations_client
end

Class Method Details

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

Configure the BackupForGKE Client class.

See Configuration for a description of the configuration fields.

Examples:


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

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



57
58
59
60
61
62
63
64
65
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
154
155
156
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 57

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "GkeBackup", "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.create_backup_plan.timeout = 300.0

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

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

    default_config.rpcs.update_backup_plan.timeout = 60.0

    default_config.rpcs.delete_backup_plan.timeout = 60.0

    default_config.rpcs.create_backup.timeout = 120.0

    default_config.rpcs.list_backups.timeout = 60.0
    default_config.rpcs.list_backups.retry_policy = {
      initial_delay: 1.0, max_delay: 60.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: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.update_backup.timeout = 60.0

    default_config.rpcs.delete_backup.timeout = 300.0

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

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

    default_config.rpcs.create_restore_plan.timeout = 120.0

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

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

    default_config.rpcs.update_restore_plan.timeout = 60.0

    default_config.rpcs.delete_restore_plan.timeout = 60.0

    default_config.rpcs.create_restore.timeout = 120.0

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

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

    default_config.rpcs.update_restore.timeout = 60.0

    default_config.rpcs.delete_restore.timeout = 60.0

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

    default_config.rpcs.get_volume_restore.timeout = 60.0
    default_config.rpcs.get_volume_restore.retry_policy = {
      initial_delay: 1.0, max_delay: 60.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 BackupForGKE 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:



173
174
175
176
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 173

def configure
  yield @config if block_given?
  @config
end

#create_backup(request, options = nil) ⇒ ::Gapic::Operation #create_backup(parent: nil, backup: nil, backup_id: nil) ⇒ ::Gapic::Operation

Creates a Backup for the given BackupPlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::CreateBackupRequest, ::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(parent: nil, backup: nil, backup_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_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:

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

      Required. The BackupPlan within which to create the Backup. Format: projects//locations//backupPlans/*

    • backup (::Google::Cloud::GkeBackup::V1::Backup, ::Hash) (defaults to: nil)

      The Backup resource to create.

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

      The client-provided short name for the Backup resource. This name must:

      • be between 1 and 63 characters long (inclusive)
      • consist of only lower-case ASCII letters, numbers, and dashes
      • start with a lower-case letter
      • end with a lower-case letter or number
      • be unique within the set of Backups in this BackupPlan

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 812

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateBackupRequest

  # 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..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :create_backup, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Creates a new BackupPlan in a given location.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeBackup::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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::GkeBackup::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: nil, backup_plan_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 location within which to create the BackupPlan. Format: projects//locations/

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

      Required. The BackupPlan resource object to create.

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

      Required. The client-provided short name for the BackupPlan resource. This name must:

      • be between 1 and 63 characters long (inclusive)
      • consist of only lower-case ASCII letters, numbers, and dashes
      • start with a lower-case letter
      • end with a lower-case letter or number
      • be unique within the set of BackupPlans in this location

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 308

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::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 and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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_for_gke_stub.call_rpc :create_backup_plan, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_restore(request, options = nil) ⇒ ::Gapic::Operation #create_restore(parent: nil, restore: nil, restore_id: nil) ⇒ ::Gapic::Operation

Creates a new Restore for the given RestorePlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::CreateRestoreRequest, ::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_restore(parent: nil, restore: nil, restore_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_restore 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 RestorePlan within which to create the Restore. Format: projects//locations//restorePlans/*

    • restore (::Google::Cloud::GkeBackup::V1::Restore, ::Hash) (defaults to: nil)

      Required. The restore resource to create.

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

      Required. The client-provided short name for the Restore resource. This name must:

      • be between 1 and 63 characters long (inclusive)
      • consist of only lower-case ASCII letters, numbers, and dashes
      • start with a lower-case letter
      • end with a lower-case letter or number
      • be unique within the set of Restores in this RestorePlan.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 2023

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateRestoreRequest

  # 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_restore..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :create_restore, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_restore_plan(request, options = nil) ⇒ ::Gapic::Operation #create_restore_plan(parent: nil, restore_plan: nil, restore_plan_id: nil) ⇒ ::Gapic::Operation

Creates a new RestorePlan in a given location.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest, ::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_restore_plan(parent: nil, restore_plan: nil, restore_plan_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_restore_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 location within which to create the RestorePlan. Format: projects//locations/

    • restore_plan (::Google::Cloud::GkeBackup::V1::RestorePlan, ::Hash) (defaults to: nil)

      Required. The RestorePlan resource object to create.

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

      Required. The client-provided short name for the RestorePlan resource. This name must:

      • be between 1 and 63 characters long (inclusive)
      • consist of only lower-case ASCII letters, numbers, and dashes
      • start with a lower-case letter
      • end with a lower-case letter or number
      • be unique within the set of RestorePlans in this location

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1516

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest

  # 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_restore_plan..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :create_restore_plan, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Deletes an existing Backup.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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::GkeBackup::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, etag: nil, force: 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 Backup resource. Format: projects//locations//backupPlans//backups/

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

      If provided, this value must match the current value of the target Backup's etag field or the request is rejected.

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

      If set to true, any VolumeBackups below this Backup will also be deleted. Otherwise, the request will only succeed if the Backup has no VolumeBackups.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1214

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::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 and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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_for_gke_stub.call_rpc :delete_backup, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Deletes an existing BackupPlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeBackup::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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::GkeBackup::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, etag: 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. Fully qualified BackupPlan name. Format: projects//locations//backupPlans/*

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

      If provided, this value must match the current value of the target BackupPlan's etag field or the request is rejected.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 707

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::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 and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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_for_gke_stub.call_rpc :delete_backup_plan, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_restore(request, options = nil) ⇒ ::Gapic::Operation #delete_restore(name: nil, etag: nil, force: nil) ⇒ ::Gapic::Operation

Deletes an existing Restore.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::DeleteRestoreRequest, ::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_restore(name: nil, etag: nil, force: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_restore 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. Full name of the Restore Format: projects//locations//restorePlans//restores/

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

      If provided, this value must match the current value of the target Restore's etag field or the request is rejected.

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

      If set to true, any VolumeRestores below this restore will also be deleted. Otherwise, the request will only succeed if the restore has no VolumeRestores.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



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
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 2425

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteRestoreRequest

  # 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_restore..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :delete_restore, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_restore_plan(request, options = nil) ⇒ ::Gapic::Operation #delete_restore_plan(name: nil, etag: nil, force: nil) ⇒ ::Gapic::Operation

Deletes an existing RestorePlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest, ::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_restore_plan(name: nil, etag: nil, force: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_restore_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. Fully qualified RestorePlan name. Format: projects//locations//restorePlans/*

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

      If provided, this value must match the current value of the target RestorePlan's etag field or the request is rejected.

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

      If set to true, any Restores below this RestorePlan will also be deleted. Otherwise, the request will only succeed if the RestorePlan has no Restores.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1918

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest

  # 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_restore_plan..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :delete_restore_plan, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Retrieve the details of a single Backup.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::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) ⇒ ::Google::Cloud::GkeBackup::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. Full name of the Backup resource. Format: projects//locations//backupPlans//backups/

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1010

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::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 and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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_for_gke_stub.call_rpc :get_backup, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Retrieve the details of a single BackupPlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::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::GkeBackup::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. Fully qualified BackupPlan name. Format: projects//locations//backupPlans/*

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 506

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::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 and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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_for_gke_stub.call_rpc :get_backup_plan, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_restore(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::Restore #get_restore(name: nil) ⇒ ::Google::Cloud::GkeBackup::V1::Restore

Retrieves the details of a single Restore.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Google::Cloud::GkeBackup::V1::Restore.
p result

Overloads:

  • #get_restore(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::Restore

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::GetRestoreRequest, ::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_restore(name: nil) ⇒ ::Google::Cloud::GkeBackup::V1::Restore

    Pass arguments to get_restore 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 restore resource. Format: projects//locations//restorePlans//restores/

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 2221

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetRestoreRequest

  # 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_restore..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :get_restore, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_restore_plan(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::RestorePlan #get_restore_plan(name: nil) ⇒ ::Google::Cloud::GkeBackup::V1::RestorePlan

Retrieve the details of a single RestorePlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Google::Cloud::GkeBackup::V1::RestorePlan.
p result

Overloads:

  • #get_restore_plan(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::RestorePlan

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::GetRestorePlanRequest, ::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_restore_plan(name: nil) ⇒ ::Google::Cloud::GkeBackup::V1::RestorePlan

    Pass arguments to get_restore_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. Fully qualified RestorePlan name. Format: projects//locations//restorePlans/*

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1714

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetRestorePlanRequest

  # 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_restore_plan..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :get_restore_plan, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_volume_backup(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::VolumeBackup #get_volume_backup(name: nil) ⇒ ::Google::Cloud::GkeBackup::V1::VolumeBackup

Retrieve the details of a single VolumeBackup.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Google::Cloud::GkeBackup::V1::VolumeBackup.
p result

Overloads:

  • #get_volume_backup(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::VolumeBackup

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest, ::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_volume_backup(name: nil) ⇒ ::Google::Cloud::GkeBackup::V1::VolumeBackup

    Pass arguments to get_volume_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. Full name of the VolumeBackup resource. Format: projects//locations//backupPlans//backups//volumeBackups/*

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1412

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest

  # 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_volume_backup..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :get_volume_backup, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_volume_restore(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::VolumeRestore #get_volume_restore(name: nil) ⇒ ::Google::Cloud::GkeBackup::V1::VolumeRestore

Retrieve the details of a single VolumeRestore.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Google::Cloud::GkeBackup::V1::VolumeRestore.
p result

Overloads:

  • #get_volume_restore(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::VolumeRestore

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest, ::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_volume_restore(name: nil) ⇒ ::Google::Cloud::GkeBackup::V1::VolumeRestore

    Pass arguments to get_volume_restore 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. Full name of the VolumeRestore resource. Format: projects//locations//restorePlans//restores//volumeRestores/*

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 2623

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest

  # 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_volume_restore..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :get_volume_restore, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists BackupPlans in a given location.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeBackup::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 all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::GkeBackup::V1::BackupPlan.
  p response
end

Overloads:

  • #list_backup_plans(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::BackupPlan>

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::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::PagedEnumerable<::Google::Cloud::GkeBackup::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 location that contains the BackupPlans to list. Format: projects//locations/

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

      The target number of results to return in a single response. If not specified, a default value will be chosen by the service. Note that the response may inclue 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)

      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)

      Field match expression used to filter the results.

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

      Field by which to sort the results.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 419

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::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 and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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_for_gke_stub.call_rpc :list_backup_plans, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_backup_plans, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_backups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Backup> #list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Backup>

Lists the Backups for a given BackupPlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeBackup::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 all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::GkeBackup::V1::Backup.
  p response
end

Overloads:

  • #list_backups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Backup>

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::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) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::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 BackupPlan that contains the Backups to list. Format: projects//locations//backupPlans/*

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

      The target number of results to return in a single response. If not specified, a default value will be chosen by the service. Note that the response may inclue 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)

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

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

      Field match expression used to filter the results.

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

      Field by which to sort the results.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 923

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::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 and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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_for_gke_stub.call_rpc :list_backups, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_backups, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_restore_plans(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::RestorePlan> #list_restore_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::RestorePlan>

Lists RestorePlans in a given location.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::GkeBackup::V1::RestorePlan.
  p response
end

Overloads:

  • #list_restore_plans(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::RestorePlan>

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::ListRestorePlansRequest, ::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_restore_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::RestorePlan>

    Pass arguments to list_restore_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 location that contains the RestorePlans to list. Format: projects//locations/

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

      The target number of results to return in a single response. If not specified, a default value will be chosen by the service. Note that the response may inclue 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)

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

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

      Field match expression used to filter the results.

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

      Field by which to sort the results.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1627

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListRestorePlansRequest

  # 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_restore_plans..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :list_restore_plans, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_restore_plans, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_restores(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Restore> #list_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Restore>

Lists the Restores for a given RestorePlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::GkeBackup::V1::Restore.
  p response
end

Overloads:

  • #list_restores(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Restore>

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::ListRestoresRequest, ::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_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Restore>

    Pass arguments to list_restores 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 RestorePlan that contains the Restores to list. Format: projects//locations//restorePlans/*

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

      The target number of results to return in a single response. If not specified, a default value will be chosen by the service. Note that the response may inclue 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)

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

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

      Field match expression used to filter the results.

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

      Field by which to sort the results.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 2134

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListRestoresRequest

  # 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_restores..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :list_restores, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_restores, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_volume_backups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup> #list_volume_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup>

Lists the VolumeBackups for a given Backup.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::GkeBackup::V1::VolumeBackup.
  p response
end

Overloads:

  • #list_volume_backups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup>

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest, ::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_volume_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup>

    Pass arguments to list_volume_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 Backup that contains the VolumeBackups to list. Format: projects//locations//backupPlans//backups/

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

      The target number of results to return in a single response. If not specified, a default value will be chosen by the service. Note that the response may inclue 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)

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

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

      Field match expression used to filter the results.

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

      Field by which to sort the results.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1325

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest

  # 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_volume_backups..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :list_volume_backups, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_volume_backups, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_volume_restores(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore> #list_volume_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore>

Lists the VolumeRestores for a given Restore.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::GkeBackup::V1::VolumeRestore.
  p response
end

Overloads:

  • #list_volume_restores(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore>

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest, ::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_volume_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore>

    Pass arguments to list_volume_restores 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 Restore that contains the VolumeRestores to list. Format: projects//locations//restorePlans//restores/

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

      The target number of results to return in a single response. If not specified, a default value will be chosen by the service. Note that the response may inclue 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)

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

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

      Field match expression used to filter the results.

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

      Field by which to sort the results.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 2536

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest

  # 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_volume_restores..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :list_volume_restores, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @backup_for_gke_stub, :list_volume_restores, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_backup(request, options = nil) ⇒ ::Gapic::Operation #update_backup(backup: nil, update_mask: nil) ⇒ ::Gapic::Operation

Update a Backup.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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::GkeBackup::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(backup: nil, update_mask: 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:

    • backup (::Google::Cloud::GkeBackup::V1::Backup, ::Hash) (defaults to: nil)

      Required. A new version of the Backup resource that contains updated fields. This may be sparsely populated if an update_mask is provided.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      This is used to specify the fields to be overwritten in the Backup targeted for update. The values for each of these updated fields will be taken from the backup_plan provided with this request. Field names are relative to the root of the resource. If no update_mask is provided, all fields in backup will be written to the target Backup resource. Note that OUTPUT_ONLY and IMMUTABLE fields in backup are ignored and are not used to update the target Backup.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1112

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::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 and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.backup&.name
    header_params["backup.name"] = request.backup.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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_for_gke_stub.call_rpc :update_backup, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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) ⇒ ::Gapic::Operation

Update a BackupPlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeBackup::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 this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
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::GkeBackup::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) ⇒ ::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::GkeBackup::V1::BackupPlan, ::Hash) (defaults to: nil)

      Required. A new version of the BackupPlan resource that contains updated fields. This may be sparsely populated if an update_mask is provided.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      This is used to specify the fields to be overwritten in the BackupPlan targeted for update. The values for each of these updated fields will be taken from the backup_plan provided with this request. Field names are relative to the root of the resource (e.g., description, backup_config.include_volume_data, etc.) If no update_mask is provided, all fields in backup_plan will be written to the target BackupPlan resource. Note that OUTPUT_ONLY and IMMUTABLE fields in backup_plan are ignored and are not used to update the target BackupPlan.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 609

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::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 and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.backup_plan&.name
    header_params["backup_plan.name"] = request.backup_plan.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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_for_gke_stub.call_rpc :update_backup_plan, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_restore(request, options = nil) ⇒ ::Gapic::Operation #update_restore(restore: nil, update_mask: nil) ⇒ ::Gapic::Operation

Update a Restore.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::UpdateRestoreRequest, ::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_restore(restore: nil, update_mask: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_restore 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:

    • restore (::Google::Cloud::GkeBackup::V1::Restore, ::Hash) (defaults to: nil)

      Required. A new version of the Restore resource that contains updated fields. This may be sparsely populated if an update_mask is provided.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      This is used to specify the fields to be overwritten in the Restore targeted for update. The values for each of these updated fields will be taken from the restore provided with this request. Field names are relative to the root of the resource. If no update_mask is provided, all fields in restore will be written to the target Restore resource. Note that OUTPUT_ONLY and IMMUTABLE fields in restore are ignored and are not used to update the target Restore.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 2323

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateRestoreRequest

  # 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_restore..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.restore&.name
    header_params["restore.name"] = request.restore.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :update_restore, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_restore_plan(request, options = nil) ⇒ ::Gapic::Operation #update_restore_plan(restore_plan: nil, update_mask: nil) ⇒ ::Gapic::Operation

Update a RestorePlan.

Examples:

Basic example

require "google/cloud/gke_backup/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest, ::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_restore_plan(restore_plan: nil, update_mask: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_restore_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:

    • restore_plan (::Google::Cloud::GkeBackup::V1::RestorePlan, ::Hash) (defaults to: nil)

      Required. A new version of the RestorePlan resource that contains updated fields. This may be sparsely populated if an update_mask is provided.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      This is used to specify the fields to be overwritten in the RestorePlan targeted for update. The values for each of these updated fields will be taken from the restore_plan provided with this request. Field names are relative to the root of the resource. If no update_mask is provided, all fields in restore_plan will be written to the target RestorePlan resource. Note that OUTPUT_ONLY and IMMUTABLE fields in restore_plan are ignored and are not used to update the target RestorePlan.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/client.rb', line 1816

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest

  # 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_restore_plan..to_h

  # Set x-goog-api-client and x-goog-user-project 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::GkeBackup::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.restore_plan&.name
    header_params["restore_plan.name"] = request.restore_plan.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @backup_for_gke_stub.call_rpc :update_restore_plan, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end