Cloud Build V1 API - Class Google::Cloud::Build::V1::CloudBuild::Rest::Client (v0.17.0)

Reference documentation and code samples for the Cloud Build V1 API class Google::Cloud::Build::V1::CloudBuild::Rest::Client.

REST client for the CloudBuild service.

Creates and manages builds on Google Cloud Platform.

The main concept used by this API is a Build, which describes the location of the source to build, how to build the source, and where to store the built artifacts, if any.

A user can list previously-requested builds or get builds by their ID to determine the status of the build.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the CloudBuild Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all CloudBuild clients
::Google::Cloud::Build::V1::CloudBuild::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#approve_build

def approve_build(request, options = nil) -> ::Gapic::Operation
def approve_build(name: nil, approval_result: nil) -> ::Gapic::Operation

Approves or rejects a pending build.

If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call.

If rejected, the returned LRO will be immediately done.

Overloads
def approve_build(request, options = nil) -> ::Gapic::Operation
Pass arguments to approve_build via a request object, either of type ApproveBuildRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::ApproveBuildRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def approve_build(name: nil, approval_result: nil) -> ::Gapic::Operation
Pass arguments to approve_build via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#cancel_build

def cancel_build(request, options = nil) -> ::Google::Cloud::Build::V1::Build
def cancel_build(name: nil, project_id: nil, id: nil) -> ::Google::Cloud::Build::V1::Build

Cancels a build in progress.

Overloads
def cancel_build(request, options = nil) -> ::Google::Cloud::Build::V1::Build
Pass arguments to cancel_build via a request object, either of type Google::Cloud::Build::V1::CancelBuildRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::CancelBuildRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def cancel_build(name: nil, project_id: nil, id: nil) -> ::Google::Cloud::Build::V1::Build
Pass arguments to cancel_build via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — The name of the Build to cancel. Format: projects/{project}/locations/{location}/builds/{build}
  • project_id (::String) — Required. ID of the project.
  • id (::String) — Required. ID of the build.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the CloudBuild 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 Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_build

def create_build(request, options = nil) -> ::Gapic::Operation
def create_build(parent: nil, project_id: nil, build: nil) -> ::Gapic::Operation

Starts a build with the specified configuration.

This method returns a long-running Operation, which includes the build ID. Pass the build ID to GetBuild to determine the build status (such as SUCCESS or FAILURE).

