Class CloudBuildClient (2.33.0)

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.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

CloudBuildClient(CloudBuildClient const &)

Copy and move support

Parameter
Name Description
CloudBuildClient const &

CloudBuildClient(CloudBuildClient &&)

Copy and move support

Parameter
Name Description
CloudBuildClient &&

CloudBuildClient(std::shared_ptr< CloudBuildConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< CloudBuildConnection >
opts Options

Operators

operator=(CloudBuildClient const &)

Copy and move support

Parameter
Name Description
CloudBuildClient const &
Returns
Type Description
CloudBuildClient &

operator=(CloudBuildClient &&)

Copy and move support

Parameter
Name Description
CloudBuildClient &&
Returns
Type Description
CloudBuildClient &

Functions

CreateBuild(std::string const &, google::devtools::cloudbuild::v1::Build const &, Options)

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).

Parameters
Name Description
project_id std::string const &

Required. ID of the project.

build google::devtools::cloudbuild::v1::Build const &

Required. Build resource to create.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.Build proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateBuild(NoAwaitTag, std::string const &, google::devtools::cloudbuild::v1::Build const &, Options)

Starts a build with the specified configuration.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
project_id std::string const &
build google::devtools::cloudbuild::v1::Build const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateBuild(google::devtools::cloudbuild::v1::CreateBuildRequest const &, Options)

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).

Parameters
Name Description
request google::devtools::cloudbuild::v1::CreateBuildRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.CreateBuildRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.Build proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateBuild(NoAwaitTag, google::devtools::cloudbuild::v1::CreateBuildRequest const &, Options)

Starts a build with the specified configuration.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::devtools::cloudbuild::v1::CreateBuildRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateBuild(google::longrunning::Operation const &, Options)

Starts a build with the specified configuration.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

GetBuild(std::string const &, std::string const &, Options)

Returns information about a previously requested build.

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

Parameters
Name Description
project_id std::string const &

Required. ID of the project.

id std::string const &

Required. ID of the build.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::Build >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.Build) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetBuild(google::devtools::cloudbuild::v1::GetBuildRequest const &, Options)

Returns information about a previously requested build.

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

Parameters
Name Description
request google::devtools::cloudbuild::v1::GetBuildRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.GetBuildRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::Build >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.Build) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListBuilds(std::string const &, std::string const &, Options)

Lists previously requested builds.

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

Parameters
Name Description
project_id std::string const &

Required. ID of the project.

filter std::string const &

The raw filter text to constrain the results.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::devtools::cloudbuild::v1::Build >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.devtools.cloudbuild.v1.Build, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListBuilds(google::devtools::cloudbuild::v1::ListBuildsRequest, Options)

Lists previously requested builds.

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

Parameters
Name Description
request google::devtools::cloudbuild::v1::ListBuildsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.ListBuildsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::devtools::cloudbuild::v1::Build >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.devtools.cloudbuild.v1.Build, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

CancelBuild(std::string const &, std::string const &, Options)

Cancels a build in progress.

Parameters
Name Description
project_id std::string const &

Required. ID of the project.

id std::string const &

Required. ID of the build.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::Build >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.Build) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CancelBuild(google::devtools::cloudbuild::v1::CancelBuildRequest const &, Options)

Cancels a build in progress.

Parameters
Name Description
request google::devtools::cloudbuild::v1::CancelBuildRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.CancelBuildRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::Build >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.Build) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

RetryBuild(std::string const &, std::string const &, Options)

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 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.
Parameters
Name Description
project_id std::string const &

Required. ID of the project.

id std::string const &

Required. Build ID of the original build.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.Build proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RetryBuild(NoAwaitTag, std::string const &, std::string const &, Options)

Creates a new build based on the specified build.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
project_id std::string const &
id std::string const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

RetryBuild(google::devtools::cloudbuild::v1::RetryBuildRequest const &, Options)

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 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.
Parameters
Name Description
request google::devtools::cloudbuild::v1::RetryBuildRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.RetryBuildRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.Build proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RetryBuild(NoAwaitTag, google::devtools::cloudbuild::v1::RetryBuildRequest const &, Options)

