Class WorkloadManagerClient (0.1.0)

GitHub RepositoryProduct ReferenceRPC Documentation

Service Description: The Workload Manager provides various tools to deploy, validate and observe your workloads running on Google Cloud.

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

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

  • listEvaluations(ListEvaluationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listEvaluations(LocationName parent)

  • listEvaluations(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listEvaluationsPagedCallable()

  • listEvaluationsCallable()

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.

  • getEvaluation(GetEvaluationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getEvaluation(EvaluationName name)

  • getEvaluation(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getEvaluationCallable()

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.

  • createEvaluationAsync(CreateEvaluationRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createEvaluationAsync(LocationName parent, Evaluation evaluation, String evaluationId)

  • createEvaluationAsync(String parent, Evaluation evaluation, String evaluationId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createEvaluationOperationCallable()

  • createEvaluationCallable()

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.

  • updateEvaluationAsync(UpdateEvaluationRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateEvaluationAsync(Evaluation evaluation, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateEvaluationOperationCallable()

  • updateEvaluationCallable()

DeleteEvaluation

Deletes a single Evaluation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteEvaluationAsync(DeleteEvaluationRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteEvaluationAsync(EvaluationName name)

  • deleteEvaluationAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteEvaluationOperationCallable()

  • deleteEvaluationCallable()

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.

  • listExecutions(ListExecutionsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listExecutions(EvaluationName parent)

  • listExecutions(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listExecutionsPagedCallable()

  • listExecutionsCallable()

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.

  • getExecution(GetExecutionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getExecution(ExecutionName name)

  • getExecution(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getExecutionCallable()

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.

  • runEvaluationAsync(RunEvaluationRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • runEvaluationAsync(EvaluationName name, Execution execution, String executionId)

  • runEvaluationAsync(String name, Execution execution, String executionId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • runEvaluationOperationCallable()

  • runEvaluationCallable()

DeleteExecution

Deletes a single Execution.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteExecutionAsync(DeleteExecutionRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteExecutionAsync(ExecutionName name)

  • deleteExecutionAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteExecutionOperationCallable()

  • deleteExecutionCallable()

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.

  • listExecutionResults(ListExecutionResultsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listExecutionResults(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listExecutionResultsPagedCallable()

  • listExecutionResultsCallable()

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.

  • listRules(ListRulesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listRules(LocationName parent)

  • listRules(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listRulesCallable()

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.

  • listScannedResources(ListScannedResourcesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listScannedResources(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listScannedResourcesPagedCallable()

  • listScannedResourcesCallable()

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

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

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.

Inheritance

java.lang.Object > WorkloadManagerClient

Static Methods

create()

public static final WorkloadManagerClient create()

Constructs an instance of WorkloadManagerClient with default settings.

Returns
Type Description
WorkloadManagerClient
Exceptions
Type Description
IOException

create(WorkloadManagerSettings settings)

public static final WorkloadManagerClient create(WorkloadManagerSettings settings)

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.

Parameter
Name Description
settings WorkloadManagerSettings
Returns
Type Description
WorkloadManagerClient
Exceptions
Type Description
IOException

create(WorkloadManagerStub stub)

public static final WorkloadManagerClient create(WorkloadManagerStub stub)

Constructs an instance of WorkloadManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(WorkloadManagerSettings).

Parameter
Name Description
stub WorkloadManagerStub
Returns
Type Description
WorkloadManagerClient

Constructors

WorkloadManagerClient(WorkloadManagerSettings settings)

protected WorkloadManagerClient(WorkloadManagerSettings settings)

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.

Parameter
Name Description
settings WorkloadManagerSettings

WorkloadManagerClient(WorkloadManagerStub stub)

protected WorkloadManagerClient(WorkloadManagerStub stub)
Parameter
Name Description
stub WorkloadManagerStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createEvaluationAsync(CreateEvaluationRequest request)

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();
 }
 
Parameter
Name Description
request CreateEvaluationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Evaluation,OperationMetadata>

createEvaluationAsync(LocationName parent, Evaluation evaluation, String evaluationId)

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
Name Description
parent LocationName

Required. The resource prefix of the evaluation location using the form: projects/{project_id}/locations/{location_id}.

evaluation Evaluation

Required. The resource being created.

evaluationId String

Required. Id of the requesting object.

Returns
Type Description
OperationFuture<Evaluation,OperationMetadata>

createEvaluationAsync(String parent, Evaluation evaluation, String evaluationId)

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
Name Description
parent String

Required. The resource prefix of the evaluation location using the form: projects/{project_id}/locations/{location_id}.

evaluation Evaluation

Required. The resource being created.

evaluationId String

Required. Id of the requesting object.

Returns
Type Description
OperationFuture<Evaluation,OperationMetadata>

createEvaluationCallable()

public final UnaryCallable<CreateEvaluationRequest,Operation> 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();
 }
 
Returns
Type Description
UnaryCallable<CreateEvaluationRequest,Operation>

createEvaluationOperationCallable()

public final OperationCallable<CreateEvaluationRequest,Evaluation,OperationMetadata> createEvaluationOperationCallable()

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();
 }
 
Returns
Type Description
OperationCallable<CreateEvaluationRequest,Evaluation,OperationMetadata>

deleteEvaluationAsync(DeleteEvaluationRequest request)

public final OperationFuture<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();
 }
 
Parameter
Name Description
request DeleteEvaluationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteEvaluationAsync(EvaluationName name)

public final OperationFuture<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();
 }
 
Parameter
Name Description
name EvaluationName

Required. Name of the resource.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteEvaluationAsync(String name)

public final OperationFuture<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();
 }
 
Parameter
Name Description
name String

Required. Name of the resource.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteEvaluationCallable()

public final UnaryCallable<DeleteEvaluationRequest,Operation> 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();
 }
 
Returns
Type Description
UnaryCallable<DeleteEvaluationRequest,Operation>

deleteEvaluationOperationCallable()

public final OperationCallable<DeleteEvaluationRequest,Empty,OperationMetadata> deleteEvaluationOperationCallable()

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();
 }
 
Returns
Type Description
OperationCallable<DeleteEvaluationRequest,Empty,OperationMetadata>

deleteExecutionAsync(DeleteExecutionRequest request)

public final OperationFuture<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();
 }
 
Parameter
Name Description
request DeleteExecutionRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteExecutionAsync(ExecutionName name)

public final OperationFuture<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();
 }
 
Parameter
Name Description
name ExecutionName

Required. Name of the resource.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteExecutionAsync(String name)

public final OperationFuture<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();
 }
 
Parameter
Name Description
name String

Required. Name of the resource.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteExecutionCallable()

public final UnaryCallable<DeleteExecutionRequest,Operation> 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();
 }
 
Returns
Type Description
UnaryCallable<DeleteExecutionRequest,Operation>

deleteExecutionOperationCallable()

public final OperationCallable<DeleteExecutionRequest,Empty,OperationMetadata> deleteExecutionOperationCallable()

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();
 }
 
Returns
Type Description
OperationCallable<DeleteExecutionRequest,Empty,OperationMetadata>

getEvaluation(EvaluationName name)

public final Evaluation getEvaluation(EvaluationName name)

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);
 }
 
Parameter
Name Description
name EvaluationName

Required. Name of the resource.

Returns
Type Description
Evaluation

getEvaluation(GetEvaluationRequest request)

public final Evaluation getEvaluation(GetEvaluationRequest request)

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);
 }
 
Parameter
Name Description
request GetEvaluationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Evaluation

getEvaluation(String name)

public final Evaluation getEvaluation(String name)

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);
 }
 
Parameter
Name Description
name String

Required. Name of the resource.

Returns
Type Description
Evaluation

getEvaluationCallable()

public final UnaryCallable<GetEvaluationRequest,Evaluation> 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();
 }
 
Returns
Type Description
UnaryCallable<GetEvaluationRequest,Evaluation>

getExecution(ExecutionName name)

public final Execution getExecution(ExecutionName name)

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);
 }
 