Overloads
def create_build(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_build via a request object, either of type Google::Cloud::Build::V1::CreateBuildRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::CreateBuildRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_build(parent: nil, project_id: nil, build: nil) -> ::Gapic::Operation
Pass arguments to create_build via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — The parent resource where this build will be created. Format: projects/{project}/locations/{location}
  • project_id (::String) — Required. ID of the project.
  • build (::Google::Cloud::Build::V1::Build, ::Hash) — Required. Build resource to create.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#create_build_trigger

def create_build_trigger(request, options = nil) -> ::Google::Cloud::Build::V1::BuildTrigger
def create_build_trigger(parent: nil, project_id: nil, trigger: nil) -> ::Google::Cloud::Build::V1::BuildTrigger

Creates a new BuildTrigger.

This API is experimental.

Overloads
def create_build_trigger(request, options = nil) -> ::Google::Cloud::Build::V1::BuildTrigger
Pass arguments to create_build_trigger via a request object, either of type Google::Cloud::Build::V1::CreateBuildTriggerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::CreateBuildTriggerRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_build_trigger(parent: nil, project_id: nil, trigger: nil) -> ::Google::Cloud::Build::V1::BuildTrigger
Pass arguments to create_build_trigger via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — The parent resource where this trigger will be created. Format: projects/{project}/locations/{location}
  • project_id (::String) — Required. ID of the project for which to configure automatic builds.
  • trigger (::Google::Cloud::Build::V1::BuildTrigger, ::Hash) — Required. BuildTrigger to create.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#create_worker_pool

def create_worker_pool(request, options = nil) -> ::Gapic::Operation
def create_worker_pool(parent: nil, worker_pool: nil, worker_pool_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a WorkerPool.

Overloads
def create_worker_pool(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_worker_pool via a request object, either of type Google::Cloud::Build::V1::CreateWorkerPoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::CreateWorkerPoolRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_worker_pool(parent: nil, worker_pool: nil, worker_pool_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_worker_pool via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource where this worker pool will be created. Format: projects/{project}/locations/{location}.
  • worker_pool (::Google::Cloud::Build::V1::WorkerPool, ::Hash) — Required. WorkerPool resource to create.
  • worker_pool_id (::String) — Required. Immutable. The ID to use for the WorkerPool, which will become the final component of the resource name.

    This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/.

  • validate_only (::Boolean) — If set, validate the request and preview the response, but do not actually post it.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_build_trigger

def delete_build_trigger(request, options = nil) -> ::Google::Protobuf::Empty
def delete_build_trigger(name: nil, project_id: nil, trigger_id: nil) -> ::Google::Protobuf::Empty

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Overloads
def delete_build_trigger(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_build_trigger via a request object, either of type DeleteBuildTriggerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::DeleteBuildTriggerRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_build_trigger(name: nil, project_id: nil, trigger_id: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_build_trigger via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — The name of the Trigger to delete. Format: projects/{project}/locations/{location}/triggers/{trigger}
  • project_id (::String) — Required. ID of the project that owns the trigger.
  • trigger_id (::String) — Required. ID of the BuildTrigger to delete.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_worker_pool

def delete_worker_pool(request, options = nil) -> ::Gapic::Operation
def delete_worker_pool(name: nil, etag: nil, allow_missing: nil, validate_only: nil) -> ::Gapic::Operation

Deletes a WorkerPool.

Overloads
def delete_worker_pool(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_worker_pool via a request object, either of type DeleteWorkerPoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::DeleteWorkerPoolRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_worker_pool(name: nil, etag: nil, allow_missing: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to delete_worker_pool via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The name of the WorkerPool to delete. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.
  • etag (::String) — Optional. If this is provided, it must match the server's etag on the workerpool for the request to be processed.
  • allow_missing (::Boolean) — If set to true, and the WorkerPool is not found, the request will succeed but no action will be taken on the server.
  • validate_only (::Boolean) — If set, validate the request and preview the response, but do not actually post it.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_build

def get_build(request, options = nil) -> ::Google::Cloud::Build::V1::Build
def get_build(name: nil, project_id: nil, id: nil) -> ::Google::Cloud::Build::V1::Build

Returns information about a previously requested build.

The Build that is returned includes its status (such as SUCCESS, FAILURE, or WORKING), and timing information.

Overloads
def get_build(request, options = nil) -> ::Google::Cloud::Build::V1::Build
Pass arguments to get_build via a request object, either of type GetBuildRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::GetBuildRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_build(name: nil, project_id: nil, id: nil) -> ::Google::Cloud::Build::V1::Build
Pass arguments to get_build via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — The name of the Build to retrieve. Format: projects/{project}/locations/{location}/builds/{build}
  • project_id (::String) — Required. ID of the project.
  • id (::String) — Required. ID of the build.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_build_trigger

def get_build_trigger(request, options = nil) -> ::Google::Cloud::Build::V1::BuildTrigger
def get_build_trigger(name: nil, project_id: nil, trigger_id: nil) -> ::Google::Cloud::Build::V1::BuildTrigger

Returns information about a BuildTrigger.

This API is experimental.

Overloads
def get_build_trigger(request, options = nil) -> ::Google::Cloud::Build::V1::BuildTrigger
Pass arguments to get_build_trigger via a request object, either of type GetBuildTriggerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::GetBuildTriggerRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_build_trigger(name: nil, project_id: nil, trigger_id: nil) -> ::Google::Cloud::Build::V1::BuildTrigger
Pass arguments to get_build_trigger via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — The name of the Trigger to retrieve. Format: projects/{project}/locations/{location}/triggers/{trigger}
  • project_id (::String) — Required. ID of the project that owns the trigger.
  • trigger_id (::String) — Required. Identifier (id or name) of the BuildTrigger to get.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_worker_pool

def get_worker_pool(request, options = nil) -> ::Google::Cloud::Build::V1::WorkerPool
def get_worker_pool(name: nil) -> ::Google::Cloud::Build::V1::WorkerPool

Returns details of a WorkerPool.

Overloads
def get_worker_pool(request, options = nil) -> ::Google::Cloud::Build::V1::WorkerPool
Pass arguments to get_worker_pool via a request object, either of type GetWorkerPoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::GetWorkerPoolRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_worker_pool(name: nil) -> ::Google::Cloud::Build::V1::WorkerPool
Pass arguments to get_worker_pool 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).
Parameter
  • name (::String) — Required. The name of the WorkerPool to retrieve. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#initialize

def initialize() { |config| ... } -> Client

Create a new CloudBuild REST client object.

Yields
  • (config) — Configure the CloudBuild client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Build::V1::CloudBuild::Rest::Client.new

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

#list_build_triggers

def list_build_triggers(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::BuildTrigger>
def list_build_triggers(parent: nil, project_id: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::BuildTrigger>

Lists existing BuildTriggers.

This API is experimental.

Overloads
def list_build_triggers(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::BuildTrigger>
Pass arguments to list_build_triggers via a request object, either of type ListBuildTriggersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::ListBuildTriggersRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_build_triggers(parent: nil, project_id: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::BuildTrigger>
Pass arguments to list_build_triggers via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — The parent of the collection of Triggers. Format: projects/{project}/locations/{location}
  • project_id (::String) — Required. ID of the project for which to list BuildTriggers.
  • page_size (::Integer) — Number of results to return in the list.
  • page_token (::String) — Token to provide to skip to a particular spot in the list.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#list_builds

def list_builds(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::Build>
def list_builds(parent: nil, project_id: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::Build>

Lists previously requested builds.

Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully.

Overloads
def list_builds(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::Build>
Pass arguments to list_builds via a request object, either of type ListBuildsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::ListBuildsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_builds(parent: nil, project_id: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::Build>
Pass arguments to list_builds via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — The parent of the collection of Builds. Format: projects/{project}/locations/{location}
  • project_id (::String) — Required. ID of the project.
  • page_size (::Integer) — Number of results to return in the list.
  • page_token (::String) — The page token for the next page of Builds.

    If unspecified, the first page of results is returned.

    If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. In this case, the token should be discarded, and pagination should be restarted from the first page of results.

    See https://google.aip.dev/158 for more.

  • filter (::String) — The raw filter text to constrain the results.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#list_worker_pools

def list_worker_pools(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::WorkerPool>
def list_worker_pools(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::WorkerPool>

Lists WorkerPools.

Overloads
def list_worker_pools(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::WorkerPool>
Pass arguments to list_worker_pools via a request object, either of type ListWorkerPoolsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::ListWorkerPoolsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_worker_pools(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Build::V1::WorkerPool>
Pass arguments to list_worker_pools via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent of the collection of WorkerPools. Format: projects/{project}/locations/{location}.
  • page_size (::Integer) — The maximum number of WorkerPools to return. The service may return fewer than this value. If omitted, the server will use a sensible default.
  • page_token (::String) — A page token, received from a previous ListWorkerPools call. Provide this to retrieve the subsequent page.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#operations_client

def operations_client() -> ::Google::Cloud::Build::V1::CloudBuild::Rest::Operations

Get the associated client for long-running operations.

#receive_trigger_webhook

def receive_trigger_webhook(request, options = nil) -> ::Google::Cloud::Build::V1::ReceiveTriggerWebhookResponse
def receive_trigger_webhook(name: nil, body: nil, project_id: nil, trigger: nil, secret: nil) -> ::Google::Cloud::Build::V1::ReceiveTriggerWebhookResponse

ReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger.

Overloads
def receive_trigger_webhook(request, options = nil) -> ::Google::Cloud::Build::V1::ReceiveTriggerWebhookResponse
Pass arguments to receive_trigger_webhook via a request object, either of type ReceiveTriggerWebhookRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::ReceiveTriggerWebhookRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def receive_trigger_webhook(name: nil, body: nil, project_id: nil, trigger: nil, secret: nil) -> ::Google::Cloud::Build::V1::ReceiveTriggerWebhookResponse
Pass arguments to receive_trigger_webhook via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — The name of the ReceiveTriggerWebhook to retrieve. Format: projects/{project}/locations/{location}/triggers/{trigger}
  • body (::Google::Api::HttpBody, ::Hash) — HTTP request body.
  • project_id (::String) — Project in which the specified trigger lives
  • trigger (::String) — Name of the trigger to run the payload against
  • secret (::String) — Secret token used for authorization if an OAuth token isn't provided.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#retry_build

def retry_build(request, options = nil) -> ::Gapic::Operation
def retry_build(name: nil, project_id: nil, id: nil) -> ::Gapic::Operation

Creates a new build based on the specified build.

This method creates a new build using the original build request, which may or may not result in an identical build.

For triggered builds:

  • Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision.

For non-triggered builds that specify RepoSource:

  • If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build.
  • If the original build specified a commit sha or revision ID, the retried build will use the identical source.

For builds that specify StorageSource:

  • If the original build pulled source from Google Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source.
  • If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings.
Overloads
def retry_build(request, options = nil) -> ::Gapic::Operation
Pass arguments to retry_build via a request object, either of type RetryBuildRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::RetryBuildRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def retry_build(name: nil, project_id: nil, id: nil) -> ::Gapic::Operation
Pass arguments to retry_build via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — The name of the Build to retry. Format: projects/{project}/locations/{location}/builds/{build}
  • project_id (::String) — Required. ID of the project.
  • id (::String) — Required. Build ID of the original build.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#run_build_trigger

def run_build_trigger(request, options = nil) -> ::Gapic::Operation
def run_build_trigger(name: nil, project_id: nil, trigger_id: nil, source: nil) -> ::Gapic::Operation

Runs a BuildTrigger at a particular source revision.

Overloads
def run_build_trigger(request, options = nil) -> ::Gapic::Operation
Pass arguments to run_build_trigger via a request object, either of type RunBuildTriggerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::RunBuildTriggerRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def run_build_trigger(name: nil, project_id: nil, trigger_id: nil, source: nil) -> ::Gapic::Operation
Pass arguments to run_build_trigger via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — The name of the Trigger to run. Format: projects/{project}/locations/{location}/triggers/{trigger}
  • project_id (::String) — Required. ID of the project.
  • trigger_id (::String) — Required. ID of the trigger.
  • source (::Google::Cloud::Build::V1::RepoSource, ::Hash) — Source to build against this trigger.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_build_trigger

def update_build_trigger(request, options = nil) -> ::Google::Cloud::Build::V1::BuildTrigger
def update_build_trigger(project_id: nil, trigger_id: nil, trigger: nil) -> ::Google::Cloud::Build::V1::BuildTrigger

Updates a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Overloads
def update_build_trigger(request, options = nil) -> ::Google::Cloud::Build::V1::BuildTrigger
Pass arguments to update_build_trigger via a request object, either of type UpdateBuildTriggerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::UpdateBuildTriggerRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_build_trigger(project_id: nil, trigger_id: nil, trigger: nil) -> ::Google::Cloud::Build::V1::BuildTrigger
Pass arguments to update_build_trigger via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • project_id (::String) — Required. ID of the project that owns the trigger.
  • trigger_id (::String) — Required. ID of the BuildTrigger to update.
  • trigger (::Google::Cloud::Build::V1::BuildTrigger, ::Hash) — Required. BuildTrigger to update.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_worker_pool

def update_worker_pool(request, options = nil) -> ::Gapic::Operation
def update_worker_pool(worker_pool: nil, update_mask: nil, validate_only: nil) -> ::Gapic::Operation

Updates a WorkerPool.

Overloads
def update_worker_pool(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_worker_pool via a request object, either of type UpdateWorkerPoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Build::V1::UpdateWorkerPoolRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_worker_pool(worker_pool: nil, update_mask: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to update_worker_pool via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • worker_pool (::Google::Cloud::Build::V1::WorkerPool, ::Hash) — Required. The WorkerPool to update.

    The name field is used to identify the WorkerPool to update. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — A mask specifying which fields in worker_pool to update.
  • validate_only (::Boolean) — If set, validate the request and preview the response, but do not actually post it.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.