Creates a new build based on the specified build.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::devtools::cloudbuild::v1::RetryBuildRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

RetryBuild(google::longrunning::Operation const &, Options)

Creates a new build based on the specified build.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

ApproveBuild(std::string const &, google::devtools::cloudbuild::v1::ApprovalResult const &, Options)

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.

Parameters
Name Description
name std::string const &

Required. Name of the target build. For example: "projects/{$project_id}/builds/{$build_id}"

approval_result google::devtools::cloudbuild::v1::ApprovalResult const &

Approval decision and metadata.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.Build proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

ApproveBuild(NoAwaitTag, std::string const &, google::devtools::cloudbuild::v1::ApprovalResult const &, Options)

Approves or rejects a pending build.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
name std::string const &
approval_result google::devtools::cloudbuild::v1::ApprovalResult const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

ApproveBuild(google::devtools::cloudbuild::v1::ApproveBuildRequest const &, Options)

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.

Parameters
Name Description
request google::devtools::cloudbuild::v1::ApproveBuildRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.ApproveBuildRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.Build proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

ApproveBuild(NoAwaitTag, google::devtools::cloudbuild::v1::ApproveBuildRequest const &, Options)

Approves or rejects a pending build.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::devtools::cloudbuild::v1::ApproveBuildRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

ApproveBuild(google::longrunning::Operation const &, Options)

Approves or rejects a pending build.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

CreateBuildTrigger(std::string const &, google::devtools::cloudbuild::v1::BuildTrigger const &, Options)

Creates a new BuildTrigger.

This API is experimental.

Parameters
Name Description
project_id std::string const &

Required. ID of the project for which to configure automatic builds.

trigger google::devtools::cloudbuild::v1::BuildTrigger const &

Required. BuildTrigger to create.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.BuildTrigger) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateBuildTrigger(google::devtools::cloudbuild::v1::CreateBuildTriggerRequest const &, Options)

Creates a new BuildTrigger.

This API is experimental.

Parameters
Name Description
request google::devtools::cloudbuild::v1::CreateBuildTriggerRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.CreateBuildTriggerRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.BuildTrigger) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetBuildTrigger(std::string const &, std::string const &, Options)

Returns information about a BuildTrigger.

This API is experimental.

Parameters
Name Description
project_id std::string const &

Required. ID of the project that owns the trigger.

trigger_id std::string const &

Required. Identifier (id or name) of the BuildTrigger to get.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.BuildTrigger) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetBuildTrigger(google::devtools::cloudbuild::v1::GetBuildTriggerRequest const &, Options)

Returns information about a BuildTrigger.

This API is experimental.

Parameters
Name Description
request google::devtools::cloudbuild::v1::GetBuildTriggerRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.GetBuildTriggerRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.BuildTrigger) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListBuildTriggers(std::string const &, Options)

Lists existing BuildTriggers.

This API is experimental.

Parameters
Name Description
project_id std::string const &

Required. ID of the project for which to list BuildTriggers.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::devtools::cloudbuild::v1::BuildTrigger >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.devtools.cloudbuild.v1.BuildTrigger, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListBuildTriggers(google::devtools::cloudbuild::v1::ListBuildTriggersRequest, Options)

Lists existing BuildTriggers.

This API is experimental.

Parameters
Name Description
request google::devtools::cloudbuild::v1::ListBuildTriggersRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.ListBuildTriggersRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::devtools::cloudbuild::v1::BuildTrigger >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.devtools.cloudbuild.v1.BuildTrigger, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

DeleteBuildTrigger(std::string const &, std::string const &, Options)

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
Name Description
project_id std::string const &

Required. ID of the project that owns the trigger.

trigger_id std::string const &

Required. ID of the BuildTrigger to delete.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteBuildTrigger(google::devtools::cloudbuild::v1::DeleteBuildTriggerRequest const &, Options)

Deletes a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
Name Description
request google::devtools::cloudbuild::v1::DeleteBuildTriggerRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

