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

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

Overview

REST 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 REST client object.

Examples:


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

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

Yields:

  • (config)

    Configure the BackupForGKE client.

Yield Parameters:



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

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

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

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == 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 = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @backup_for_gke_stub = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
end

Instance Attribute Details

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

Get the associated client for long-running operations.



232
233
234
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 232

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::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



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
157
158
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 59

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:



175
176
177
178
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 175

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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 636

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_backup request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 275

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @backup_for_gke_stub.create_backup_plan request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1510
1511
1512
1513
1514
1515
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
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1510

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_restore request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1146

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

Deletes an existing Backup.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



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
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 926

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

Deletes an existing BackupPlan.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 561

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @backup_for_gke_stub.delete_backup_plan request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1799

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_restore request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1435

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_restore_plan request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 782

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @backup_for_gke_stub.get_backup request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 420

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @backup_for_gke_stub.get_backup_plan request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1655

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_restore request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1291

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_restore_plan request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1072

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_volume_backup request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1945

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_volume_restore request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_backup_plans(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse #list_backup_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse

Lists BackupPlans in a given location.

Overloads:

  • #list_backup_plans(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse

    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) ⇒ ::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse

    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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 357

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

Lists the Backups for a given BackupPlan.

Overloads:

  • #list_backups(request, options = nil) ⇒ ::Gapic::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
748
749
750
751
752
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 718

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#list_restore_plans(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse #list_restore_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse

Lists RestorePlans in a given location.

Overloads:

  • #list_restore_plans(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse

    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) ⇒ ::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse

    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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
1255
1256
1257
1258
1259
1260
1261
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1228

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_restore_plans request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_restores(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::ListRestoresResponse #list_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::GkeBackup::V1::ListRestoresResponse

Lists the Restores for a given RestorePlan.

Overloads:

  • #list_restores(request, options = nil) ⇒ ::Google::Cloud::GkeBackup::V1::ListRestoresResponse

    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) ⇒ ::Google::Cloud::GkeBackup::V1::ListRestoresResponse

    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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1592

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_restores request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists the VolumeBackups for a given Backup.

Overloads:

  • #list_volume_backups(request, options = nil) ⇒ ::Gapic::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1008
1009
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
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1008

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_volume_backups request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_for_gke_stub, :list_volume_backups, "volume_backups", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Lists the VolumeRestores for a given Restore.

Overloads:

  • #list_volume_restores(request, options = nil) ⇒ ::Gapic::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1881

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_volume_restores request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @backup_for_gke_stub, :list_volume_restores, "volume_restores", request, result, options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 854

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#update_backup_plan(request, options = nil) ⇒ ::Gapic::Operation #update_backup_plan(backup_plan: nil, update_mask: nil) ⇒ ::Gapic::Operation

Update a BackupPlan.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 493

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @backup_for_gke_stub.update_backup_plan request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



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
1754
1755
1756
1757
1758
1759
1760
1761
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1727

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.update_restore request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => 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.

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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

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

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/rest/client.rb', line 1363

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,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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