Parameter
Name Description
name ExecutionName

Required. Name of the resource.

Returns
Type Description
Execution

getExecution(GetExecutionRequest request)

public final Execution getExecution(GetExecutionRequest request)

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);
 }
 
Parameter
Name Description
request GetExecutionRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Execution

getExecution(String name)

public final Execution getExecution(String name)

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);
 }
 
Parameter
Name Description
name String

Required. Name of the resource.

Returns
Type Description
Execution

getExecutionCallable()

public final UnaryCallable<GetExecutionRequest,Execution> 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();
 }
 
Returns
Type Description
UnaryCallable<GetExecutionRequest,Execution>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

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);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> 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();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient

getSettings()

public final WorkloadManagerSettings getSettings()
Returns
Type Description
WorkloadManagerSettings

getStub()

public WorkloadManagerStub getStub()
Returns
Type Description
WorkloadManagerStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listEvaluations(ListEvaluationsRequest request)

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);
   }
 }
 
Parameter
Name Description
request ListEvaluationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
WorkloadManagerClient.ListEvaluationsPagedResponse

listEvaluations(LocationName parent)

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);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. Parent value for ListEvaluationsRequest.

Returns
Type Description
WorkloadManagerClient.ListEvaluationsPagedResponse

listEvaluations(String parent)