UpdateBuildTrigger(std::string const &, std::string const &, google::devtools::cloudbuild::v1::BuildTrigger const &, Options)

Updates a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
Name Description
project_id std::string const &

Required. ID of the project that owns the trigger.

trigger_id std::string const &

Required. ID of the BuildTrigger to update.

trigger google::devtools::cloudbuild::v1::BuildTrigger const &

Required. BuildTrigger to update.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.BuildTrigger) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateBuildTrigger(google::devtools::cloudbuild::v1::UpdateBuildTriggerRequest const &, Options)

Updates a BuildTrigger by its project ID and trigger ID.

This API is experimental.

Parameters
Name Description
request google::devtools::cloudbuild::v1::UpdateBuildTriggerRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::BuildTrigger >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.BuildTrigger) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

RunBuildTrigger(std::string const &, std::string const &, google::devtools::cloudbuild::v1::RepoSource const &, Options)

Runs a BuildTrigger at a particular source revision.

To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.

Parameters
Name Description
project_id std::string const &

Required. ID of the project.

trigger_id std::string const &

Required. ID of the trigger.

source google::devtools::cloudbuild::v1::RepoSource const &

Source to build against this trigger. Branch and tag names cannot consist of regular expressions.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.Build proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RunBuildTrigger(NoAwaitTag, std::string const &, std::string const &, google::devtools::cloudbuild::v1::RepoSource const &, Options)

Runs a BuildTrigger at a particular source revision.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
project_id std::string const &
trigger_id std::string const &
source google::devtools::cloudbuild::v1::RepoSource const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

RunBuildTrigger(google::devtools::cloudbuild::v1::RunBuildTriggerRequest const &, Options)

Runs a BuildTrigger at a particular source revision.

To run a regional or global trigger, use the POST request that includes the location endpoint in the path (ex. v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The POST request that does not include the location endpoint in the path can only be used when running global triggers.

Parameters
Name Description
request google::devtools::cloudbuild::v1::RunBuildTriggerRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.RunBuildTriggerRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.Build proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RunBuildTrigger(NoAwaitTag, google::devtools::cloudbuild::v1::RunBuildTriggerRequest const &, Options)

Runs a BuildTrigger at a particular source revision.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::devtools::cloudbuild::v1::RunBuildTriggerRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

RunBuildTrigger(google::longrunning::Operation const &, Options)

Runs a BuildTrigger at a particular source revision.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::Build > >

ReceiveTriggerWebhook(google::devtools::cloudbuild::v1::ReceiveTriggerWebhookRequest const &, Options)

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

Parameters
Name Description
request google::devtools::cloudbuild::v1::ReceiveTriggerWebhookRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::ReceiveTriggerWebhookResponse >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateWorkerPool(std::string const &, google::devtools::cloudbuild::v1::WorkerPool const &, std::string const &, Options)

Creates a WorkerPool.

Parameters
Name Description
parent std::string const &

Required. The parent resource where this worker pool will be created. Format: projects/{project}/locations/{location}.

worker_pool google::devtools::cloudbuild::v1::WorkerPool const &

Required. WorkerPool resource to create.

worker_pool_id std::string const &

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]-/.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::WorkerPool > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.WorkerPool proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateWorkerPool(NoAwaitTag, std::string const &, google::devtools::cloudbuild::v1::WorkerPool const &, std::string const &, Options)

Creates a WorkerPool.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
parent std::string const &
worker_pool google::devtools::cloudbuild::v1::WorkerPool const &
worker_pool_id std::string const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateWorkerPool(google::devtools::cloudbuild::v1::CreateWorkerPoolRequest const &, Options)

Creates a WorkerPool.

Parameters
Name Description
request google::devtools::cloudbuild::v1::CreateWorkerPoolRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.CreateWorkerPoolRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::WorkerPool > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.WorkerPool proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateWorkerPool(NoAwaitTag, google::devtools::cloudbuild::v1::CreateWorkerPoolRequest const &, Options)

