Class WorkloadManagerClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
EvaluationName name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]");
Evaluation response = workloadManagerClient.getEvaluation(name);
}
Note: close() needs to be called on the WorkloadManagerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListEvaluations |
Lists Evaluations in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetEvaluation |
Gets details of a single Evaluation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateEvaluation |
Creates a new Evaluation in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateEvaluation |
Updates the parameters of a single Evaluation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteEvaluation |
Deletes a single Evaluation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListExecutions |
Lists Executions in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetExecution |
Gets details of a single Execution. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RunEvaluation |
Creates a new Execution in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteExecution |
Deletes a single Execution. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListExecutionResults |
Lists the result of a single evaluation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListRules |
Lists rules in a given project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListScannedResources |
List all scanned resources for a single Execution. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service.This method can be called in two ways: * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of WorkloadManagerSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WorkloadManagerSettings workloadManagerSettings =
WorkloadManagerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
WorkloadManagerClient workloadManagerClient =
WorkloadManagerClient.create(workloadManagerSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WorkloadManagerSettings workloadManagerSettings =
WorkloadManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
WorkloadManagerClient workloadManagerClient =
WorkloadManagerClient.create(workloadManagerSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WorkloadManagerSettings workloadManagerSettings =
WorkloadManagerSettings.newHttpJsonBuilder().build();
WorkloadManagerClient workloadManagerClient =
WorkloadManagerClient.create(workloadManagerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedWorkloadManagerClient(WorkloadManagerSettings settings) Constructs an instance of WorkloadManagerClient, using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final WorkloadManagerClientcreate()Constructs an instance of WorkloadManagerClient with default settings.static final WorkloadManagerClientcreate(WorkloadManagerStub stub) Constructs an instance of WorkloadManagerClient, using the given stub for making calls.static final WorkloadManagerClientcreate(WorkloadManagerSettings settings) Constructs an instance of WorkloadManagerClient, using the given settings.Creates a new Evaluation in a given project and location.createEvaluationAsync(LocationName parent, Evaluation evaluation, String evaluationId) Creates a new Evaluation in a given project and location.createEvaluationAsync(String parent, Evaluation evaluation, String evaluationId) Creates a new Evaluation in a given project and location.Creates a new Evaluation in a given project and location.Creates a new Evaluation in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Evaluation.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Evaluation.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEvaluationAsync(String name) Deletes a single Evaluation.Deletes a single Evaluation.final OperationCallable<DeleteEvaluationRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Evaluation.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Execution.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Execution.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(String name) Deletes a single Execution.Deletes a single Execution.final OperationCallable<DeleteExecutionRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Execution.final EvaluationgetEvaluation(EvaluationName name) Gets details of a single Evaluation.final EvaluationgetEvaluation(GetEvaluationRequest request) Gets details of a single Evaluation.final EvaluationgetEvaluation(String name) Gets details of a single Evaluation.Gets details of a single Evaluation.final ExecutiongetExecution(ExecutionName name) Gets details of a single Execution.final ExecutiongetExecution(GetExecutionRequest request) Gets details of a single Execution.final ExecutiongetExecution(String name) Gets details of a single Execution.Gets details of a single Execution.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final WorkloadManagerSettingsgetStub()booleanbooleanlistEvaluations(ListEvaluationsRequest request) Lists Evaluations in a given project and location.listEvaluations(LocationName parent) Lists Evaluations in a given project and location.listEvaluations(String parent) Lists Evaluations in a given project and location.Lists Evaluations in a given project and location.Lists Evaluations in a given project and location.Lists the result of a single evaluation.listExecutionResults(String parent) Lists the result of a single evaluation.Lists the result of a single evaluation.final UnaryCallable<ListExecutionResultsRequest,WorkloadManagerClient.ListExecutionResultsPagedResponse> Lists the result of a single evaluation.listExecutions(EvaluationName parent) Lists Executions in a given project and location.listExecutions(ListExecutionsRequest request) Lists Executions in a given project and location.listExecutions(String parent) Lists Executions in a given project and location.Lists Executions in a given project and location.Lists Executions in a given project and location.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.This method can be called in two ways:Lists information about the supported locations for this service.This method can be called in two ways:Lists information about the supported locations for this service.This method can be called in two ways:final ListRulesResponselistRules(ListRulesRequest request) Lists rules in a given project.final ListRulesResponselistRules(LocationName parent) Lists rules in a given project.final ListRulesResponseLists rules in a given project.Lists rules in a given project.List all scanned resources for a single Execution.listScannedResources(String parent) List all scanned resources for a single Execution.List all scanned resources for a single Execution.final UnaryCallable<ListScannedResourcesRequest,WorkloadManagerClient.ListScannedResourcesPagedResponse> List all scanned resources for a single Execution.runEvaluationAsync(EvaluationName name, Execution execution, String executionId) Creates a new Execution in a given project and location.runEvaluationAsync(RunEvaluationRequest request) Creates a new Execution in a given project and location.runEvaluationAsync(String name, Execution execution, String executionId) Creates a new Execution in a given project and location.Creates a new Execution in a given project and location.Creates a new Execution in a given project and location.voidshutdown()voidupdateEvaluationAsync(Evaluation evaluation, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Evaluation.Updates the parameters of a single Evaluation.Updates the parameters of a single Evaluation.Updates the parameters of a single Evaluation.
-
Constructor Details
-
WorkloadManagerClient
Constructs an instance of WorkloadManagerClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
WorkloadManagerClient
-
-
Method Details
-
create
Constructs an instance of WorkloadManagerClient with default settings.- Throws:
IOException
-
create
public static final WorkloadManagerClient create(WorkloadManagerSettings settings) throws IOException Constructs an instance of WorkloadManagerClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of WorkloadManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(WorkloadManagerSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listEvaluations
public final WorkloadManagerClient.ListEvaluationsPagedResponse listEvaluations(LocationName parent) Lists Evaluations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Evaluation element : workloadManagerClient.listEvaluations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListEvaluationsRequest.- Throws:
ApiException- if the remote call fails
-
listEvaluations
Lists Evaluations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Evaluation element : workloadManagerClient.listEvaluations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListEvaluationsRequest.- Throws:
ApiException- if the remote call fails
-
listEvaluations
public final WorkloadManagerClient.ListEvaluationsPagedResponse listEvaluations(ListEvaluationsRequest request) Lists Evaluations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListEvaluationsRequest request = ListEvaluationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Evaluation element : workloadManagerClient.listEvaluations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listEvaluationsPagedCallable
public final UnaryCallable<ListEvaluationsRequest,WorkloadManagerClient.ListEvaluationsPagedResponse> listEvaluationsPagedCallable()Lists Evaluations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListEvaluationsRequest request = ListEvaluationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Evaluation> future = workloadManagerClient.listEvaluationsPagedCallable().futureCall(request); // Do something. for (Evaluation element : future.get().iterateAll()) { // doThingsWith(element); } } -
listEvaluationsCallable
public final UnaryCallable<ListEvaluationsRequest,ListEvaluationsResponse> listEvaluationsCallable()Lists Evaluations in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListEvaluationsRequest request = ListEvaluationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListEvaluationsResponse response = workloadManagerClient.listEvaluationsCallable().call(request); for (Evaluation element : response.getEvaluationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getEvaluation
Gets details of a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { EvaluationName name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]"); Evaluation response = workloadManagerClient.getEvaluation(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getEvaluation
Gets details of a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString(); Evaluation response = workloadManagerClient.getEvaluation(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getEvaluation
Gets details of a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { GetEvaluationRequest request = GetEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .build(); Evaluation response = workloadManagerClient.getEvaluation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getEvaluationCallable
Gets details of a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { GetEvaluationRequest request = GetEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .build(); ApiFuture<Evaluation> future = workloadManagerClient.getEvaluationCallable().futureCall(request); // Do something. Evaluation response = future.get(); } -
createEvaluationAsync
public final OperationFuture<Evaluation,OperationMetadata> createEvaluationAsync(LocationName parent, Evaluation evaluation, String evaluationId) Creates a new Evaluation in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Evaluation evaluation = Evaluation.newBuilder().build(); String evaluationId = "evaluationId407318903"; Evaluation response = workloadManagerClient.createEvaluationAsync(parent, evaluation, evaluationId).get(); }- Parameters:
parent- Required. The resource prefix of the evaluation location using the form: `projects/{project_id}/locations/{location_id}`.evaluation- Required. The resource being created.evaluationId- Required. Id of the requesting object.- Throws:
ApiException- if the remote call fails
-
createEvaluationAsync
public final OperationFuture<Evaluation,OperationMetadata> createEvaluationAsync(String parent, Evaluation evaluation, String evaluationId) Creates a new Evaluation in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Evaluation evaluation = Evaluation.newBuilder().build(); String evaluationId = "evaluationId407318903"; Evaluation response = workloadManagerClient.createEvaluationAsync(parent, evaluation, evaluationId).get(); }- Parameters:
parent- Required. The resource prefix of the evaluation location using the form: `projects/{project_id}/locations/{location_id}`.evaluation- Required. The resource being created.evaluationId- Required. Id of the requesting object.- Throws:
ApiException- if the remote call fails
-
createEvaluationAsync
public final OperationFuture<Evaluation,OperationMetadata> createEvaluationAsync(CreateEvaluationRequest request) Creates a new Evaluation in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { CreateEvaluationRequest request = CreateEvaluationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setEvaluationId("evaluationId407318903") .setEvaluation(Evaluation.newBuilder().build()) .setRequestId("requestId693933066") .build(); Evaluation response = workloadManagerClient.createEvaluationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createEvaluationOperationCallable
public final OperationCallable<CreateEvaluationRequest,Evaluation, createEvaluationOperationCallable()OperationMetadata> Creates a new Evaluation in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { CreateEvaluationRequest request = CreateEvaluationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setEvaluationId("evaluationId407318903") .setEvaluation(Evaluation.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Evaluation, OperationMetadata> future = workloadManagerClient.createEvaluationOperationCallable().futureCall(request); // Do something. Evaluation response = future.get(); } -
createEvaluationCallable
Creates a new Evaluation in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { CreateEvaluationRequest request = CreateEvaluationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setEvaluationId("evaluationId407318903") .setEvaluation(Evaluation.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = workloadManagerClient.createEvaluationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateEvaluationAsync
public final OperationFuture<Evaluation,OperationMetadata> updateEvaluationAsync(Evaluation evaluation, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { Evaluation evaluation = Evaluation.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Evaluation response = workloadManagerClient.updateEvaluationAsync(evaluation, updateMask).get(); }- Parameters:
evaluation- Required. The resource being updated.updateMask- Required. Field mask is used to specify the fields to be overwritten in the Evaluation resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask.- Throws:
ApiException- if the remote call fails
-
updateEvaluationAsync
public final OperationFuture<Evaluation,OperationMetadata> updateEvaluationAsync(UpdateEvaluationRequest request) Updates the parameters of a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { UpdateEvaluationRequest request = UpdateEvaluationRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setEvaluation(Evaluation.newBuilder().build()) .setRequestId("requestId693933066") .build(); Evaluation response = workloadManagerClient.updateEvaluationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateEvaluationOperationCallable
public final OperationCallable<UpdateEvaluationRequest,Evaluation, updateEvaluationOperationCallable()OperationMetadata> Updates the parameters of a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { UpdateEvaluationRequest request = UpdateEvaluationRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setEvaluation(Evaluation.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Evaluation, OperationMetadata> future = workloadManagerClient.updateEvaluationOperationCallable().futureCall(request); // Do something. Evaluation response = future.get(); } -
updateEvaluationCallable
Updates the parameters of a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { UpdateEvaluationRequest request = UpdateEvaluationRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setEvaluation(Evaluation.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = workloadManagerClient.updateEvaluationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteEvaluationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEvaluationAsync(EvaluationName name) Deletes a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { EvaluationName name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]"); workloadManagerClient.deleteEvaluationAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteEvaluationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEvaluationAsync(String name) Deletes a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString(); workloadManagerClient.deleteEvaluationAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteEvaluationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEvaluationAsync(DeleteEvaluationRequest request) Deletes a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { DeleteEvaluationRequest request = DeleteEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .setRequestId("requestId693933066") .setForce(true) .build(); workloadManagerClient.deleteEvaluationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteEvaluationOperationCallable
public final OperationCallable<DeleteEvaluationRequest,com.google.protobuf.Empty, deleteEvaluationOperationCallable()OperationMetadata> Deletes a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { DeleteEvaluationRequest request = DeleteEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .setRequestId("requestId693933066") .setForce(true) .build(); OperationFuture<Empty, OperationMetadata> future = workloadManagerClient.deleteEvaluationOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteEvaluationCallable
Deletes a single Evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { DeleteEvaluationRequest request = DeleteEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .setRequestId("requestId693933066") .setForce(true) .build(); ApiFuture<Operation> future = workloadManagerClient.deleteEvaluationCallable().futureCall(request); // Do something. future.get(); } -
listExecutions
public final WorkloadManagerClient.ListExecutionsPagedResponse listExecutions(EvaluationName parent) Lists Executions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { EvaluationName parent = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]"); for (Execution element : workloadManagerClient.listExecutions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource prefix of the Execution using the form: `projects/{project}/locations/{location}/evaluations/{evaluation}`.- Throws:
ApiException- if the remote call fails
-
listExecutions
Lists Executions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String parent = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString(); for (Execution element : workloadManagerClient.listExecutions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource prefix of the Execution using the form: `projects/{project}/locations/{location}/evaluations/{evaluation}`.- Throws:
ApiException- if the remote call fails
-
listExecutions
public final WorkloadManagerClient.ListExecutionsPagedResponse listExecutions(ListExecutionsRequest request) Lists Executions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Execution element : workloadManagerClient.listExecutions(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listExecutionsPagedCallable
public final UnaryCallable<ListExecutionsRequest,WorkloadManagerClient.ListExecutionsPagedResponse> listExecutionsPagedCallable()Lists Executions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Execution> future = workloadManagerClient.listExecutionsPagedCallable().futureCall(request); // Do something. for (Execution element : future.get().iterateAll()) { // doThingsWith(element); } } -
listExecutionsCallable
Lists Executions in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListExecutionsRequest request = ListExecutionsRequest.newBuilder() .setParent(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListExecutionsResponse response = workloadManagerClient.listExecutionsCallable().call(request); for (Execution element : response.getExecutionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getExecution
Gets details of a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]"); Execution response = workloadManagerClient.getExecution(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getExecution
Gets details of a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]").toString(); Execution response = workloadManagerClient.getExecution(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getExecution
Gets details of a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { GetExecutionRequest request = GetExecutionRequest.newBuilder() .setName( ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]") .toString()) .build(); Execution response = workloadManagerClient.getExecution(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getExecutionCallable
Gets details of a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { GetExecutionRequest request = GetExecutionRequest.newBuilder() .setName( ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]") .toString()) .build(); ApiFuture<Execution> future = workloadManagerClient.getExecutionCallable().futureCall(request); // Do something. Execution response = future.get(); } -
runEvaluationAsync
public final OperationFuture<Execution,OperationMetadata> runEvaluationAsync(EvaluationName name, Execution execution, String executionId) Creates a new Execution in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { EvaluationName name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]"); Execution execution = Execution.newBuilder().build(); String executionId = "executionId-454906285"; Execution response = workloadManagerClient.runEvaluationAsync(name, execution, executionId).get(); }- Parameters:
name- Required. The resource name of the Evaluation using the form: `projects/{project}/locations/{location}/evaluations/{evaluation}`.execution- Required. The resource being created.executionId- Required. ID of the execution which will be created.- Throws:
ApiException- if the remote call fails
-
runEvaluationAsync
public final OperationFuture<Execution,OperationMetadata> runEvaluationAsync(String name, Execution execution, String executionId) Creates a new Execution in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString(); Execution execution = Execution.newBuilder().build(); String executionId = "executionId-454906285"; Execution response = workloadManagerClient.runEvaluationAsync(name, execution, executionId).get(); }- Parameters:
name- Required. The resource name of the Evaluation using the form: `projects/{project}/locations/{location}/evaluations/{evaluation}`.execution- Required. The resource being created.executionId- Required. ID of the execution which will be created.- Throws:
ApiException- if the remote call fails
-
runEvaluationAsync
public final OperationFuture<Execution,OperationMetadata> runEvaluationAsync(RunEvaluationRequest request) Creates a new Execution in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { RunEvaluationRequest request = RunEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .setExecutionId("executionId-454906285") .setExecution(Execution.newBuilder().build()) .setRequestId("requestId693933066") .build(); Execution response = workloadManagerClient.runEvaluationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
runEvaluationOperationCallable
public final OperationCallable<RunEvaluationRequest,Execution, runEvaluationOperationCallable()OperationMetadata> Creates a new Execution in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { RunEvaluationRequest request = RunEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .setExecutionId("executionId-454906285") .setExecution(Execution.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Execution, OperationMetadata> future = workloadManagerClient.runEvaluationOperationCallable().futureCall(request); // Do something. Execution response = future.get(); } -
runEvaluationCallable
Creates a new Execution in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { RunEvaluationRequest request = RunEvaluationRequest.newBuilder() .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString()) .setExecutionId("executionId-454906285") .setExecution(Execution.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = workloadManagerClient.runEvaluationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteExecutionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(ExecutionName name) Deletes a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]"); workloadManagerClient.deleteExecutionAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteExecutionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(String name) Deletes a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]").toString(); workloadManagerClient.deleteExecutionAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteExecutionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(DeleteExecutionRequest request) Deletes a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { DeleteExecutionRequest request = DeleteExecutionRequest.newBuilder() .setName( ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]") .toString()) .setRequestId("requestId693933066") .build(); workloadManagerClient.deleteExecutionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteExecutionOperationCallable
public final OperationCallable<DeleteExecutionRequest,com.google.protobuf.Empty, deleteExecutionOperationCallable()OperationMetadata> Deletes a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { DeleteExecutionRequest request = DeleteExecutionRequest.newBuilder() .setName( ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]") .toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = workloadManagerClient.deleteExecutionOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteExecutionCallable
Deletes a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { DeleteExecutionRequest request = DeleteExecutionRequest.newBuilder() .setName( ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = workloadManagerClient.deleteExecutionCallable().futureCall(request); // Do something. future.get(); } -
listExecutionResults
public final WorkloadManagerClient.ListExecutionResultsPagedResponse listExecutionResults(String parent) Lists the result of a single evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String parent = "parent-995424086"; for (ExecutionResult element : workloadManagerClient.listExecutionResults(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The execution results. Format: {parent}/evaluations/*/executions/*/results.- Throws:
ApiException- if the remote call fails
-
listExecutionResults
public final WorkloadManagerClient.ListExecutionResultsPagedResponse listExecutionResults(ListExecutionResultsRequest request) Lists the result of a single evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListExecutionResultsRequest request = ListExecutionResultsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (ExecutionResult element : workloadManagerClient.listExecutionResults(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listExecutionResultsPagedCallable
public final UnaryCallable<ListExecutionResultsRequest,WorkloadManagerClient.ListExecutionResultsPagedResponse> listExecutionResultsPagedCallable()Lists the result of a single evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListExecutionResultsRequest request = ListExecutionResultsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<ExecutionResult> future = workloadManagerClient.listExecutionResultsPagedCallable().futureCall(request); // Do something. for (ExecutionResult element : future.get().iterateAll()) { // doThingsWith(element); } } -
listExecutionResultsCallable
public final UnaryCallable<ListExecutionResultsRequest,ListExecutionResultsResponse> listExecutionResultsCallable()Lists the result of a single evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListExecutionResultsRequest request = ListExecutionResultsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListExecutionResultsResponse response = workloadManagerClient.listExecutionResultsCallable().call(request); for (ExecutionResult element : response.getExecutionResultsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listRules
Lists rules in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ListRulesResponse response = workloadManagerClient.listRules(parent); }- Parameters:
parent- Required. The [project] on which to execute the request. The format is: projects/{project_id}/locations/{location} Currently, the pre-defined rules are global available to all projects and all regions.- Throws:
ApiException- if the remote call fails
-
listRules
Lists rules in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ListRulesResponse response = workloadManagerClient.listRules(parent); }- Parameters:
parent- Required. The [project] on which to execute the request. The format is: projects/{project_id}/locations/{location} Currently, the pre-defined rules are global available to all projects and all regions.- Throws:
ApiException- if the remote call fails
-
listRules
Lists rules in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListRulesRequest request = ListRulesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setCustomRulesBucket("customRulesBucket-888019568") .build(); ListRulesResponse response = workloadManagerClient.listRules(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listRulesCallable
Lists rules in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListRulesRequest request = ListRulesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setCustomRulesBucket("customRulesBucket-888019568") .build(); ApiFuture<ListRulesResponse> future = workloadManagerClient.listRulesCallable().futureCall(request); // Do something. ListRulesResponse response = future.get(); } -
listScannedResources
public final WorkloadManagerClient.ListScannedResourcesPagedResponse listScannedResources(String parent) List all scanned resources for a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { String parent = "parent-995424086"; for (ScannedResource element : workloadManagerClient.listScannedResources(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent for ListScannedResourcesRequest.- Throws:
ApiException- if the remote call fails
-
listScannedResources
public final WorkloadManagerClient.ListScannedResourcesPagedResponse listScannedResources(ListScannedResourcesRequest request) List all scanned resources for a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListScannedResourcesRequest request = ListScannedResourcesRequest.newBuilder() .setParent("parent-995424086") .setRule("rule3512060") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ScannedResource element : workloadManagerClient.listScannedResources(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listScannedResourcesPagedCallable
public final UnaryCallable<ListScannedResourcesRequest,WorkloadManagerClient.ListScannedResourcesPagedResponse> listScannedResourcesPagedCallable()List all scanned resources for a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListScannedResourcesRequest request = ListScannedResourcesRequest.newBuilder() .setParent("parent-995424086") .setRule("rule3512060") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ScannedResource> future = workloadManagerClient.listScannedResourcesPagedCallable().futureCall(request); // Do something. for (ScannedResource element : future.get().iterateAll()) { // doThingsWith(element); } } -
listScannedResourcesCallable
public final UnaryCallable<ListScannedResourcesRequest,ListScannedResourcesResponse> listScannedResourcesCallable()List all scanned resources for a single Execution.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListScannedResourcesRequest request = ListScannedResourcesRequest.newBuilder() .setParent("parent-995424086") .setRule("rule3512060") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListScannedResourcesResponse response = workloadManagerClient.listScannedResourcesCallable().call(request); for (ScannedResource element : response.getScannedResourcesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listLocations
public final WorkloadManagerClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.This method can be called in two ways:* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : workloadManagerClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,WorkloadManagerClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.This method can be called in two ways:* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = workloadManagerClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.This method can be called in two ways:* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = workloadManagerClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = workloadManagerClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = workloadManagerClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-