public final WorkloadManagerClient.ListEvaluationsPagedResponse listEvaluations(String 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()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Evaluation element : workloadManagerClient.listEvaluations(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Parent value for ListEvaluationsRequest.

Returns
Type Description
WorkloadManagerClient.ListEvaluationsPagedResponse

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListEvaluationsRequest,ListEvaluationsResponse>

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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListEvaluationsRequest,ListEvaluationsPagedResponse>

listExecutionResults(ListExecutionResultsRequest request)

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);
   }
 }
 
Parameter
Name Description
request ListExecutionResultsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
WorkloadManagerClient.ListExecutionResultsPagedResponse

listExecutionResults(String parent)

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);
   }
 }
 
Parameter
Name Description
parent String

Required. The execution results. Format: {parent}/evaluations/*/executions/*/results.

Returns
Type Description
WorkloadManagerClient.ListExecutionResultsPagedResponse

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListExecutionResultsRequest,ListExecutionResultsResponse>

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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListExecutionResultsRequest,ListExecutionResultsPagedResponse>

listExecutions(EvaluationName parent)

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);
   }
 }
 
Parameter
Name Description
parent EvaluationName

Required. The resource prefix of the Execution using the form: projects/{project}/locations/{location}/evaluations/{evaluation}.

Returns
Type Description
WorkloadManagerClient.ListExecutionsPagedResponse

listExecutions(ListExecutionsRequest request)

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);
   }
 }
 
Parameter
Name Description
request ListExecutionsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
WorkloadManagerClient.ListExecutionsPagedResponse

listExecutions(String parent)

public final WorkloadManagerClient.ListExecutionsPagedResponse listExecutions(String 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()) {
   String parent = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString();
   for (Execution element : workloadManagerClient.listExecutions(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The resource prefix of the Execution using the form: projects/{project}/locations/{location}/evaluations/{evaluation}.

Returns
Type Description
WorkloadManagerClient.ListExecutionsPagedResponse

listExecutionsCallable()

public final UnaryCallable<ListExecutionsRequest,ListExecutionsResponse> 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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListExecutionsRequest,ListExecutionsResponse>

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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListExecutionsRequest,ListExecutionsPagedResponse>

listLocations(ListLocationsRequest request)

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 pathGET /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);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
WorkloadManagerClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> 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 pathGET /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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

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 pathGET /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);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listRules(ListRulesRequest request)

public final ListRulesResponse listRules(ListRulesRequest request)

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);
 }
 
