class Google::Cloud::Deploy::V1::CloudDeploy::Client
Client
for the CloudDeploy
service.
CloudDeploy
service creates and manages Continuous Delivery operations on Google
Cloud
Platform via Skaffold (skaffold.dev).
Attributes
@private
Get the associated client for long-running operations.
@return [::Google::Cloud::Deploy::V1::CloudDeploy::Operations]
Public Class Methods
Configure the CloudDeploy
Client
class.
See {::Google::Cloud::Deploy::V1::CloudDeploy::Client::Configuration} for a description of the configuration fields.
@example
# Modify the configuration for all CloudDeploy clients ::Google::Cloud::Deploy::V1::CloudDeploy::Client.configure do |config| config.timeout = 10.0 end
@yield [config] Configure the Client
client. @yieldparam config [Client::Configuration]
@return [Client::Configuration]
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 57 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Deploy", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.list_delivery_pipelines.timeout = 60.0 default_config.rpcs.list_delivery_pipelines.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_delivery_pipeline.timeout = 60.0 default_config.rpcs.get_delivery_pipeline.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_delivery_pipeline.timeout = 60.0 default_config.rpcs.update_delivery_pipeline.timeout = 60.0 default_config.rpcs.delete_delivery_pipeline.timeout = 60.0 default_config.rpcs.list_targets.timeout = 60.0 default_config.rpcs.list_targets.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_target.timeout = 60.0 default_config.rpcs.get_target.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_target.timeout = 60.0 default_config.rpcs.update_target.timeout = 60.0 default_config.rpcs.delete_target.timeout = 60.0 default_config.rpcs.list_releases.timeout = 60.0 default_config.rpcs.list_releases.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_release.timeout = 60.0 default_config.rpcs.get_release.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_release.timeout = 60.0 default_config.rpcs.approve_rollout.timeout = 60.0 default_config.rpcs.list_rollouts.timeout = 60.0 default_config.rpcs.list_rollouts.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.get_rollout.timeout = 60.0 default_config.rpcs.get_rollout.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_rollout.timeout = 60.0 default_config.rpcs.get_config.timeout = 60.0 default_config.rpcs.get_config.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
Create a new CloudDeploy
client object.
@example
# Create a client using the default configuration client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Deploy::V1::CloudDeploy::Client.new do |config| config.timeout = 10.0 end
@yield [config] Configure the CloudDeploy
client. @yieldparam config [Client::Configuration]
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 173 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/deploy/v1/cloud_deploy_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @cloud_deploy_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Deploy::V1::CloudDeploy::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end
Public Instance Methods
Approves a Rollout
.
@overload approve_rollout
(request, options = nil)
Pass arguments to `approve_rollout` via a request object, either of type {::Google::Cloud::Deploy::V1::ApproveRolloutRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::ApproveRolloutRequest, ::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 approve_rollout
(name: nil, approved: nil)
Pass arguments to `approve_rollout` 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 Rollout. Format is projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/ releases/\\{release}/rollouts/\\{rollout}. @param approved [::Boolean] Required. True = approve; false = reject
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Deploy::V1::ApproveRolloutResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Deploy::V1::ApproveRolloutResponse]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::ApproveRolloutRequest.new # Call the approve_rollout method. result = client.approve_rollout request # The returned object is of type Google::Cloud::Deploy::V1::ApproveRolloutResponse. p result
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1679 def approve_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ApproveRolloutRequest # 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 metadata = @config.rpcs.approve_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.approve_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.approve_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :approve_rollout, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Configure the CloudDeploy
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::Deploy::V1::CloudDeploy::Client::Configuration} for a description of the configuration fields.
@yield [config] Configure the Client
client. @yieldparam config [Client::Configuration]
@return [Client::Configuration]
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 152 def configure yield @config if block_given? @config end
Creates a new DeliveryPipeline in a given project and location.
@overload create_delivery_pipeline
(request, options = nil)
Pass arguments to `create_delivery_pipeline` via a request object, either of type {::Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest, ::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_delivery_pipeline
(parent: nil, delivery_pipeline_id: nil, delivery_pipeline: nil, request_id: nil, validate_only: nil)
Pass arguments to `create_delivery_pipeline` 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 parent collection in which the `DeliveryPipeline` should be created. Format should be projects/\\{project_id}/locations/\\{location_name}. @param delivery_pipeline_id [::String] Required. ID of the `DeliveryPipeline`. @param delivery_pipeline [::Google::Cloud::Deploy::V1::DeliveryPipeline, ::Hash] Required. The `DeliveryPipeline` to create. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param validate_only [::Boolean] Optional. If set to true, the request is validated and the user is provided with an expected result, but no actual change is made.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest.new # Call the create_delivery_pipeline method. result = client.create_delivery_pipeline request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 492 def create_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest # 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 metadata = @config.rpcs.create_delivery_pipeline.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_delivery_pipeline.timeout, metadata: metadata, retry_policy: @config.rpcs.create_delivery_pipeline.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :create_delivery_pipeline, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Creates a new Release
in a given project and location.
@overload create_release
(request, options = nil)
Pass arguments to `create_release` via a request object, either of type {::Google::Cloud::Deploy::V1::CreateReleaseRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::CreateReleaseRequest, ::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_release
(parent: nil, release_id: nil, release: nil, request_id: nil, validate_only: nil)
Pass arguments to `create_release` 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 parent collection in which the `Release` should be created. Format should be projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}. @param release_id [::String] Required. ID of the `Release`. @param release [::Google::Cloud::Deploy::V1::Release, ::Hash] Required. The `Release` to create. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param validate_only [::Boolean] Optional. If set to true, the request is validated and the user is provided with an expected result, but no actual change is made.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::CreateReleaseRequest.new # Call the create_release method. result = client.create_release request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1589 def create_release request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateReleaseRequest # 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 metadata = @config.rpcs.create_release.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_release.timeout, metadata: metadata, retry_policy: @config.rpcs.create_release.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :create_release, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Creates a new Rollout
in a given project and location.
@overload create_rollout
(request, options = nil)
Pass arguments to `create_rollout` via a request object, either of type {::Google::Cloud::Deploy::V1::CreateRolloutRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::CreateRolloutRequest, ::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_rollout
(parent: nil, rollout_id: nil, rollout: nil, request_id: nil, validate_only: nil)
Pass arguments to `create_rollout` 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 parent collection in which the `Rollout` should be created. Format should be projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}. @param rollout_id [::String] Required. ID of the `Rollout`. @param rollout [::Google::Cloud::Deploy::V1::Rollout, ::Hash] Required. The `Rollout` to create. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param validate_only [::Boolean] Optional. If set to true, the request is validated and the user is provided with an expected result, but no actual change is made.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::CreateRolloutRequest.new # Call the create_rollout method. result = client.create_rollout request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1987 def create_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateRolloutRequest # 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 metadata = @config.rpcs.create_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.create_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :create_rollout, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Creates a new Target in a given project and location.
@overload create_target
(request, options = nil)
Pass arguments to `create_target` via a request object, either of type {::Google::Cloud::Deploy::V1::CreateTargetRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::CreateTargetRequest, ::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_target
(parent: nil, target_id: nil, target: nil, request_id: nil, validate_only: nil)
Pass arguments to `create_target` 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 parent collection in which the `Target` should be created. Format should be projects/\\{project_id}/locations/\\{location_name}. @param target_id [::String] Required. ID of the `Target`. @param target [::Google::Cloud::Deploy::V1::Target, ::Hash] Required. The `Target` to create. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param validate_only [::Boolean] Optional. If set to true, the request is validated and the user is provided with an expected result, but no actual change is made.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::CreateTargetRequest.new # Call the create_target method. result = client.create_target request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1043 def create_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::CreateTargetRequest # 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 metadata = @config.rpcs.create_target.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_target.timeout, metadata: metadata, retry_policy: @config.rpcs.create_target.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :create_target, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Deletes a single DeliveryPipeline.
@overload delete_delivery_pipeline
(request, options = nil)
Pass arguments to `delete_delivery_pipeline` via a request object, either of type {::Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest, ::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_delivery_pipeline
(name: nil, request_id: nil, allow_missing: nil, validate_only: nil, force: nil, etag: nil)
Pass arguments to `delete_delivery_pipeline` 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. The name of the `DeliveryPipeline` to delete. Format should be projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param allow_missing [::Boolean] Optional. If set to true, then deleting an already deleted or non-existing `DeliveryPipeline` will succeed. @param validate_only [::Boolean] Optional. If set, validate the request and preview the review, but do not actually post it. @param force [::Boolean] Optional. If set to true, all child resources under this pipeline will also be deleted. Otherwise, the request will only work if the pipeline has no child resources. @param etag [::String] Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest.new # Call the delete_delivery_pipeline method. result = client.delete_delivery_pipeline request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 733 def delete_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest # 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 metadata = @config.rpcs.delete_delivery_pipeline.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_delivery_pipeline.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_delivery_pipeline.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :delete_delivery_pipeline, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Deletes a single Target.
@overload delete_target
(request, options = nil)
Pass arguments to `delete_target` via a request object, either of type {::Google::Cloud::Deploy::V1::DeleteTargetRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::DeleteTargetRequest, ::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_target
(name: nil, request_id: nil, allow_missing: nil, validate_only: nil, etag: nil)
Pass arguments to `delete_target` 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. The name of the `Target` to delete. Format should be projects/\\{project_id}/locations/\\{location_name}/targets/\\{target_name}. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param allow_missing [::Boolean] Optional. If set to true, then deleting an already deleted or non-existing DeliveryPipeline will succeed. @param validate_only [::Boolean] Optional. If set, validate the request and preview the review, but do not actually post it. @param etag [::String] Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::DeleteTargetRequest.new # Call the delete_target method. result = client.delete_target request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1280 def delete_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::DeleteTargetRequest # 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 metadata = @config.rpcs.delete_target.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_target.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_target.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :delete_target, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Gets the configuration for a location.
@overload get_config
(request, options = nil)
Pass arguments to `get_config` via a request object, either of type {::Google::Cloud::Deploy::V1::GetConfigRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::GetConfigRequest, ::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_config
(name: nil)
Pass arguments to `get_config` 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 requested configuration.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Deploy::V1::Config] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Deploy::V1::Config]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::GetConfigRequest.new # Call the get_config method. result = client.get_config request # The returned object is of type Google::Cloud::Deploy::V1::Config. p result
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 2073 def get_config request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetConfigRequest # 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 metadata = @config.rpcs.get_config.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_config.timeout, metadata: metadata, retry_policy: @config.rpcs.get_config.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_config, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Gets details of a single DeliveryPipeline.
@overload get_delivery_pipeline
(request, options = nil)
Pass arguments to `get_delivery_pipeline` via a request object, either of type {::Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest, ::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_delivery_pipeline
(name: nil)
Pass arguments to `get_delivery_pipeline` 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 `DeliveryPipeline`. Format must be projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Deploy::V1::DeliveryPipeline] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Deploy::V1::DeliveryPipeline]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest.new # Call the get_delivery_pipeline method. result = client.get_delivery_pipeline request # The returned object is of type Google::Cloud::Deploy::V1::DeliveryPipeline. p result
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 378 def get_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest # 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 metadata = @config.rpcs.get_delivery_pipeline.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_delivery_pipeline.timeout, metadata: metadata, retry_policy: @config.rpcs.get_delivery_pipeline.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_delivery_pipeline, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Gets details of a single Release
.
@overload get_release
(request, options = nil)
Pass arguments to `get_release` via a request object, either of type {::Google::Cloud::Deploy::V1::GetReleaseRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::GetReleaseRequest, ::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_release
(name: nil)
Pass arguments to `get_release` 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 `Release`. Format must be projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Deploy::V1::Release] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Deploy::V1::Release]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::GetReleaseRequest.new # Call the get_release method. result = client.get_release request # The returned object is of type Google::Cloud::Deploy::V1::Release. p result
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1474 def get_release request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetReleaseRequest # 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 metadata = @config.rpcs.get_release.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_release.timeout, metadata: metadata, retry_policy: @config.rpcs.get_release.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_release, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Gets details of a single Rollout
.
@overload get_rollout
(request, options = nil)
Pass arguments to `get_rollout` via a request object, either of type {::Google::Cloud::Deploy::V1::GetRolloutRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::GetRolloutRequest, ::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_rollout
(name: nil)
Pass arguments to `get_rollout` 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 `Rollout`. Format must be projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}/rollouts/\\{rollout_name}.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Deploy::V1::Rollout] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Deploy::V1::Rollout]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::GetRolloutRequest.new # Call the get_rollout method. result = client.get_rollout request # The returned object is of type Google::Cloud::Deploy::V1::Rollout. p result
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1872 def get_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetRolloutRequest # 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 metadata = @config.rpcs.get_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.get_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_rollout, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Gets details of a single Target.
@overload get_target
(request, options = nil)
Pass arguments to `get_target` via a request object, either of type {::Google::Cloud::Deploy::V1::GetTargetRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::GetTargetRequest, ::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_target
(name: nil)
Pass arguments to `get_target` 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 `Target`. Format must be projects/\\{project_id}/locations/\\{location_name}/targets/\\{target_name}.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Deploy::V1::Target] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Deploy::V1::Target]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::GetTargetRequest.new # Call the get_target method. result = client.get_target request # The returned object is of type Google::Cloud::Deploy::V1::Target. p result
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 928 def get_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetTargetRequest # 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 metadata = @config.rpcs.get_target.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_target.timeout, metadata: metadata, retry_policy: @config.rpcs.get_target.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :get_target, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Lists DeliveryPipelines in a given project and location.
@overload list_delivery_pipelines
(request, options = nil)
Pass arguments to `list_delivery_pipelines` via a request object, either of type {::Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest, ::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_delivery_pipelines
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
Pass arguments to `list_delivery_pipelines` 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 parent, which owns this collection of pipelines. Format must be projects/\\{project_id}/locations/\\{location_name}. @param page_size [::Integer] The maximum number of pipelines to return. The service may return fewer than this value. If unspecified, at most 50 pipelines will be returned. The maximum value is 1000; values above 1000 will be set to 1000. @param page_token [::String] A page token, received from a previous `ListDeliveryPipelines` call. Provide this to retrieve the subsequent page. When paginating, all other provided parameters match the call that provided the page token. @param filter [::String] Filter pipelines to be returned. See https://google.aip.dev/160 for more details. @param order_by [::String] Field to sort by. See https://google.aip.dev/132#ordering for more details.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::DeliveryPipeline>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::DeliveryPipeline>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest.new # Call the list_delivery_pipelines method. result = client.list_delivery_pipelines request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Deploy::V1::DeliveryPipeline. p response end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 291 def list_delivery_pipelines request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest # 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 metadata = @config.rpcs.list_delivery_pipelines.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_delivery_pipelines.timeout, metadata: metadata, retry_policy: @config.rpcs.list_delivery_pipelines.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :list_delivery_pipelines, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_delivery_pipelines, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Lists Releases in a given project and location.
@overload list_releases
(request, options = nil)
Pass arguments to `list_releases` via a request object, either of type {::Google::Cloud::Deploy::V1::ListReleasesRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::ListReleasesRequest, ::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_releases
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
Pass arguments to `list_releases` 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 `DeliveryPipeline` which owns this collection of `Release` objects. @param page_size [::Integer] Optional. The maximum number of `Release` objects to return. The service may return fewer than this value. If unspecified, at most 50 `Release` objects will be returned. The maximum value is 1000; values above 1000 will be set to 1000. @param page_token [::String] Optional. A page token, received from a previous `ListReleases` call. Provide this to retrieve the subsequent page. When paginating, all other provided parameters match the call that provided the page token. @param filter [::String] Optional. Filter releases to be returned. See https://google.aip.dev/160 for more details. @param order_by [::String] Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Release>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Release>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::ListReleasesRequest.new # Call the list_releases method. result = client.list_releases request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Deploy::V1::Release. p response end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1387 def list_releases request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListReleasesRequest # 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 metadata = @config.rpcs.list_releases.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_releases.timeout, metadata: metadata, retry_policy: @config.rpcs.list_releases.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :list_releases, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_releases, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Lists Rollouts in a given project and location.
@overload list_rollouts
(request, options = nil)
Pass arguments to `list_rollouts` via a request object, either of type {::Google::Cloud::Deploy::V1::ListRolloutsRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::ListRolloutsRequest, ::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_rollouts
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
Pass arguments to `list_rollouts` 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 `Release` which owns this collection of `Rollout` objects. @param page_size [::Integer] Optional. The maximum number of `Rollout` objects to return. The service may return fewer than this value. If unspecified, at most 50 `Rollout` objects will be returned. The maximum value is 1000; values above 1000 will be set to 1000. @param page_token [::String] Optional. A page token, received from a previous `ListRollouts` call. Provide this to retrieve the subsequent page. When paginating, all other provided parameters match the call that provided the page token. @param filter [::String] Optional. Filter rollouts to be returned. See https://google.aip.dev/160 for more details. @param order_by [::String] Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Rollout>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Rollout>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::ListRolloutsRequest.new # Call the list_rollouts method. result = client.list_rollouts request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Deploy::V1::Rollout. p response end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1785 def list_rollouts request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListRolloutsRequest # 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 metadata = @config.rpcs.list_rollouts.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_rollouts.timeout, metadata: metadata, retry_policy: @config.rpcs.list_rollouts.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :list_rollouts, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_rollouts, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Lists Targets in a given project and location.
@overload list_targets
(request, options = nil)
Pass arguments to `list_targets` via a request object, either of type {::Google::Cloud::Deploy::V1::ListTargetsRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::ListTargetsRequest, ::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_targets
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
Pass arguments to `list_targets` 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 parent, which owns this collection of targets. Format must be projects/\\{project_id}/locations/\\{location_name}. @param page_size [::Integer] Optional. The maximum number of `Target` objects to return. The service may return fewer than this value. If unspecified, at most 50 `Target` objects will be returned. The maximum value is 1000; values above 1000 will be set to 1000. @param page_token [::String] Optional. A page token, received from a previous `ListTargets` call. Provide this to retrieve the subsequent page. When paginating, all other provided parameters match the call that provided the page token. @param filter [::String] Optional. Filter targets to be returned. See https://google.aip.dev/160 for more details. @param order_by [::String] Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Target>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::Target>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::ListTargetsRequest.new # Call the list_targets method. result = client.list_targets request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Deploy::V1::Target. p response end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 841 def list_targets request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListTargetsRequest # 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 metadata = @config.rpcs.list_targets.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_targets.timeout, metadata: metadata, retry_policy: @config.rpcs.list_targets.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :list_targets, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_targets, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Updates the parameters of a single DeliveryPipeline.
@overload update_delivery_pipeline
(request, options = nil)
Pass arguments to `update_delivery_pipeline` via a request object, either of type {::Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest, ::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_delivery_pipeline
(update_mask: nil, delivery_pipeline: nil, request_id: nil, allow_missing: nil, validate_only: nil)
Pass arguments to `update_delivery_pipeline` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] Required. Field mask is used to specify the fields to be overwritten in the `DeliveryPipeline` resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. @param delivery_pipeline [::Google::Cloud::Deploy::V1::DeliveryPipeline, ::Hash] Required. The `DeliveryPipeline` to update. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param allow_missing [::Boolean] Optional. If set to true, updating a `DeliveryPipeline` that does not exist will result in the creation of a new `DeliveryPipeline`. @param validate_only [::Boolean] Optional. If set to true, the request is validated and the user is provided with an expected result, but no actual change is made.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest.new # Call the update_delivery_pipeline method. result = client.update_delivery_pipeline request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 611 def update_delivery_pipeline request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest # 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 metadata = @config.rpcs.update_delivery_pipeline.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.delivery_pipeline&.name header_params["delivery_pipeline.name"] = request.delivery_pipeline.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_delivery_pipeline.timeout, metadata: metadata, retry_policy: @config.rpcs.update_delivery_pipeline.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :update_delivery_pipeline, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Updates the parameters of a single Target.
@overload update_target
(request, options = nil)
Pass arguments to `update_target` via a request object, either of type {::Google::Cloud::Deploy::V1::UpdateTargetRequest} or an equivalent Hash. @param request [::Google::Cloud::Deploy::V1::UpdateTargetRequest, ::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_target
(update_mask: nil, target: nil, request_id: nil, allow_missing: nil, validate_only: nil)
Pass arguments to `update_target` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] Required. Field mask is used to specify the fields to be overwritten in the Target resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. @param target [::Google::Cloud::Deploy::V1::Target, ::Hash] Required. The `Target` to update. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param allow_missing [::Boolean] Optional. If set to true, updating a `Target` that does not exist will result in the creation of a new `Target`. @param validate_only [::Boolean] Optional. If set to true, the request is validated and the user is provided with an expected result, but no actual change is made.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
@example Basic example
require "google/cloud/deploy/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Deploy::V1::UpdateTargetRequest.new # Call the update_target method. result = client.update_target request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
# File lib/google/cloud/deploy/v1/cloud_deploy/client.rb, line 1162 def update_target request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::UpdateTargetRequest # 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 metadata = @config.rpcs.update_target.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers 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::Deploy::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.target&.name header_params["target.name"] = request.target.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_target.timeout, metadata: metadata, retry_policy: @config.rpcs.update_target.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_deploy_stub.call_rpc :update_target, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end