Creates a WorkerPool.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::devtools::cloudbuild::v1::CreateWorkerPoolRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateWorkerPool(google::longrunning::Operation const &, Options)

Creates a WorkerPool.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::WorkerPool > >

GetWorkerPool(std::string const &, Options)

Returns details of a WorkerPool.

Parameters
Name Description
name std::string const &

Required. The name of the WorkerPool to retrieve. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::WorkerPool >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.WorkerPool) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetWorkerPool(google::devtools::cloudbuild::v1::GetWorkerPoolRequest const &, Options)

Returns details of a WorkerPool.

Parameters
Name Description
request google::devtools::cloudbuild::v1::GetWorkerPoolRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.GetWorkerPoolRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::devtools::cloudbuild::v1::WorkerPool >

the result of the RPC. The response message type (google.devtools.cloudbuild.v1.WorkerPool) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeleteWorkerPool(std::string const &, Options)

Deletes a WorkerPool.

Parameters
Name Description
name std::string const &

Required. The name of the WorkerPool to delete. Format: projects/{project}/locations/{location}/workerPools/{workerPool}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::DeleteWorkerPoolOperationMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteWorkerPool(NoAwaitTag, std::string const &, Options)

Deletes a WorkerPool.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
name std::string const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

DeleteWorkerPool(google::devtools::cloudbuild::v1::DeleteWorkerPoolRequest const &, Options)

Deletes a WorkerPool.

Parameters
Name Description
request google::devtools::cloudbuild::v1::DeleteWorkerPoolRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::DeleteWorkerPoolOperationMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteWorkerPool(NoAwaitTag, google::devtools::cloudbuild::v1::DeleteWorkerPoolRequest const &, Options)

Deletes a WorkerPool.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::devtools::cloudbuild::v1::DeleteWorkerPoolRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

DeleteWorkerPool(google::longrunning::Operation const &, Options)

Deletes a WorkerPool.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::DeleteWorkerPoolOperationMetadata > >

UpdateWorkerPool(google::devtools::cloudbuild::v1::WorkerPool const &, google::protobuf::FieldMask const &, Options)

Updates a WorkerPool.

Parameters
Name Description
worker_pool google::devtools::cloudbuild::v1::WorkerPool const &

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 const &

A mask specifying which fields in worker_pool to update.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::WorkerPool > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.WorkerPool proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateWorkerPool(NoAwaitTag, google::devtools::cloudbuild::v1::WorkerPool const &, google::protobuf::FieldMask const &, Options)

Updates a WorkerPool.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
worker_pool google::devtools::cloudbuild::v1::WorkerPool const &
update_mask google::protobuf::FieldMask const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

UpdateWorkerPool(google::devtools::cloudbuild::v1::UpdateWorkerPoolRequest const &, Options)

Updates a WorkerPool.

Parameters
Name Description
request google::devtools::cloudbuild::v1::UpdateWorkerPoolRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::WorkerPool > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.devtools.cloudbuild.v1.WorkerPool proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateWorkerPool(NoAwaitTag, google::devtools::cloudbuild::v1::UpdateWorkerPoolRequest const &, Options)

Updates a WorkerPool.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::devtools::cloudbuild::v1::UpdateWorkerPoolRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

UpdateWorkerPool(google::longrunning::Operation const &, Options)

Updates a WorkerPool.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::devtools::cloudbuild::v1::WorkerPool > >

ListWorkerPools(std::string const &, Options)

Lists WorkerPools.

Parameters
Name Description
parent std::string const &

Required. The parent of the collection of WorkerPools. Format: projects/{project}/locations/{location}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::devtools::cloudbuild::v1::WorkerPool >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.devtools.cloudbuild.v1.WorkerPool, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListWorkerPools(google::devtools::cloudbuild::v1::ListWorkerPoolsRequest, Options)

Lists WorkerPools.

Parameters
Name Description
request google::devtools::cloudbuild::v1::ListWorkerPoolsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.cloudbuild.v1.ListWorkerPoolsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::devtools::cloudbuild::v1::WorkerPool >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.devtools.cloudbuild.v1.WorkerPool, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.