Parameter
Name Description
request ListRulesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ListRulesResponse

listRules(LocationName parent)

public final ListRulesResponse listRules(LocationName parent)

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);
 }
 
Parameter
Name Description
parent LocationName

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.

Returns
Type Description
ListRulesResponse

listRules(String parent)

public final ListRulesResponse listRules(String parent)

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);
 }
 
Parameter
Name Description
parent String

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.

Returns
Type Description
ListRulesResponse

listRulesCallable()

public final UnaryCallable<ListRulesRequest,ListRulesResponse> 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();
 }
 
Returns
Type Description
UnaryCallable<ListRulesRequest,ListRulesResponse>

listScannedResources(ListScannedResourcesRequest request)

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);
   }
 }
 
Parameter
Name Description
request ListScannedResourcesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
WorkloadManagerClient.ListScannedResourcesPagedResponse

listScannedResources(String parent)

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);
   }
 }
 
Parameter
Name Description
parent String

Required. Parent for ListScannedResourcesRequest.

Returns
Type Description
WorkloadManagerClient.ListScannedResourcesPagedResponse

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListScannedResourcesRequest,ListScannedResourcesResponse>

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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListScannedResourcesRequest,ListScannedResourcesPagedResponse>

runEvaluationAsync(EvaluationName name, Execution execution, String executionId)

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 Description
name EvaluationName

Required. The resource name of the Evaluation using the form: projects/{project}/locations/{location}/evaluations/{evaluation}.

execution Execution

Required. The resource being created.

executionId String

Required. ID of the execution which will be created.

Returns
Type Description
OperationFuture<Execution,OperationMetadata>

runEvaluationAsync(RunEvaluationRequest request)

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();
 }
 
Parameter
Name Description
request RunEvaluationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Execution,OperationMetadata>

runEvaluationAsync(String name, Execution execution, String executionId)

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 Description
name String

Required. The resource name of the Evaluation using the form: projects/{project}/locations/{location}/evaluations/{evaluation}.

execution Execution

Required. The resource being created.

executionId String

Required. ID of the execution which will be created.

Returns
Type Description
OperationFuture<Execution,OperationMetadata>

runEvaluationCallable()

public final UnaryCallable<RunEvaluationRequest,Operation> 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();
 }
 
Returns
Type Description
UnaryCallable<RunEvaluationRequest,Operation>

runEvaluationOperationCallable()

public final OperationCallable<RunEvaluationRequest,Execution,OperationMetadata> runEvaluationOperationCallable()

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();
 }
 
Returns
Type Description
OperationCallable<RunEvaluationRequest,Execution,OperationMetadata>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateEvaluationAsync(Evaluation evaluation, FieldMask updateMask)

public final OperationFuture<Evaluation,OperationMetadata> updateEvaluationAsync(Evaluation evaluation, 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
Name Description
evaluation Evaluation

Required. The resource being updated.

updateMask FieldMask

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.

Returns
Type Description
OperationFuture<Evaluation,OperationMetadata>

updateEvaluationAsync(UpdateEvaluationRequest request)

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();
 }
 
Parameter
Name Description
request UpdateEvaluationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Evaluation,OperationMetadata>

updateEvaluationCallable()

public final UnaryCallable<UpdateEvaluationRequest,Operation> 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();
 }
 
Returns
Type Description
UnaryCallable<UpdateEvaluationRequest,Operation>

updateEvaluationOperationCallable()

public final OperationCallable<UpdateEvaluationRequest,Evaluation,OperationMetadata> updateEvaluationOperationCallable()

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();
 }
 
Returns
Type Description
OperationCallable<UpdateEvaluationRequest,Evaluation,OperationMetadata>