public abstract class CloudBuildClient
Reference documentation and code samples for the Cloud Build v1 API class CloudBuildClient.
CloudBuild client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.CloudBuild.V1Assembly
Google.Cloud.CloudBuild.V1.dll
Remarks
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.
Properties
ApproveBuildOperationsClient
public virtual OperationsClient ApproveBuildOperationsClient { get; }
The long-running operations client for ApproveBuild
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
CreateBuildOperationsClient
public virtual OperationsClient CreateBuildOperationsClient { get; }
The long-running operations client for CreateBuild
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
CreateWorkerPoolOperationsClient
public virtual OperationsClient CreateWorkerPoolOperationsClient { get; }
The long-running operations client for CreateWorkerPool
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the CloudBuild service, which is a host of "cloudbuild.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default CloudBuild scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default CloudBuild scopes are:
DeleteWorkerPoolOperationsClient
public virtual OperationsClient DeleteWorkerPoolOperationsClient { get; }
The long-running operations client for DeleteWorkerPool
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
GrpcClient
public virtual CloudBuild.CloudBuildClient GrpcClient { get; }
The underlying gRPC CloudBuild client
Property Value | |
---|---|
Type | Description |
CloudBuildCloudBuildClient |
RetryBuildOperationsClient
public virtual OperationsClient RetryBuildOperationsClient { get; }
The long-running operations client for RetryBuild
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
RunBuildTriggerOperationsClient
public virtual OperationsClient RunBuildTriggerOperationsClient { get; }
The long-running operations client for RunBuildTrigger
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
UpdateWorkerPoolOperationsClient
public virtual OperationsClient UpdateWorkerPoolOperationsClient { get; }
The long-running operations client for UpdateWorkerPool
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
Methods
ApproveBuild(ApproveBuildRequest, CallSettings)
public virtual Operation<Build, BuildOperationMetadata> ApproveBuild(ApproveBuildRequest request, CallSettings callSettings = null)
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 | ApproveBuildRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBuildBuildOperationMetadata | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
ApproveBuildRequest request = new ApproveBuildRequest
{
Name = "",
ApprovalResult = new ApprovalResult(),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.ApproveBuild(request);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceApproveBuild(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
ApproveBuild(string, ApprovalResult, CallSettings)
public virtual Operation<Build, BuildOperationMetadata> ApproveBuild(string name, ApprovalResult approvalResult, CallSettings callSettings = null)
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 | string Required. Name of the target build. For example: "projects/{$project_id}/builds/{$build_id}" |
approvalResult | ApprovalResult Approval decision and metadata. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBuildBuildOperationMetadata | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string name = "";
ApprovalResult approvalResult = new ApprovalResult();
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.ApproveBuild(name, approvalResult);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceApproveBuild(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
ApproveBuildAsync(ApproveBuildRequest, CallSettings)
public virtual Task<Operation<Build, BuildOperationMetadata>> ApproveBuildAsync(ApproveBuildRequest request, CallSettings callSettings = null)
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 | ApproveBuildRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBuildBuildOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ApproveBuildRequest request = new ApproveBuildRequest
{
Name = "",
ApprovalResult = new ApprovalResult(),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.ApproveBuildAsync(request);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceApproveBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
ApproveBuildAsync(ApproveBuildRequest, CancellationToken)
public virtual Task<Operation<Build, BuildOperationMetadata>> ApproveBuildAsync(ApproveBuildRequest request, CancellationToken cancellationToken)
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 | ApproveBuildRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBuildBuildOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
ApproveBuildRequest request = new ApproveBuildRequest
{
Name = "",
ApprovalResult = new ApprovalResult(),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.ApproveBuildAsync(request);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceApproveBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
ApproveBuildAsync(string, ApprovalResult, CallSettings)
public virtual Task<Operation<Build, BuildOperationMetadata>> ApproveBuildAsync(string name, ApprovalResult approvalResult, CallSettings callSettings = null)
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 | string Required. Name of the target build. For example: "projects/{$project_id}/builds/{$build_id}" |
approvalResult | ApprovalResult Approval decision and metadata. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBuildBuildOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string name = "";
ApprovalResult approvalResult = new ApprovalResult();
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.ApproveBuildAsync(name, approvalResult);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceApproveBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
ApproveBuildAsync(string, ApprovalResult, CancellationToken)
public virtual Task<Operation<Build, BuildOperationMetadata>> ApproveBuildAsync(string name, ApprovalResult approvalResult, CancellationToken cancellationToken)
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 | string Required. Name of the target build. For example: "projects/{$project_id}/builds/{$build_id}" |
approvalResult | ApprovalResult Approval decision and metadata. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBuildBuildOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string name = "";
ApprovalResult approvalResult = new ApprovalResult();
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.ApproveBuildAsync(name, approvalResult);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceApproveBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
CancelBuild(CancelBuildRequest, CallSettings)
public virtual Build CancelBuild(CancelBuildRequest request, CallSettings callSettings = null)
Cancels a build in progress.
Parameters | |
---|---|
Name | Description |
request | CancelBuildRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Build | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CancelBuildRequest request = new CancelBuildRequest
{
ProjectId = "",
Id = "",
BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Build response = cloudBuildClient.CancelBuild(request);
CancelBuild(string, string, CallSettings)
public virtual Build CancelBuild(string projectId, string id, CallSettings callSettings = null)
Cancels a build in progress.
Parameters | |
---|---|
Name | Description |
projectId | string Required. ID of the project. |
id | string Required. ID of the build. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Build | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Build response = cloudBuildClient.CancelBuild(projectId, id);
CancelBuildAsync(CancelBuildRequest, CallSettings)
public virtual Task<Build> CancelBuildAsync(CancelBuildRequest request, CallSettings callSettings = null)
Cancels a build in progress.
Parameters | |
---|---|
Name | Description |
request | CancelBuildRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskBuild | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CancelBuildRequest request = new CancelBuildRequest
{
ProjectId = "",
Id = "",
BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Build response = await cloudBuildClient.CancelBuildAsync(request);
CancelBuildAsync(CancelBuildRequest, CancellationToken)
public virtual Task<Build> CancelBuildAsync(CancelBuildRequest request, CancellationToken cancellationToken)
Cancels a build in progress.
Parameters | |
---|---|
Name | Description |
request | CancelBuildRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskBuild | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CancelBuildRequest request = new CancelBuildRequest
{
ProjectId = "",
Id = "",
BuildName = BuildName.FromProjectBuild("[PROJECT]", "[BUILD]"),
};
// Make the request
Build response = await cloudBuildClient.CancelBuildAsync(request);
CancelBuildAsync(string, string, CallSettings)
public virtual Task<Build> CancelBuildAsync(string projectId, string id, CallSettings callSettings = null)
Cancels a build in progress.
Parameters | |
---|---|
Name | Description |
projectId | string Required. ID of the project. |
id | string Required. ID of the build. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskBuild | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Build response = await cloudBuildClient.CancelBuildAsync(projectId, id);
CancelBuildAsync(string, string, CancellationToken)
public virtual Task<Build> CancelBuildAsync(string projectId, string id, CancellationToken cancellationToken)
Cancels a build in progress.
Parameters | |
---|---|
Name | Description |
projectId | string Required. ID of the project. |
id | string Required. ID of the build. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskBuild | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string id = "";
// Make the request
Build response = await cloudBuildClient.CancelBuildAsync(projectId, id);
Create()
public static CloudBuildClient Create()
Synchronously creates a CloudBuildClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudBuildClientBuilder.
Returns | |
---|---|
Type | Description |
CloudBuildClient | The created CloudBuildClient. |
CreateAsync(CancellationToken)
public static Task<CloudBuildClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a CloudBuildClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CloudBuildClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskCloudBuildClient | The task representing the created CloudBuildClient. |
CreateBuild(CreateBuildRequest, CallSettings)
public virtual Operation<Build, BuildOperationMetadata> CreateBuild(CreateBuildRequest request, CallSettings callSettings = null)
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 | CreateBuildRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBuildBuildOperationMetadata | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CreateBuildRequest request = new CreateBuildRequest
{
ProjectId = "",
Build = new Build(),
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.CreateBuild(request);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateBuild(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
CreateBuild(string, Build, CallSettings)
public virtual Operation<Build, BuildOperationMetadata> CreateBuild(string projectId, Build build, CallSettings callSettings = null)
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 |
projectId | string Required. ID of the project. |
build | Build Required. Build resource to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBuildBuildOperationMetadata | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
Build build = new Build();
// Make the request
Operation<Build, BuildOperationMetadata> response = cloudBuildClient.CreateBuild(projectId, build);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateBuild(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
CreateBuildAsync(CreateBuildRequest, CallSettings)
public virtual Task<Operation<Build, BuildOperationMetadata>> CreateBuildAsync(CreateBuildRequest request, CallSettings callSettings = null)
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 | CreateBuildRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBuildBuildOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateBuildRequest request = new CreateBuildRequest
{
ProjectId = "",
Build = new Build(),
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.CreateBuildAsync(request);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
CreateBuildAsync(CreateBuildRequest, CancellationToken)
public virtual Task<Operation<Build, BuildOperationMetadata>> CreateBuildAsync(CreateBuildRequest request, CancellationToken cancellationToken)
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 | CreateBuildRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBuildBuildOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateBuildRequest request = new CreateBuildRequest
{
ProjectId = "",
Build = new Build(),
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.CreateBuildAsync(request);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
CreateBuildAsync(string, Build, CallSettings)
public virtual Task<Operation<Build, BuildOperationMetadata>> CreateBuildAsync(string projectId, Build build, CallSettings callSettings = null)
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 |
projectId | string Required. ID of the project. |
build | Build Required. Build resource to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBuildBuildOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
Build build = new Build();
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.CreateBuildAsync(projectId, build);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
CreateBuildAsync(string, Build, CancellationToken)
public virtual Task<Operation<Build, BuildOperationMetadata>> CreateBuildAsync(string projectId, Build build, CancellationToken cancellationToken)
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 |
projectId | string Required. ID of the project. |
build | Build Required. Build resource to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBuildBuildOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
Build build = new Build();
// Make the request
Operation<Build, BuildOperationMetadata> response = await cloudBuildClient.CreateBuildAsync(projectId, build);
// Poll until the returned long-running operation is complete
Operation<Build, BuildOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Build result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Build, BuildOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateBuildAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Build retrievedResult = retrievedResponse.Result;
}
CreateBuildTrigger(CreateBuildTriggerRequest, CallSettings)
public virtual BuildTrigger CreateBuildTrigger(CreateBuildTriggerRequest request, CallSettings callSettings = null)
Creates a new BuildTrigger
.
This API is experimental.
Parameters | |
---|---|
Name | Description |
request | CreateBuildTriggerRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
BuildTrigger | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CreateBuildTriggerRequest request = new CreateBuildTriggerRequest
{
ProjectId = "",
Trigger = new BuildTrigger(),
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
BuildTrigger response = cloudBuildClient.CreateBuildTrigger(request);
CreateBuildTrigger(string, BuildTrigger, CallSettings)
public virtual BuildTrigger CreateBuildTrigger(string projectId, BuildTrigger trigger, CallSettings callSettings = null)
Creates a new BuildTrigger
.
This API is experimental.
Parameters | |
---|---|
Name | Description |
projectId | string Required. ID of the project for which to configure automatic builds. |
trigger | BuildTrigger Required. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
BuildTrigger | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
BuildTrigger trigger = new BuildTrigger();
// Make the request
BuildTrigger response = cloudBuildClient.CreateBuildTrigger(projectId, trigger);
CreateBuildTriggerAsync(CreateBuildTriggerRequest, CallSettings)
public virtual Task<BuildTrigger> CreateBuildTriggerAsync(CreateBuildTriggerRequest request, CallSettings callSettings = null)
Creates a new BuildTrigger
.
This API is experimental.
Parameters | |
---|---|
Name | Description |
request | CreateBuildTriggerRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskBuildTrigger | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateBuildTriggerRequest request = new CreateBuildTriggerRequest
{
ProjectId = "",
Trigger = new BuildTrigger(),
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
BuildTrigger response = await cloudBuildClient.CreateBuildTriggerAsync(request);
CreateBuildTriggerAsync(CreateBuildTriggerRequest, CancellationToken)
public virtual Task<BuildTrigger> CreateBuildTriggerAsync(CreateBuildTriggerRequest request, CancellationToken cancellationToken)
Creates a new BuildTrigger
.
This API is experimental.
Parameters | |
---|---|
Name | Description |
request | CreateBuildTriggerRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskBuildTrigger | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateBuildTriggerRequest request = new CreateBuildTriggerRequest
{
ProjectId = "",
Trigger = new BuildTrigger(),
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
BuildTrigger response = await cloudBuildClient.CreateBuildTriggerAsync(request);
CreateBuildTriggerAsync(string, BuildTrigger, CallSettings)
public virtual Task<BuildTrigger> CreateBuildTriggerAsync(string projectId, BuildTrigger trigger, CallSettings callSettings = null)
Creates a new BuildTrigger
.
This API is experimental.
Parameters | |
---|---|
Name | Description |
projectId | string Required. ID of the project for which to configure automatic builds. |
trigger | BuildTrigger Required. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskBuildTrigger | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
BuildTrigger trigger = new BuildTrigger();
// Make the request
BuildTrigger response = await cloudBuildClient.CreateBuildTriggerAsync(projectId, trigger);
CreateBuildTriggerAsync(string, BuildTrigger, CancellationToken)
public virtual Task<BuildTrigger> CreateBuildTriggerAsync(string projectId, BuildTrigger trigger, CancellationToken cancellationToken)
Creates a new BuildTrigger
.
This API is experimental.
Parameters | |
---|---|
Name | Description |
projectId | string Required. ID of the project for which to configure automatic builds. |
trigger | BuildTrigger Required. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskBuildTrigger | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
BuildTrigger trigger = new BuildTrigger();
// Make the request
BuildTrigger response = await cloudBuildClient.CreateBuildTriggerAsync(projectId, trigger);
CreateWorkerPool(LocationName, WorkerPool, string, CallSettings)
public virtual Operation<WorkerPool, CreateWorkerPoolOperationMetadata> CreateWorkerPool(LocationName parent, WorkerPool workerPool, string workerPoolId, CallSettings callSettings = null)
Creates a WorkerPool
.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent resource where this worker pool will be created.
Format: |
workerPool | WorkerPool Required. |
workerPoolId | string Required. Immutable. The ID to use for the This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationWorkerPoolCreateWorkerPoolOperationMetadata | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = cloudBuildClient.CreateWorkerPool(parent, workerPool, workerPoolId);
// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
WorkerPool result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
WorkerPool retrievedResult = retrievedResponse.Result;
}
CreateWorkerPool(CreateWorkerPoolRequest, CallSettings)
public virtual Operation<WorkerPool, CreateWorkerPoolOperationMetadata> CreateWorkerPool(CreateWorkerPoolRequest request, CallSettings callSettings = null)
Creates a WorkerPool
.
Parameters | |
---|---|
Name | Description |
request | CreateWorkerPoolRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationWorkerPoolCreateWorkerPoolOperationMetadata | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
CreateWorkerPoolRequest request = new CreateWorkerPoolRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
WorkerPool = new WorkerPool(),
WorkerPoolId = "",
ValidateOnly = false,
};
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = cloudBuildClient.CreateWorkerPool(request);
// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
WorkerPool result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
WorkerPool retrievedResult = retrievedResponse.Result;
}
CreateWorkerPool(string, WorkerPool, string, CallSettings)
public virtual Operation<WorkerPool, CreateWorkerPoolOperationMetadata> CreateWorkerPool(string parent, WorkerPool workerPool, string workerPoolId, CallSettings callSettings = null)
Creates a WorkerPool
.
Parameters | |
---|---|
Name | Description |
parent | string Required. The parent resource where this worker pool will be created.
Format: |
workerPool | WorkerPool Required. |
workerPoolId | string Required. Immutable. The ID to use for the This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationWorkerPoolCreateWorkerPoolOperationMetadata | The RPC response. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = cloudBuildClient.CreateWorkerPool(parent, workerPool, workerPoolId);
// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
WorkerPool result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = cloudBuildClient.PollOnceCreateWorkerPool(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
WorkerPool retrievedResult = retrievedResponse.Result;
}
CreateWorkerPoolAsync(LocationName, WorkerPool, string, CallSettings)
public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(LocationName parent, WorkerPool workerPool, string workerPoolId, CallSettings callSettings = null)
Creates a WorkerPool
.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent resource where this worker pool will be created.
Format: |
workerPool | WorkerPool Required. |
workerPoolId | string Required. Immutable. The ID to use for the This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(parent, workerPool, workerPoolId);
// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
WorkerPool retrievedResult = retrievedResponse.Result;
}
CreateWorkerPoolAsync(LocationName, WorkerPool, string, CancellationToken)
public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(LocationName parent, WorkerPool workerPool, string workerPoolId, CancellationToken cancellationToken)
Creates a WorkerPool
.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent resource where this worker pool will be created.
Format: |
workerPool | WorkerPool Required. |
workerPoolId | string Required. Immutable. The ID to use for the This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(parent, workerPool, workerPoolId);
// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
WorkerPool retrievedResult = retrievedResponse.Result;
}
CreateWorkerPoolAsync(CreateWorkerPoolRequest, CallSettings)
public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(CreateWorkerPoolRequest request, CallSettings callSettings = null)
Creates a WorkerPool
.
Parameters | |
---|---|
Name | Description |
request | CreateWorkerPoolRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateWorkerPoolRequest request = new CreateWorkerPoolRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
WorkerPool = new WorkerPool(),
WorkerPoolId = "",
ValidateOnly = false,
};
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(request);
// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
WorkerPool retrievedResult = retrievedResponse.Result;
}
CreateWorkerPoolAsync(CreateWorkerPoolRequest, CancellationToken)
public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(CreateWorkerPoolRequest request, CancellationToken cancellationToken)
Creates a WorkerPool
.
Parameters | |
---|---|
Name | Description |
request | CreateWorkerPoolRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
CreateWorkerPoolRequest request = new CreateWorkerPoolRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
WorkerPool = new WorkerPool(),
WorkerPoolId = "",
ValidateOnly = false,
};
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(request);
// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
WorkerPool retrievedResult = retrievedResponse.Result;
}
CreateWorkerPoolAsync(string, WorkerPool, string, CallSettings)
public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(string parent, WorkerPool workerPool, string workerPoolId, CallSettings callSettings = null)
Creates a WorkerPool
.
Parameters | |
---|---|
Name | Description |
parent | string Required. The parent resource where this worker pool will be created.
Format: |
workerPool | WorkerPool Required. |
workerPoolId | string Required. Immutable. The ID to use for the This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(parent, workerPool, workerPoolId);
// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
WorkerPool retrievedResult = retrievedResponse.Result;
}
CreateWorkerPoolAsync(string, WorkerPool, string, CancellationToken)
public virtual Task<Operation<WorkerPool, CreateWorkerPoolOperationMetadata>> CreateWorkerPoolAsync(string parent, WorkerPool workerPool, string workerPoolId, CancellationToken cancellationToken)
Creates a WorkerPool
.
Parameters | |
---|---|
Name | Description |
parent | string Required. The parent resource where this worker pool will be created.
Format: |
workerPool | WorkerPool Required. |
workerPoolId | string Required. Immutable. The ID to use for the This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationWorkerPoolCreateWorkerPoolOperationMetadata | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
WorkerPool workerPool = new WorkerPool();
string workerPoolId = "";
// Make the request
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> response = await cloudBuildClient.CreateWorkerPoolAsync(parent, workerPool, workerPoolId);
// Poll until the returned long-running operation is complete
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
WorkerPool result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<WorkerPool, CreateWorkerPoolOperationMetadata> retrievedResponse = await cloudBuildClient.PollOnceCreateWorkerPoolAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
WorkerPool retrievedResult = retrievedResponse.Result;
}
DeleteBuildTrigger(DeleteBuildTriggerRequest, CallSettings)
public virtual void DeleteBuildTrigger(DeleteBuildTriggerRequest request, CallSettings callSettings = null)
Deletes a BuildTrigger
by its project ID and trigger ID.
This API is experimental.
Parameters | |
---|---|
Name | Description |
request | DeleteBuildTriggerRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
DeleteBuildTriggerRequest request = new DeleteBuildTriggerRequest
{
ProjectId = "",
TriggerId = "",
BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// Make the request
cloudBuildClient.DeleteBuildTrigger(request);
DeleteBuildTrigger(string, string, CallSettings)
public virtual void DeleteBuildTrigger(string projectId, string triggerId, CallSettings callSettings = null)
Deletes a BuildTrigger
by its project ID and trigger ID.
This API is experimental.
Parameters | |
---|---|
Name | Description |
projectId | string Required. ID of the project that owns the trigger. |
triggerId | string Required. ID of the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
CloudBuildClient cloudBuildClient = CloudBuildClient.Create();
// Initialize request argument(s)
string projectId = "";
string triggerId = "";
// Make the request
cloudBuildClient.DeleteBuildTrigger(projectId, triggerId);
DeleteBuildTriggerAsync(DeleteBuildTriggerRequest, CallSettings)
public virtual Task DeleteBuildTriggerAsync(DeleteBuildTriggerRequest request, CallSettings callSettings = null)
Deletes a BuildTrigger
by its project ID and trigger ID.
This API is experimental.
Parameters | |
---|---|
Name | Description |
request | DeleteBuildTriggerRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteBuildTriggerRequest request = new DeleteBuildTriggerRequest
{
ProjectId = "",
TriggerId = "",
BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// Make the request
await cloudBuildClient.DeleteBuildTriggerAsync(request);
DeleteBuildTriggerAsync(DeleteBuildTriggerRequest, CancellationToken)
public virtual Task DeleteBuildTriggerAsync(DeleteBuildTriggerRequest request, CancellationToken cancellationToken)
Deletes a BuildTrigger
by its project ID and trigger ID.
This API is experimental.
Parameters | |
---|---|
Name | Description |
request | DeleteBuildTriggerRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
// Initialize request argument(s)
DeleteBuildTriggerRequest request = new DeleteBuildTriggerRequest
{
ProjectId = "",
TriggerId = "",
BuildTriggerName = BuildTriggerName.FromProjectTrigger("[PROJECT]", "[TRIGGER]"),
};
// Make the request
await cloudBuildClient.DeleteBuildTriggerAsync(request);
DeleteBuildTriggerAsync(string, string, CallSettings)
public virtual Task DeleteBuildTriggerAsync(string projectId, string triggerId, CallSettings callSettings = null)
Deletes a BuildTrigger
by its project ID and trigger ID.
This API is experimental.
Parameters | |
---|---|
Name | Description |
projectId |
|