# frozen_string_literal: true # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/errors" require "google/cloud/gkebackup/v1/gkebackup_pb" require "google/cloud/gke_backup/v1/backup_for_gke/rest/service_stub" module Google module Cloud module GkeBackup module V1 module BackupForGKE module Rest ## # REST client for the BackupForGKE service. # # BackupForGKE allows Kubernetes administrators to configure, execute, and # manage backup and restore operations for their GKE clusters. # class Client include Paths # @private attr_reader :backup_for_gke_stub ## # Configure the BackupForGKE Client class. # # See {::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client::Configuration} # for a description of the configuration fields. # # @example # # # Modify the configuration for all BackupForGKE clients # ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.configure do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # 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 ## # 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 {Client.configure}. # # See {::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client::Configuration} # for a description of the configuration fields. # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def configure yield @config if block_given? @config end ## # Create a new BackupForGKE REST client object. # # @example # # # 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 # # @yield [config] Configure the BackupForGKE client. # @yieldparam config [Client::Configuration] # 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 ## # Get the associated client for long-running operations. # # @return [::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Operations] # attr_reader :operations_client # Service calls ## # Creates a new BackupPlan in a given location. # # @overload create_backup_plan(request, options = nil) # Pass arguments to `create_backup_plan` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_backup_plan(parent: nil, backup_plan: nil, backup_plan_id: nil) # 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). # # @param parent [::String] # Required. The location within which to create the BackupPlan. # Format: projects/*/locations/* # @param backup_plan [::Google::Cloud::GkeBackup::V1::BackupPlan, ::Hash] # Required. The BackupPlan resource object to create. # @param backup_plan_id [::String] # 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 # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.create_backup_plan.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_backup_plan.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_backup_plan.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Lists BackupPlans in a given location. # # @overload list_backup_plans(request, options = nil) # Pass arguments to `list_backup_plans` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::ListBackupPlansRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_backup_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # 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). # # @param parent [::String] # Required. The location that contains the BackupPlans to list. # Format: projects/*/locations/* # @param page_size [::Integer] # 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 # {::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse#next_page_token next_page_token} # to determine if there are more instances left to be queried. # @param page_token [::String] # The value of # {::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse#next_page_token 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. # @param filter [::String] # Field match expression used to filter the results. # @param order_by [::String] # Field by which to sort the results. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::GkeBackup::V1::ListBackupPlansResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.list_backup_plans.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_backup_plans.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_backup_plans.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Retrieve the details of a single BackupPlan. # # @overload get_backup_plan(request, options = nil) # Pass arguments to `get_backup_plan` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::GetBackupPlanRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_backup_plan(name: nil) # 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). # # @param name [::String] # Required. Fully qualified BackupPlan name. # Format: projects/*/locations/*/backupPlans/* # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeBackup::V1::BackupPlan] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::GkeBackup::V1::BackupPlan] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.get_backup_plan.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_backup_plan.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_backup_plan.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Update a BackupPlan. # # @overload update_backup_plan(request, options = nil) # Pass arguments to `update_backup_plan` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_backup_plan(backup_plan: nil, update_mask: nil) # 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). # # @param backup_plan [::Google::Cloud::GkeBackup::V1::BackupPlan, ::Hash] # Required. A new version of the BackupPlan resource that contains updated fields. # This may be sparsely populated if an `update_mask` is provided. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # 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. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.update_backup_plan.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_backup_plan.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_backup_plan.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Deletes an existing BackupPlan. # # @overload delete_backup_plan(request, options = nil) # Pass arguments to `delete_backup_plan` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_backup_plan(name: nil, etag: nil) # 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). # # @param name [::String] # Required. Fully qualified BackupPlan name. # Format: projects/*/locations/*/backupPlans/* # @param etag [::String] # If provided, this value must match the current value of the # target BackupPlan's {::Google::Cloud::GkeBackup::V1::BackupPlan#etag etag} field or the request is # rejected. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.delete_backup_plan.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_backup_plan.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_backup_plan.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Creates a Backup for the given BackupPlan. # # @overload create_backup(request, options = nil) # Pass arguments to `create_backup` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::CreateBackupRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_backup(parent: nil, backup: nil, backup_id: nil) # 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). # # @param parent [::String] # Required. The BackupPlan within which to create the Backup. # Format: projects/*/locations/*/backupPlans/* # @param backup [::Google::Cloud::GkeBackup::V1::Backup, ::Hash] # The Backup resource to create. # @param backup_id [::String] # 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 # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.create_backup.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_backup.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_backup.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Lists the Backups for a given BackupPlan. # # @overload list_backups(request, options = nil) # Pass arguments to `list_backups` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::ListBackupsRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # 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). # # @param parent [::String] # Required. The BackupPlan that contains the Backups to list. # Format: projects/*/locations/*/backupPlans/* # @param page_size [::Integer] # 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 # {::Google::Cloud::GkeBackup::V1::ListBackupsResponse#next_page_token next_page_token} # to determine if there are more instances left to be queried. # @param page_token [::String] # The value of # {::Google::Cloud::GkeBackup::V1::ListBackupsResponse#next_page_token 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. # @param filter [::String] # Field match expression used to filter the results. # @param order_by [::String] # Field by which to sort the results. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Backup>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::Backup>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.list_backups.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_backups.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_backups.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Retrieve the details of a single Backup. # # @overload get_backup(request, options = nil) # Pass arguments to `get_backup` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::GetBackupRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_backup(name: nil) # 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). # # @param name [::String] # Required. Full name of the Backup resource. # Format: projects/*/locations/*/backupPlans/*/backups/* # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeBackup::V1::Backup] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::GkeBackup::V1::Backup] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.get_backup.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_backup.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_backup.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Update a Backup. # # @overload update_backup(request, options = nil) # Pass arguments to `update_backup` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::UpdateBackupRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_backup(backup: nil, update_mask: nil) # 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). # # @param backup [::Google::Cloud::GkeBackup::V1::Backup, ::Hash] # Required. A new version of the Backup resource that contains updated fields. # This may be sparsely populated if an `update_mask` is provided. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # 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. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.update_backup.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_backup.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_backup.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Deletes an existing Backup. # # @overload delete_backup(request, options = nil) # Pass arguments to `delete_backup` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::DeleteBackupRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_backup(name: nil, etag: nil, force: nil) # 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). # # @param name [::String] # Required. Name of the Backup resource. # Format: projects/*/locations/*/backupPlans/*/backups/* # @param etag [::String] # If provided, this value must match the current value of the # target Backup's {::Google::Cloud::GkeBackup::V1::Backup#etag etag} field or the request is # rejected. # @param force [::Boolean] # 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. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.delete_backup.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_backup.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_backup.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Lists the VolumeBackups for a given Backup. # # @overload list_volume_backups(request, options = nil) # Pass arguments to `list_volume_backups` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_volume_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # 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). # # @param parent [::String] # Required. The Backup that contains the VolumeBackups to list. # Format: projects/*/locations/*/backupPlans/*/backups/* # @param page_size [::Integer] # 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 # {::Google::Cloud::GkeBackup::V1::ListVolumeBackupsResponse#next_page_token next_page_token} # to determine if there are more instances left to be queried. # @param page_token [::String] # The value of # {::Google::Cloud::GkeBackup::V1::ListVolumeBackupsResponse#next_page_token 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. # @param filter [::String] # Field match expression used to filter the results. # @param order_by [::String] # Field by which to sort the results. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeBackup>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.list_volume_backups.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_volume_backups.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_volume_backups.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Retrieve the details of a single VolumeBackup. # # @overload get_volume_backup(request, options = nil) # Pass arguments to `get_volume_backup` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_volume_backup(name: nil) # 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). # # @param name [::String] # Required. Full name of the VolumeBackup resource. # Format: projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/* # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeBackup::V1::VolumeBackup] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::GkeBackup::V1::VolumeBackup] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.get_volume_backup.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_volume_backup.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_volume_backup.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Creates a new RestorePlan in a given location. # # @overload create_restore_plan(request, options = nil) # Pass arguments to `create_restore_plan` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_restore_plan(parent: nil, restore_plan: nil, restore_plan_id: nil) # 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). # # @param parent [::String] # Required. The location within which to create the RestorePlan. # Format: projects/*/locations/* # @param restore_plan [::Google::Cloud::GkeBackup::V1::RestorePlan, ::Hash] # Required. The RestorePlan resource object to create. # @param restore_plan_id [::String] # 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 # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.create_restore_plan.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_restore_plan.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_restore_plan.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Lists RestorePlans in a given location. # # @overload list_restore_plans(request, options = nil) # Pass arguments to `list_restore_plans` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::ListRestorePlansRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_restore_plans(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # 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). # # @param parent [::String] # Required. The location that contains the RestorePlans to list. # Format: projects/*/locations/* # @param page_size [::Integer] # 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 # {::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse#next_page_token next_page_token} # to determine if there are more instances left to be queried. # @param page_token [::String] # The value of # {::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse#next_page_token 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. # @param filter [::String] # Field match expression used to filter the results. # @param order_by [::String] # Field by which to sort the results. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::GkeBackup::V1::ListRestorePlansResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.list_restore_plans.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_restore_plans.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_restore_plans.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Retrieve the details of a single RestorePlan. # # @overload get_restore_plan(request, options = nil) # Pass arguments to `get_restore_plan` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::GetRestorePlanRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_restore_plan(name: nil) # 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). # # @param name [::String] # Required. Fully qualified RestorePlan name. # Format: projects/*/locations/*/restorePlans/* # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeBackup::V1::RestorePlan] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::GkeBackup::V1::RestorePlan] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.get_restore_plan.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_restore_plan.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_restore_plan.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Update a RestorePlan. # # @overload update_restore_plan(request, options = nil) # Pass arguments to `update_restore_plan` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_restore_plan(restore_plan: nil, update_mask: nil) # 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). # # @param restore_plan [::Google::Cloud::GkeBackup::V1::RestorePlan, ::Hash] # Required. A new version of the RestorePlan resource that contains updated fields. # This may be sparsely populated if an `update_mask` is provided. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # 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. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.update_restore_plan.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_restore_plan.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_restore_plan.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Deletes an existing RestorePlan. # # @overload delete_restore_plan(request, options = nil) # Pass arguments to `delete_restore_plan` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_restore_plan(name: nil, etag: nil, force: nil) # 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). # # @param name [::String] # Required. Fully qualified RestorePlan name. # Format: projects/*/locations/*/restorePlans/* # @param etag [::String] # If provided, this value must match the current value of the # target RestorePlan's {::Google::Cloud::GkeBackup::V1::RestorePlan#etag etag} field or the request is # rejected. # @param force [::Boolean] # 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. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.delete_restore_plan.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_restore_plan.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_restore_plan.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Creates a new Restore for the given RestorePlan. # # @overload create_restore(request, options = nil) # Pass arguments to `create_restore` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::CreateRestoreRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_restore(parent: nil, restore: nil, restore_id: nil) # 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). # # @param parent [::String] # Required. The RestorePlan within which to create the Restore. # Format: projects/*/locations/*/restorePlans/* # @param restore [::Google::Cloud::GkeBackup::V1::Restore, ::Hash] # Required. The restore resource to create. # @param restore_id [::String] # 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. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.create_restore.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_restore.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_restore.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Lists the Restores for a given RestorePlan. # # @overload list_restores(request, options = nil) # Pass arguments to `list_restores` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::ListRestoresRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # 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). # # @param parent [::String] # Required. The RestorePlan that contains the Restores to list. # Format: projects/*/locations/*/restorePlans/* # @param page_size [::Integer] # 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 # {::Google::Cloud::GkeBackup::V1::ListRestoresResponse#next_page_token next_page_token} # to determine if there are more instances left to be queried. # @param page_token [::String] # The value of # {::Google::Cloud::GkeBackup::V1::ListRestoresResponse#next_page_token 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. # @param filter [::String] # Field match expression used to filter the results. # @param order_by [::String] # Field by which to sort the results. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeBackup::V1::ListRestoresResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::GkeBackup::V1::ListRestoresResponse] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.list_restores.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_restores.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_restores.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Retrieves the details of a single Restore. # # @overload get_restore(request, options = nil) # Pass arguments to `get_restore` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::GetRestoreRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_restore(name: nil) # 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). # # @param name [::String] # Required. Name of the restore resource. # Format: projects/*/locations/*/restorePlans/*/restores/* # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeBackup::V1::Restore] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::GkeBackup::V1::Restore] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.get_restore.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_restore.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_restore.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Update a Restore. # # @overload update_restore(request, options = nil) # Pass arguments to `update_restore` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::UpdateRestoreRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_restore(restore: nil, update_mask: nil) # 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). # # @param restore [::Google::Cloud::GkeBackup::V1::Restore, ::Hash] # Required. A new version of the Restore resource that contains updated fields. # This may be sparsely populated if an `update_mask` is provided. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # 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. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.update_restore.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_restore.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_restore.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Deletes an existing Restore. # # @overload delete_restore(request, options = nil) # Pass arguments to `delete_restore` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::DeleteRestoreRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_restore(name: nil, etag: nil, force: nil) # 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). # # @param name [::String] # Required. Full name of the Restore # Format: projects/*/locations/*/restorePlans/*/restores/* # @param etag [::String] # If provided, this value must match the current value of the # target Restore's {::Google::Cloud::GkeBackup::V1::Restore#etag etag} field or the request is # rejected. # @param force [::Boolean] # 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. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.delete_restore.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_restore.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_restore.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Lists the VolumeRestores for a given Restore. # # @overload list_volume_restores(request, options = nil) # Pass arguments to `list_volume_restores` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_volume_restores(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) # 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). # # @param parent [::String] # Required. The Restore that contains the VolumeRestores to list. # Format: projects/*/locations/*/restorePlans/*/restores/* # @param page_size [::Integer] # 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 # {::Google::Cloud::GkeBackup::V1::ListVolumeRestoresResponse#next_page_token next_page_token} # to determine if there are more instances left to be queried. # @param page_token [::String] # The value of # {::Google::Cloud::GkeBackup::V1::ListVolumeRestoresResponse#next_page_token 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. # @param filter [::String] # Field match expression used to filter the results. # @param order_by [::String] # Field by which to sort the results. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeBackup::V1::VolumeRestore>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.list_volume_restores.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_volume_restores.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_volume_restores.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Retrieve the details of a single VolumeRestore. # # @overload get_volume_restore(request, options = nil) # Pass arguments to `get_volume_restore` via a request object, either of type # {::Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest} or an equivalent Hash. # # @param 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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_volume_restore(name: nil) # 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). # # @param name [::String] # Required. Full name of the VolumeRestore resource. # Format: projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/* # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::GkeBackup::V1::VolumeRestore] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::GkeBackup::V1::VolumeRestore] # # @raise [::Google::Cloud::Error] if the REST call is aborted. 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 call_metadata = @config.rpcs.get_volume_restore.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers call_metadata[:"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] call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_volume_restore.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_volume_restore.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, 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 ## # Configuration class for the BackupForGKE REST API. # # This class represents the configuration for BackupForGKE REST, # providing control over timeouts, retry behavior, logging, transport # parameters, and other low-level controls. Certain parameters can also be # applied individually to specific RPCs. See # {::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client::Configuration::Rpcs} # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # # @example # # # Modify the global config, setting the timeout for # # create_backup_plan to 20 seconds, # # and all remaining timeouts to 10 seconds. # ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.create_backup_plan.timeout = 20.0 # end # # # Apply the above configuration only to a new client. # client = ::Google::Cloud::GkeBackup::V1::BackupForGKE::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.create_backup_plan.timeout = 20.0 # end # # @!attribute [rw] endpoint # The hostname or hostname:port of the service endpoint. # Defaults to `"gkebackup.googleapis.com"`. # @return [::String] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`String`) The path to a service account key file in JSON format # * (`Hash`) A service account key as a Hash # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) # * (`nil`) indicating no credentials # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] # @!attribute [rw] retry_policy # The retry policy. The value is a hash with the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] # class Configuration extend ::Gapic::Config config_attr :endpoint, "gkebackup.googleapis.com", ::String config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } end config_attr :scope, nil, ::String, ::Array, nil config_attr :lib_name, nil, ::String, nil config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end ## # Configurations for individual RPCs # @return [Rpcs] # def rpcs @rpcs ||= begin parent_rpcs = nil parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) Rpcs.new parent_rpcs end end ## # Configuration RPC class for the BackupForGKE API. # # Includes fields providing the configuration for each RPC in this service. # Each configuration object is of type `Gapic::Config::Method` and includes # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields # include the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # class Rpcs ## # RPC-specific configuration for `create_backup_plan` # @return [::Gapic::Config::Method] # attr_reader :create_backup_plan ## # RPC-specific configuration for `list_backup_plans` # @return [::Gapic::Config::Method] # attr_reader :list_backup_plans ## # RPC-specific configuration for `get_backup_plan` # @return [::Gapic::Config::Method] # attr_reader :get_backup_plan ## # RPC-specific configuration for `update_backup_plan` # @return [::Gapic::Config::Method] # attr_reader :update_backup_plan ## # RPC-specific configuration for `delete_backup_plan` # @return [::Gapic::Config::Method] # attr_reader :delete_backup_plan ## # RPC-specific configuration for `create_backup` # @return [::Gapic::Config::Method] # attr_reader :create_backup ## # RPC-specific configuration for `list_backups` # @return [::Gapic::Config::Method] # attr_reader :list_backups ## # RPC-specific configuration for `get_backup` # @return [::Gapic::Config::Method] # attr_reader :get_backup ## # RPC-specific configuration for `update_backup` # @return [::Gapic::Config::Method] # attr_reader :update_backup ## # RPC-specific configuration for `delete_backup` # @return [::Gapic::Config::Method] # attr_reader :delete_backup ## # RPC-specific configuration for `list_volume_backups` # @return [::Gapic::Config::Method] # attr_reader :list_volume_backups ## # RPC-specific configuration for `get_volume_backup` # @return [::Gapic::Config::Method] # attr_reader :get_volume_backup ## # RPC-specific configuration for `create_restore_plan` # @return [::Gapic::Config::Method] # attr_reader :create_restore_plan ## # RPC-specific configuration for `list_restore_plans` # @return [::Gapic::Config::Method] # attr_reader :list_restore_plans ## # RPC-specific configuration for `get_restore_plan` # @return [::Gapic::Config::Method] # attr_reader :get_restore_plan ## # RPC-specific configuration for `update_restore_plan` # @return [::Gapic::Config::Method] # attr_reader :update_restore_plan ## # RPC-specific configuration for `delete_restore_plan` # @return [::Gapic::Config::Method] # attr_reader :delete_restore_plan ## # RPC-specific configuration for `create_restore` # @return [::Gapic::Config::Method] # attr_reader :create_restore ## # RPC-specific configuration for `list_restores` # @return [::Gapic::Config::Method] # attr_reader :list_restores ## # RPC-specific configuration for `get_restore` # @return [::Gapic::Config::Method] # attr_reader :get_restore ## # RPC-specific configuration for `update_restore` # @return [::Gapic::Config::Method] # attr_reader :update_restore ## # RPC-specific configuration for `delete_restore` # @return [::Gapic::Config::Method] # attr_reader :delete_restore ## # RPC-specific configuration for `list_volume_restores` # @return [::Gapic::Config::Method] # attr_reader :list_volume_restores ## # RPC-specific configuration for `get_volume_restore` # @return [::Gapic::Config::Method] # attr_reader :get_volume_restore # @private def initialize parent_rpcs = nil create_backup_plan_config = parent_rpcs.create_backup_plan if parent_rpcs.respond_to? :create_backup_plan @create_backup_plan = ::Gapic::Config::Method.new create_backup_plan_config list_backup_plans_config = parent_rpcs.list_backup_plans if parent_rpcs.respond_to? :list_backup_plans @list_backup_plans = ::Gapic::Config::Method.new list_backup_plans_config get_backup_plan_config = parent_rpcs.get_backup_plan if parent_rpcs.respond_to? :get_backup_plan @get_backup_plan = ::Gapic::Config::Method.new get_backup_plan_config update_backup_plan_config = parent_rpcs.update_backup_plan if parent_rpcs.respond_to? :update_backup_plan @update_backup_plan = ::Gapic::Config::Method.new update_backup_plan_config delete_backup_plan_config = parent_rpcs.delete_backup_plan if parent_rpcs.respond_to? :delete_backup_plan @delete_backup_plan = ::Gapic::Config::Method.new delete_backup_plan_config create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup @create_backup = ::Gapic::Config::Method.new create_backup_config list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups @list_backups = ::Gapic::Config::Method.new list_backups_config get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup @get_backup = ::Gapic::Config::Method.new get_backup_config update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup @update_backup = ::Gapic::Config::Method.new update_backup_config delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup @delete_backup = ::Gapic::Config::Method.new delete_backup_config list_volume_backups_config = parent_rpcs.list_volume_backups if parent_rpcs.respond_to? :list_volume_backups @list_volume_backups = ::Gapic::Config::Method.new list_volume_backups_config get_volume_backup_config = parent_rpcs.get_volume_backup if parent_rpcs.respond_to? :get_volume_backup @get_volume_backup = ::Gapic::Config::Method.new get_volume_backup_config create_restore_plan_config = parent_rpcs.create_restore_plan if parent_rpcs.respond_to? :create_restore_plan @create_restore_plan = ::Gapic::Config::Method.new create_restore_plan_config list_restore_plans_config = parent_rpcs.list_restore_plans if parent_rpcs.respond_to? :list_restore_plans @list_restore_plans = ::Gapic::Config::Method.new list_restore_plans_config get_restore_plan_config = parent_rpcs.get_restore_plan if parent_rpcs.respond_to? :get_restore_plan @get_restore_plan = ::Gapic::Config::Method.new get_restore_plan_config update_restore_plan_config = parent_rpcs.update_restore_plan if parent_rpcs.respond_to? :update_restore_plan @update_restore_plan = ::Gapic::Config::Method.new update_restore_plan_config delete_restore_plan_config = parent_rpcs.delete_restore_plan if parent_rpcs.respond_to? :delete_restore_plan @delete_restore_plan = ::Gapic::Config::Method.new delete_restore_plan_config create_restore_config = parent_rpcs.create_restore if parent_rpcs.respond_to? :create_restore @create_restore = ::Gapic::Config::Method.new create_restore_config list_restores_config = parent_rpcs.list_restores if parent_rpcs.respond_to? :list_restores @list_restores = ::Gapic::Config::Method.new list_restores_config get_restore_config = parent_rpcs.get_restore if parent_rpcs.respond_to? :get_restore @get_restore = ::Gapic::Config::Method.new get_restore_config update_restore_config = parent_rpcs.update_restore if parent_rpcs.respond_to? :update_restore @update_restore = ::Gapic::Config::Method.new update_restore_config delete_restore_config = parent_rpcs.delete_restore if parent_rpcs.respond_to? :delete_restore @delete_restore = ::Gapic::Config::Method.new delete_restore_config list_volume_restores_config = parent_rpcs.list_volume_restores if parent_rpcs.respond_to? :list_volume_restores @list_volume_restores = ::Gapic::Config::Method.new list_volume_restores_config get_volume_restore_config = parent_rpcs.get_volume_restore if parent_rpcs.respond_to? :get_volume_restore @get_volume_restore = ::Gapic::Config::Method.new get_volume_restore_config yield self if block_given? end end end end end end end end end end