@Generated(value="by gapic-generator-java") public class WorkstationsClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationClusterName name =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
WorkstationCluster response = workstationsClient.getWorkstationCluster(name);
}
Note: close() needs to be called on the WorkstationsClient 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 |
|---|---|---|
GetWorkstationCluster |
Returns the requested workstation cluster. |
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.
|
ListWorkstationClusters |
Returns all workstation clusters in the specified 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.
|
CreateWorkstationCluster |
Creates a new workstation cluster. |
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.
|
UpdateWorkstationCluster |
Updates an existing workstation cluster. |
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.
|
DeleteWorkstationCluster |
Deletes the specified workstation cluster. |
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.
|
GetWorkstationConfig |
Returns the requested workstation configuration. |
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.
|
ListWorkstationConfigs |
Returns all workstation configurations in the specified cluster. |
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.
|
ListUsableWorkstationConfigs |
Returns all workstation configurations in the specified cluster on which the caller has the "workstations.workstation.create" permission. |
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.
|
CreateWorkstationConfig |
Creates a new workstation configuration. |
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.
|
UpdateWorkstationConfig |
Updates an existing workstation configuration. |
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.
|
DeleteWorkstationConfig |
Deletes the specified workstation configuration. |
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.
|
GetWorkstation |
Returns the requested workstation. |
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.
|
ListWorkstations |
Returns all Workstations using the specified workstation configuration. |
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.
|
ListUsableWorkstations |
Returns all workstations using the specified workstation configuration on which the caller has the "workstations.workstations.use" permission. |
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.
|
CreateWorkstation |
Creates a new workstation. |
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.
|
UpdateWorkstation |
Updates an existing workstation. |
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.
|
DeleteWorkstation |
Deletes the specified workstation. |
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.
|
StartWorkstation |
Starts running a workstation so that users can connect to it. |
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.
|
StopWorkstation |
Stops running a workstation, reducing costs. |
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.
|
GenerateAccessToken |
Returns a short-lived credential that can be used to send authenticated and authorized traffic to a workstation. |
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.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
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.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
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.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
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 WorkstationsSettings 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
WorkstationsSettings workstationsSettings =
WorkstationsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
WorkstationsClient workstationsClient = WorkstationsClient.create(workstationsSettings);
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
WorkstationsSettings workstationsSettings =
WorkstationsSettings.newBuilder().setEndpoint(myEndpoint).build();
WorkstationsClient workstationsClient = WorkstationsClient.create(workstationsSettings);
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
WorkstationsSettings workstationsSettings = WorkstationsSettings.newHttpJsonBuilder().build();
WorkstationsClient workstationsClient = WorkstationsClient.create(workstationsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier | Constructor and Description |
|---|---|
protected |
WorkstationsClient(WorkstationsSettings settings)
Constructs an instance of WorkstationsClient, using the given settings.
|
protected |
WorkstationsClient(WorkstationsStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static WorkstationsClient |
create()
Constructs an instance of WorkstationsClient with default settings.
|
static WorkstationsClient |
create(WorkstationsSettings settings)
Constructs an instance of WorkstationsClient, using the given settings.
|
static WorkstationsClient |
create(WorkstationsStub stub)
Constructs an instance of WorkstationsClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
createWorkstationAsync(CreateWorkstationRequest request)
Creates a new workstation.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
createWorkstationAsync(String parent,
Workstation workstation,
String workstationId)
Creates a new workstation.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
createWorkstationAsync(WorkstationConfigName parent,
Workstation workstation,
String workstationId)
Creates a new workstation.
|
com.google.api.gax.rpc.UnaryCallable<CreateWorkstationRequest,com.google.longrunning.Operation> |
createWorkstationCallable()
Creates a new workstation.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> |
createWorkstationClusterAsync(CreateWorkstationClusterRequest request)
Creates a new workstation cluster.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> |
createWorkstationClusterAsync(LocationName parent,
WorkstationCluster workstationCluster,
String workstationClusterId)
Creates a new workstation cluster.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> |
createWorkstationClusterAsync(String parent,
WorkstationCluster workstationCluster,
String workstationClusterId)
Creates a new workstation cluster.
|
com.google.api.gax.rpc.UnaryCallable<CreateWorkstationClusterRequest,com.google.longrunning.Operation> |
createWorkstationClusterCallable()
Creates a new workstation cluster.
|
com.google.api.gax.rpc.OperationCallable<CreateWorkstationClusterRequest,WorkstationCluster,OperationMetadata> |
createWorkstationClusterOperationCallable()
Creates a new workstation cluster.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> |
createWorkstationConfigAsync(CreateWorkstationConfigRequest request)
Creates a new workstation configuration.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> |
createWorkstationConfigAsync(String parent,
WorkstationConfig workstationConfig,
String workstationConfigId)
Creates a new workstation configuration.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> |
createWorkstationConfigAsync(WorkstationClusterName parent,
WorkstationConfig workstationConfig,
String workstationConfigId)
Creates a new workstation configuration.
|
com.google.api.gax.rpc.UnaryCallable<CreateWorkstationConfigRequest,com.google.longrunning.Operation> |
createWorkstationConfigCallable()
Creates a new workstation configuration.
|
com.google.api.gax.rpc.OperationCallable<CreateWorkstationConfigRequest,WorkstationConfig,OperationMetadata> |
createWorkstationConfigOperationCallable()
Creates a new workstation configuration.
|
com.google.api.gax.rpc.OperationCallable<CreateWorkstationRequest,Workstation,OperationMetadata> |
createWorkstationOperationCallable()
Creates a new workstation.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
deleteWorkstationAsync(DeleteWorkstationRequest request)
Deletes the specified workstation.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
deleteWorkstationAsync(String name)
Deletes the specified workstation.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
deleteWorkstationAsync(WorkstationName name)
Deletes the specified workstation.
|
com.google.api.gax.rpc.UnaryCallable<DeleteWorkstationRequest,com.google.longrunning.Operation> |
deleteWorkstationCallable()
Deletes the specified workstation.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> |
deleteWorkstationClusterAsync(DeleteWorkstationClusterRequest request)
Deletes the specified workstation cluster.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> |
deleteWorkstationClusterAsync(String name)
Deletes the specified workstation cluster.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> |
deleteWorkstationClusterAsync(WorkstationClusterName name)
Deletes the specified workstation cluster.
|
com.google.api.gax.rpc.UnaryCallable<DeleteWorkstationClusterRequest,com.google.longrunning.Operation> |
deleteWorkstationClusterCallable()
Deletes the specified workstation cluster.
|
com.google.api.gax.rpc.OperationCallable<DeleteWorkstationClusterRequest,WorkstationCluster,OperationMetadata> |
deleteWorkstationClusterOperationCallable()
Deletes the specified workstation cluster.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> |
deleteWorkstationConfigAsync(DeleteWorkstationConfigRequest request)
Deletes the specified workstation configuration.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> |
deleteWorkstationConfigAsync(String name)
Deletes the specified workstation configuration.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> |
deleteWorkstationConfigAsync(WorkstationConfigName name)
Deletes the specified workstation configuration.
|
com.google.api.gax.rpc.UnaryCallable<DeleteWorkstationConfigRequest,com.google.longrunning.Operation> |
deleteWorkstationConfigCallable()
Deletes the specified workstation configuration.
|
com.google.api.gax.rpc.OperationCallable<DeleteWorkstationConfigRequest,WorkstationConfig,OperationMetadata> |
deleteWorkstationConfigOperationCallable()
Deletes the specified workstation configuration.
|
com.google.api.gax.rpc.OperationCallable<DeleteWorkstationRequest,Workstation,OperationMetadata> |
deleteWorkstationOperationCallable()
Deletes the specified workstation.
|
GenerateAccessTokenResponse |
generateAccessToken(GenerateAccessTokenRequest request)
Returns a short-lived credential that can be used to send authenticated and authorized traffic
to a workstation.
|
GenerateAccessTokenResponse |
generateAccessToken(String workstation)
Returns a short-lived credential that can be used to send authenticated and authorized traffic
to a workstation.
|
GenerateAccessTokenResponse |
generateAccessToken(WorkstationName workstation)
Returns a short-lived credential that can be used to send authenticated and authorized traffic
to a workstation.
|
com.google.api.gax.rpc.UnaryCallable<GenerateAccessTokenRequest,GenerateAccessTokenResponse> |
generateAccessTokenCallable()
Returns a short-lived credential that can be used to send authenticated and authorized traffic
to a workstation.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
WorkstationsSettings |
getSettings() |
WorkstationsStub |
getStub() |
Workstation |
getWorkstation(GetWorkstationRequest request)
Returns the requested workstation.
|
Workstation |
getWorkstation(String name)
Returns the requested workstation.
|
Workstation |
getWorkstation(WorkstationName name)
Returns the requested workstation.
|
com.google.api.gax.rpc.UnaryCallable<GetWorkstationRequest,Workstation> |
getWorkstationCallable()
Returns the requested workstation.
|
WorkstationCluster |
getWorkstationCluster(GetWorkstationClusterRequest request)
Returns the requested workstation cluster.
|
WorkstationCluster |
getWorkstationCluster(String name)
Returns the requested workstation cluster.
|
WorkstationCluster |
getWorkstationCluster(WorkstationClusterName name)
Returns the requested workstation cluster.
|
com.google.api.gax.rpc.UnaryCallable<GetWorkstationClusterRequest,WorkstationCluster> |
getWorkstationClusterCallable()
Returns the requested workstation cluster.
|
WorkstationConfig |
getWorkstationConfig(GetWorkstationConfigRequest request)
Returns the requested workstation configuration.
|
WorkstationConfig |
getWorkstationConfig(String name)
Returns the requested workstation configuration.
|
WorkstationConfig |
getWorkstationConfig(WorkstationConfigName name)
Returns the requested workstation configuration.
|
com.google.api.gax.rpc.UnaryCallable<GetWorkstationConfigRequest,WorkstationConfig> |
getWorkstationConfigCallable()
Returns the requested workstation configuration.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
WorkstationsClient.ListUsableWorkstationConfigsPagedResponse |
listUsableWorkstationConfigs(ListUsableWorkstationConfigsRequest request)
Returns all workstation configurations in the specified cluster on which the caller has the
"workstations.workstation.create" permission.
|
WorkstationsClient.ListUsableWorkstationConfigsPagedResponse |
listUsableWorkstationConfigs(String parent)
Returns all workstation configurations in the specified cluster on which the caller has the
"workstations.workstation.create" permission.
|
WorkstationsClient.ListUsableWorkstationConfigsPagedResponse |
listUsableWorkstationConfigs(WorkstationClusterName parent)
Returns all workstation configurations in the specified cluster on which the caller has the
"workstations.workstation.create" permission.
|
com.google.api.gax.rpc.UnaryCallable<ListUsableWorkstationConfigsRequest,ListUsableWorkstationConfigsResponse> |
listUsableWorkstationConfigsCallable()
Returns all workstation configurations in the specified cluster on which the caller has the
"workstations.workstation.create" permission.
|
com.google.api.gax.rpc.UnaryCallable<ListUsableWorkstationConfigsRequest,WorkstationsClient.ListUsableWorkstationConfigsPagedResponse> |
listUsableWorkstationConfigsPagedCallable()
Returns all workstation configurations in the specified cluster on which the caller has the
"workstations.workstation.create" permission.
|
WorkstationsClient.ListUsableWorkstationsPagedResponse |
listUsableWorkstations(ListUsableWorkstationsRequest request)
Returns all workstations using the specified workstation configuration on which the caller has
the "workstations.workstations.use" permission.
|
WorkstationsClient.ListUsableWorkstationsPagedResponse |
listUsableWorkstations(String parent)
Returns all workstations using the specified workstation configuration on which the caller has
the "workstations.workstations.use" permission.
|
WorkstationsClient.ListUsableWorkstationsPagedResponse |
listUsableWorkstations(WorkstationConfigName parent)
Returns all workstations using the specified workstation configuration on which the caller has
the "workstations.workstations.use" permission.
|
com.google.api.gax.rpc.UnaryCallable<ListUsableWorkstationsRequest,ListUsableWorkstationsResponse> |
listUsableWorkstationsCallable()
Returns all workstations using the specified workstation configuration on which the caller has
the "workstations.workstations.use" permission.
|
com.google.api.gax.rpc.UnaryCallable<ListUsableWorkstationsRequest,WorkstationsClient.ListUsableWorkstationsPagedResponse> |
listUsableWorkstationsPagedCallable()
Returns all workstations using the specified workstation configuration on which the caller has
the "workstations.workstations.use" permission.
|
WorkstationsClient.ListWorkstationClustersPagedResponse |
listWorkstationClusters(ListWorkstationClustersRequest request)
Returns all workstation clusters in the specified location.
|
WorkstationsClient.ListWorkstationClustersPagedResponse |
listWorkstationClusters(LocationName parent)
Returns all workstation clusters in the specified location.
|
WorkstationsClient.ListWorkstationClustersPagedResponse |
listWorkstationClusters(String parent)
Returns all workstation clusters in the specified location.
|
com.google.api.gax.rpc.UnaryCallable<ListWorkstationClustersRequest,ListWorkstationClustersResponse> |
listWorkstationClustersCallable()
Returns all workstation clusters in the specified location.
|
com.google.api.gax.rpc.UnaryCallable<ListWorkstationClustersRequest,WorkstationsClient.ListWorkstationClustersPagedResponse> |
listWorkstationClustersPagedCallable()
Returns all workstation clusters in the specified location.
|
WorkstationsClient.ListWorkstationConfigsPagedResponse |
listWorkstationConfigs(ListWorkstationConfigsRequest request)
Returns all workstation configurations in the specified cluster.
|
WorkstationsClient.ListWorkstationConfigsPagedResponse |
listWorkstationConfigs(String parent)
Returns all workstation configurations in the specified cluster.
|
WorkstationsClient.ListWorkstationConfigsPagedResponse |
listWorkstationConfigs(WorkstationClusterName parent)
Returns all workstation configurations in the specified cluster.
|
com.google.api.gax.rpc.UnaryCallable<ListWorkstationConfigsRequest,ListWorkstationConfigsResponse> |
listWorkstationConfigsCallable()
Returns all workstation configurations in the specified cluster.
|
com.google.api.gax.rpc.UnaryCallable<ListWorkstationConfigsRequest,WorkstationsClient.ListWorkstationConfigsPagedResponse> |
listWorkstationConfigsPagedCallable()
Returns all workstation configurations in the specified cluster.
|
WorkstationsClient.ListWorkstationsPagedResponse |
listWorkstations(ListWorkstationsRequest request)
Returns all Workstations using the specified workstation configuration.
|
WorkstationsClient.ListWorkstationsPagedResponse |
listWorkstations(String parent)
Returns all Workstations using the specified workstation configuration.
|
WorkstationsClient.ListWorkstationsPagedResponse |
listWorkstations(WorkstationConfigName parent)
Returns all Workstations using the specified workstation configuration.
|
com.google.api.gax.rpc.UnaryCallable<ListWorkstationsRequest,ListWorkstationsResponse> |
listWorkstationsCallable()
Returns all Workstations using the specified workstation configuration.
|
com.google.api.gax.rpc.UnaryCallable<ListWorkstationsRequest,WorkstationsClient.ListWorkstationsPagedResponse> |
listWorkstationsPagedCallable()
Returns all Workstations using the specified workstation configuration.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
startWorkstationAsync(StartWorkstationRequest request)
Starts running a workstation so that users can connect to it.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
startWorkstationAsync(String name)
Starts running a workstation so that users can connect to it.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
startWorkstationAsync(WorkstationName name)
Starts running a workstation so that users can connect to it.
|
com.google.api.gax.rpc.UnaryCallable<StartWorkstationRequest,com.google.longrunning.Operation> |
startWorkstationCallable()
Starts running a workstation so that users can connect to it.
|
com.google.api.gax.rpc.OperationCallable<StartWorkstationRequest,Workstation,OperationMetadata> |
startWorkstationOperationCallable()
Starts running a workstation so that users can connect to it.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
stopWorkstationAsync(StopWorkstationRequest request)
Stops running a workstation, reducing costs.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
stopWorkstationAsync(String name)
Stops running a workstation, reducing costs.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
stopWorkstationAsync(WorkstationName name)
Stops running a workstation, reducing costs.
|
com.google.api.gax.rpc.UnaryCallable<StopWorkstationRequest,com.google.longrunning.Operation> |
stopWorkstationCallable()
Stops running a workstation, reducing costs.
|
com.google.api.gax.rpc.OperationCallable<StopWorkstationRequest,Workstation,OperationMetadata> |
stopWorkstationOperationCallable()
Stops running a workstation, reducing costs.
|
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
updateWorkstationAsync(UpdateWorkstationRequest request)
Updates an existing workstation.
|
com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> |
updateWorkstationAsync(Workstation workstation,
com.google.protobuf.FieldMask updateMask)
Updates an existing workstation.
|
com.google.api.gax.rpc.UnaryCallable<UpdateWorkstationRequest,com.google.longrunning.Operation> |
updateWorkstationCallable()
Updates an existing workstation.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> |
updateWorkstationClusterAsync(UpdateWorkstationClusterRequest request)
Updates an existing workstation cluster.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> |
updateWorkstationClusterAsync(WorkstationCluster workstationCluster,
com.google.protobuf.FieldMask updateMask)
Updates an existing workstation cluster.
|
com.google.api.gax.rpc.UnaryCallable<UpdateWorkstationClusterRequest,com.google.longrunning.Operation> |
updateWorkstationClusterCallable()
Updates an existing workstation cluster.
|
com.google.api.gax.rpc.OperationCallable<UpdateWorkstationClusterRequest,WorkstationCluster,OperationMetadata> |
updateWorkstationClusterOperationCallable()
Updates an existing workstation cluster.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> |
updateWorkstationConfigAsync(UpdateWorkstationConfigRequest request)
Updates an existing workstation configuration.
|
com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> |
updateWorkstationConfigAsync(WorkstationConfig workstationConfig,
com.google.protobuf.FieldMask updateMask)
Updates an existing workstation configuration.
|
com.google.api.gax.rpc.UnaryCallable<UpdateWorkstationConfigRequest,com.google.longrunning.Operation> |
updateWorkstationConfigCallable()
Updates an existing workstation configuration.
|
com.google.api.gax.rpc.OperationCallable<UpdateWorkstationConfigRequest,WorkstationConfig,OperationMetadata> |
updateWorkstationConfigOperationCallable()
Updates an existing workstation configuration.
|
com.google.api.gax.rpc.OperationCallable<UpdateWorkstationRequest,Workstation,OperationMetadata> |
updateWorkstationOperationCallable()
Updates an existing workstation.
|
protected WorkstationsClient(WorkstationsSettings settings) throws IOException
IOExceptionprotected WorkstationsClient(WorkstationsStub stub)
public static final WorkstationsClient create() throws IOException
IOExceptionpublic static final WorkstationsClient create(WorkstationsSettings settings) throws IOException
IOExceptionpublic static final WorkstationsClient create(WorkstationsStub stub)
public final WorkstationsSettings getSettings()
public WorkstationsStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final WorkstationCluster getWorkstationCluster(WorkstationClusterName name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationClusterName name =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
WorkstationCluster response = workstationsClient.getWorkstationCluster(name);
}
name - Required. Name of the requested resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationCluster getWorkstationCluster(String name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String name =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
WorkstationCluster response = workstationsClient.getWorkstationCluster(name);
}
name - Required. Name of the requested resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationCluster getWorkstationCluster(GetWorkstationClusterRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GetWorkstationClusterRequest request =
GetWorkstationClusterRequest.newBuilder()
.setName(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.build();
WorkstationCluster response = workstationsClient.getWorkstationCluster(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetWorkstationClusterRequest,WorkstationCluster> getWorkstationClusterCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GetWorkstationClusterRequest request =
GetWorkstationClusterRequest.newBuilder()
.setName(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.build();
ApiFuture<WorkstationCluster> future =
workstationsClient.getWorkstationClusterCallable().futureCall(request);
// Do something.
WorkstationCluster response = future.get();
}
public final WorkstationsClient.ListWorkstationClustersPagedResponse listWorkstationClusters(LocationName parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (WorkstationCluster element :
workstationsClient.listWorkstationClusters(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListWorkstationClustersPagedResponse listWorkstationClusters(String parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (WorkstationCluster element :
workstationsClient.listWorkstationClusters(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListWorkstationClustersPagedResponse listWorkstationClusters(ListWorkstationClustersRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListWorkstationClustersRequest request =
ListWorkstationClustersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (WorkstationCluster element :
workstationsClient.listWorkstationClusters(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListWorkstationClustersRequest,WorkstationsClient.ListWorkstationClustersPagedResponse> listWorkstationClustersPagedCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListWorkstationClustersRequest request =
ListWorkstationClustersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<WorkstationCluster> future =
workstationsClient.listWorkstationClustersPagedCallable().futureCall(request);
// Do something.
for (WorkstationCluster element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListWorkstationClustersRequest,ListWorkstationClustersResponse> listWorkstationClustersCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListWorkstationClustersRequest request =
ListWorkstationClustersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListWorkstationClustersResponse response =
workstationsClient.listWorkstationClustersCallable().call(request);
for (WorkstationCluster element : response.getWorkstationClustersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> createWorkstationClusterAsync(LocationName parent, WorkstationCluster workstationCluster, String workstationClusterId)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build();
String workstationClusterId = "workstationClusterId351421170";
WorkstationCluster response =
workstationsClient
.createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId)
.get();
}
parent - Required. Parent resource name.workstationCluster - Required. Workstation cluster to create.workstationClusterId - Required. ID to use for the workstation cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> createWorkstationClusterAsync(String parent, WorkstationCluster workstationCluster, String workstationClusterId)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build();
String workstationClusterId = "workstationClusterId351421170";
WorkstationCluster response =
workstationsClient
.createWorkstationClusterAsync(parent, workstationCluster, workstationClusterId)
.get();
}
parent - Required. Parent resource name.workstationCluster - Required. Workstation cluster to create.workstationClusterId - Required. ID to use for the workstation cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> createWorkstationClusterAsync(CreateWorkstationClusterRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
CreateWorkstationClusterRequest request =
CreateWorkstationClusterRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setWorkstationClusterId("workstationClusterId351421170")
.setWorkstationCluster(WorkstationCluster.newBuilder().build())
.setValidateOnly(true)
.build();
WorkstationCluster response = workstationsClient.createWorkstationClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateWorkstationClusterRequest,WorkstationCluster,OperationMetadata> createWorkstationClusterOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
CreateWorkstationClusterRequest request =
CreateWorkstationClusterRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setWorkstationClusterId("workstationClusterId351421170")
.setWorkstationCluster(WorkstationCluster.newBuilder().build())
.setValidateOnly(true)
.build();
OperationFuture<WorkstationCluster, OperationMetadata> future =
workstationsClient.createWorkstationClusterOperationCallable().futureCall(request);
// Do something.
WorkstationCluster response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateWorkstationClusterRequest,com.google.longrunning.Operation> createWorkstationClusterCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
CreateWorkstationClusterRequest request =
CreateWorkstationClusterRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setWorkstationClusterId("workstationClusterId351421170")
.setWorkstationCluster(WorkstationCluster.newBuilder().build())
.setValidateOnly(true)
.build();
ApiFuture<Operation> future =
workstationsClient.createWorkstationClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> updateWorkstationClusterAsync(WorkstationCluster workstationCluster, com.google.protobuf.FieldMask updateMask)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationCluster workstationCluster = WorkstationCluster.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
WorkstationCluster response =
workstationsClient.updateWorkstationClusterAsync(workstationCluster, updateMask).get();
}
workstationCluster - Required. Workstation cluster to update.updateMask - Required. Mask that specifies which fields in the workstation cluster should
be updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> updateWorkstationClusterAsync(UpdateWorkstationClusterRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
UpdateWorkstationClusterRequest request =
UpdateWorkstationClusterRequest.newBuilder()
.setWorkstationCluster(WorkstationCluster.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.setAllowMissing(true)
.build();
WorkstationCluster response = workstationsClient.updateWorkstationClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateWorkstationClusterRequest,WorkstationCluster,OperationMetadata> updateWorkstationClusterOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
UpdateWorkstationClusterRequest request =
UpdateWorkstationClusterRequest.newBuilder()
.setWorkstationCluster(WorkstationCluster.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.setAllowMissing(true)
.build();
OperationFuture<WorkstationCluster, OperationMetadata> future =
workstationsClient.updateWorkstationClusterOperationCallable().futureCall(request);
// Do something.
WorkstationCluster response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateWorkstationClusterRequest,com.google.longrunning.Operation> updateWorkstationClusterCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
UpdateWorkstationClusterRequest request =
UpdateWorkstationClusterRequest.newBuilder()
.setWorkstationCluster(WorkstationCluster.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.setAllowMissing(true)
.build();
ApiFuture<Operation> future =
workstationsClient.updateWorkstationClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> deleteWorkstationClusterAsync(WorkstationClusterName name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationClusterName name =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
WorkstationCluster response = workstationsClient.deleteWorkstationClusterAsync(name).get();
}
name - Required. Name of the workstation cluster to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> deleteWorkstationClusterAsync(String name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String name =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
WorkstationCluster response = workstationsClient.deleteWorkstationClusterAsync(name).get();
}
name - Required. Name of the workstation cluster to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationCluster,OperationMetadata> deleteWorkstationClusterAsync(DeleteWorkstationClusterRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
DeleteWorkstationClusterRequest request =
DeleteWorkstationClusterRequest.newBuilder()
.setName(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.setForce(true)
.build();
WorkstationCluster response = workstationsClient.deleteWorkstationClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteWorkstationClusterRequest,WorkstationCluster,OperationMetadata> deleteWorkstationClusterOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
DeleteWorkstationClusterRequest request =
DeleteWorkstationClusterRequest.newBuilder()
.setName(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.setForce(true)
.build();
OperationFuture<WorkstationCluster, OperationMetadata> future =
workstationsClient.deleteWorkstationClusterOperationCallable().futureCall(request);
// Do something.
WorkstationCluster response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteWorkstationClusterRequest,com.google.longrunning.Operation> deleteWorkstationClusterCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
DeleteWorkstationClusterRequest request =
DeleteWorkstationClusterRequest.newBuilder()
.setName(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.setForce(true)
.build();
ApiFuture<Operation> future =
workstationsClient.deleteWorkstationClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final WorkstationConfig getWorkstationConfig(WorkstationConfigName name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationConfigName name =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
WorkstationConfig response = workstationsClient.getWorkstationConfig(name);
}
name - Required. Name of the requested resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationConfig getWorkstationConfig(String name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String name =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
.toString();
WorkstationConfig response = workstationsClient.getWorkstationConfig(name);
}
name - Required. Name of the requested resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationConfig getWorkstationConfig(GetWorkstationConfigRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GetWorkstationConfigRequest request =
GetWorkstationConfigRequest.newBuilder()
.setName(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.build();
WorkstationConfig response = workstationsClient.getWorkstationConfig(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetWorkstationConfigRequest,WorkstationConfig> getWorkstationConfigCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GetWorkstationConfigRequest request =
GetWorkstationConfigRequest.newBuilder()
.setName(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.build();
ApiFuture<WorkstationConfig> future =
workstationsClient.getWorkstationConfigCallable().futureCall(request);
// Do something.
WorkstationConfig response = future.get();
}
public final WorkstationsClient.ListWorkstationConfigsPagedResponse listWorkstationConfigs(WorkstationClusterName parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationClusterName parent =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
for (WorkstationConfig element :
workstationsClient.listWorkstationConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListWorkstationConfigsPagedResponse listWorkstationConfigs(String parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String parent =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
for (WorkstationConfig element :
workstationsClient.listWorkstationConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListWorkstationConfigsPagedResponse listWorkstationConfigs(ListWorkstationConfigsRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListWorkstationConfigsRequest request =
ListWorkstationConfigsRequest.newBuilder()
.setParent(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (WorkstationConfig element :
workstationsClient.listWorkstationConfigs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListWorkstationConfigsRequest,WorkstationsClient.ListWorkstationConfigsPagedResponse> listWorkstationConfigsPagedCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListWorkstationConfigsRequest request =
ListWorkstationConfigsRequest.newBuilder()
.setParent(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<WorkstationConfig> future =
workstationsClient.listWorkstationConfigsPagedCallable().futureCall(request);
// Do something.
for (WorkstationConfig element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListWorkstationConfigsRequest,ListWorkstationConfigsResponse> listWorkstationConfigsCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListWorkstationConfigsRequest request =
ListWorkstationConfigsRequest.newBuilder()
.setParent(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListWorkstationConfigsResponse response =
workstationsClient.listWorkstationConfigsCallable().call(request);
for (WorkstationConfig element : response.getWorkstationConfigsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final WorkstationsClient.ListUsableWorkstationConfigsPagedResponse listUsableWorkstationConfigs(WorkstationClusterName parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationClusterName parent =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
for (WorkstationConfig element :
workstationsClient.listUsableWorkstationConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListUsableWorkstationConfigsPagedResponse listUsableWorkstationConfigs(String parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String parent =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
for (WorkstationConfig element :
workstationsClient.listUsableWorkstationConfigs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListUsableWorkstationConfigsPagedResponse listUsableWorkstationConfigs(ListUsableWorkstationConfigsRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListUsableWorkstationConfigsRequest request =
ListUsableWorkstationConfigsRequest.newBuilder()
.setParent(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (WorkstationConfig element :
workstationsClient.listUsableWorkstationConfigs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListUsableWorkstationConfigsRequest,WorkstationsClient.ListUsableWorkstationConfigsPagedResponse> listUsableWorkstationConfigsPagedCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListUsableWorkstationConfigsRequest request =
ListUsableWorkstationConfigsRequest.newBuilder()
.setParent(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<WorkstationConfig> future =
workstationsClient.listUsableWorkstationConfigsPagedCallable().futureCall(request);
// Do something.
for (WorkstationConfig element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListUsableWorkstationConfigsRequest,ListUsableWorkstationConfigsResponse> listUsableWorkstationConfigsCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListUsableWorkstationConfigsRequest request =
ListUsableWorkstationConfigsRequest.newBuilder()
.setParent(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListUsableWorkstationConfigsResponse response =
workstationsClient.listUsableWorkstationConfigsCallable().call(request);
for (WorkstationConfig element : response.getWorkstationConfigsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> createWorkstationConfigAsync(WorkstationClusterName parent, WorkstationConfig workstationConfig, String workstationConfigId)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationClusterName parent =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]");
WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build();
String workstationConfigId = "workstationConfigId798542368";
WorkstationConfig response =
workstationsClient
.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId)
.get();
}
parent - Required. Parent resource name.workstationConfig - Required. Config to create.workstationConfigId - Required. ID to use for the workstation configuration.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> createWorkstationConfigAsync(String parent, WorkstationConfig workstationConfig, String workstationConfigId)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String parent =
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]").toString();
WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build();
String workstationConfigId = "workstationConfigId798542368";
WorkstationConfig response =
workstationsClient
.createWorkstationConfigAsync(parent, workstationConfig, workstationConfigId)
.get();
}
parent - Required. Parent resource name.workstationConfig - Required. Config to create.workstationConfigId - Required. ID to use for the workstation configuration.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> createWorkstationConfigAsync(CreateWorkstationConfigRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
CreateWorkstationConfigRequest request =
CreateWorkstationConfigRequest.newBuilder()
.setParent(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setWorkstationConfigId("workstationConfigId798542368")
.setWorkstationConfig(WorkstationConfig.newBuilder().build())
.setValidateOnly(true)
.build();
WorkstationConfig response = workstationsClient.createWorkstationConfigAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateWorkstationConfigRequest,WorkstationConfig,OperationMetadata> createWorkstationConfigOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
CreateWorkstationConfigRequest request =
CreateWorkstationConfigRequest.newBuilder()
.setParent(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setWorkstationConfigId("workstationConfigId798542368")
.setWorkstationConfig(WorkstationConfig.newBuilder().build())
.setValidateOnly(true)
.build();
OperationFuture<WorkstationConfig, OperationMetadata> future =
workstationsClient.createWorkstationConfigOperationCallable().futureCall(request);
// Do something.
WorkstationConfig response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateWorkstationConfigRequest,com.google.longrunning.Operation> createWorkstationConfigCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
CreateWorkstationConfigRequest request =
CreateWorkstationConfigRequest.newBuilder()
.setParent(
WorkstationClusterName.of("[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]")
.toString())
.setWorkstationConfigId("workstationConfigId798542368")
.setWorkstationConfig(WorkstationConfig.newBuilder().build())
.setValidateOnly(true)
.build();
ApiFuture<Operation> future =
workstationsClient.createWorkstationConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> updateWorkstationConfigAsync(WorkstationConfig workstationConfig, com.google.protobuf.FieldMask updateMask)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationConfig workstationConfig = WorkstationConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
WorkstationConfig response =
workstationsClient.updateWorkstationConfigAsync(workstationConfig, updateMask).get();
}
workstationConfig - Required. Config to update.updateMask - Required. Mask specifying which fields in the workstation configuration
should be updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> updateWorkstationConfigAsync(UpdateWorkstationConfigRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
UpdateWorkstationConfigRequest request =
UpdateWorkstationConfigRequest.newBuilder()
.setWorkstationConfig(WorkstationConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.setAllowMissing(true)
.build();
WorkstationConfig response = workstationsClient.updateWorkstationConfigAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateWorkstationConfigRequest,WorkstationConfig,OperationMetadata> updateWorkstationConfigOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
UpdateWorkstationConfigRequest request =
UpdateWorkstationConfigRequest.newBuilder()
.setWorkstationConfig(WorkstationConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.setAllowMissing(true)
.build();
OperationFuture<WorkstationConfig, OperationMetadata> future =
workstationsClient.updateWorkstationConfigOperationCallable().futureCall(request);
// Do something.
WorkstationConfig response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateWorkstationConfigRequest,com.google.longrunning.Operation> updateWorkstationConfigCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
UpdateWorkstationConfigRequest request =
UpdateWorkstationConfigRequest.newBuilder()
.setWorkstationConfig(WorkstationConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.setAllowMissing(true)
.build();
ApiFuture<Operation> future =
workstationsClient.updateWorkstationConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> deleteWorkstationConfigAsync(WorkstationConfigName name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationConfigName name =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
WorkstationConfig response = workstationsClient.deleteWorkstationConfigAsync(name).get();
}
name - Required. Name of the workstation configuration to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> deleteWorkstationConfigAsync(String name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String name =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
.toString();
WorkstationConfig response = workstationsClient.deleteWorkstationConfigAsync(name).get();
}
name - Required. Name of the workstation configuration to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<WorkstationConfig,OperationMetadata> deleteWorkstationConfigAsync(DeleteWorkstationConfigRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
DeleteWorkstationConfigRequest request =
DeleteWorkstationConfigRequest.newBuilder()
.setName(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.setForce(true)
.build();
WorkstationConfig response = workstationsClient.deleteWorkstationConfigAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteWorkstationConfigRequest,WorkstationConfig,OperationMetadata> deleteWorkstationConfigOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
DeleteWorkstationConfigRequest request =
DeleteWorkstationConfigRequest.newBuilder()
.setName(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.setForce(true)
.build();
OperationFuture<WorkstationConfig, OperationMetadata> future =
workstationsClient.deleteWorkstationConfigOperationCallable().futureCall(request);
// Do something.
WorkstationConfig response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteWorkstationConfigRequest,com.google.longrunning.Operation> deleteWorkstationConfigCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
DeleteWorkstationConfigRequest request =
DeleteWorkstationConfigRequest.newBuilder()
.setName(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.setForce(true)
.build();
ApiFuture<Operation> future =
workstationsClient.deleteWorkstationConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Workstation getWorkstation(WorkstationName name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationName name =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]");
Workstation response = workstationsClient.getWorkstation(name);
}
name - Required. Name of the requested resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Workstation getWorkstation(String name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String name =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString();
Workstation response = workstationsClient.getWorkstation(name);
}
name - Required. Name of the requested resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Workstation getWorkstation(GetWorkstationRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GetWorkstationRequest request =
GetWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.build();
Workstation response = workstationsClient.getWorkstation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetWorkstationRequest,Workstation> getWorkstationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GetWorkstationRequest request =
GetWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.build();
ApiFuture<Workstation> future =
workstationsClient.getWorkstationCallable().futureCall(request);
// Do something.
Workstation response = future.get();
}
public final WorkstationsClient.ListWorkstationsPagedResponse listWorkstations(WorkstationConfigName parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationConfigName parent =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
for (Workstation element : workstationsClient.listWorkstations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListWorkstationsPagedResponse listWorkstations(String parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String parent =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
.toString();
for (Workstation element : workstationsClient.listWorkstations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListWorkstationsPagedResponse listWorkstations(ListWorkstationsRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListWorkstationsRequest request =
ListWorkstationsRequest.newBuilder()
.setParent(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Workstation element : workstationsClient.listWorkstations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListWorkstationsRequest,WorkstationsClient.ListWorkstationsPagedResponse> listWorkstationsPagedCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListWorkstationsRequest request =
ListWorkstationsRequest.newBuilder()
.setParent(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Workstation> future =
workstationsClient.listWorkstationsPagedCallable().futureCall(request);
// Do something.
for (Workstation element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListWorkstationsRequest,ListWorkstationsResponse> listWorkstationsCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListWorkstationsRequest request =
ListWorkstationsRequest.newBuilder()
.setParent(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListWorkstationsResponse response =
workstationsClient.listWorkstationsCallable().call(request);
for (Workstation element : response.getWorkstationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final WorkstationsClient.ListUsableWorkstationsPagedResponse listUsableWorkstations(WorkstationConfigName parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationConfigName parent =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
for (Workstation element : workstationsClient.listUsableWorkstations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListUsableWorkstationsPagedResponse listUsableWorkstations(String parent)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String parent =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
.toString();
for (Workstation element : workstationsClient.listUsableWorkstations(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent resource name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkstationsClient.ListUsableWorkstationsPagedResponse listUsableWorkstations(ListUsableWorkstationsRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListUsableWorkstationsRequest request =
ListUsableWorkstationsRequest.newBuilder()
.setParent(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Workstation element : workstationsClient.listUsableWorkstations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListUsableWorkstationsRequest,WorkstationsClient.ListUsableWorkstationsPagedResponse> listUsableWorkstationsPagedCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListUsableWorkstationsRequest request =
ListUsableWorkstationsRequest.newBuilder()
.setParent(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Workstation> future =
workstationsClient.listUsableWorkstationsPagedCallable().futureCall(request);
// Do something.
for (Workstation element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListUsableWorkstationsRequest,ListUsableWorkstationsResponse> listUsableWorkstationsCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
ListUsableWorkstationsRequest request =
ListUsableWorkstationsRequest.newBuilder()
.setParent(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListUsableWorkstationsResponse response =
workstationsClient.listUsableWorkstationsCallable().call(request);
for (Workstation element : response.getWorkstationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> createWorkstationAsync(WorkstationConfigName parent, Workstation workstation, String workstationId)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationConfigName parent =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]");
Workstation workstation = Workstation.newBuilder().build();
String workstationId = "workstationId560540030";
Workstation response =
workstationsClient.createWorkstationAsync(parent, workstation, workstationId).get();
}
parent - Required. Parent resource name.workstation - Required. Workstation to create.workstationId - Required. ID to use for the workstation.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> createWorkstationAsync(String parent, Workstation workstation, String workstationId)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String parent =
WorkstationConfigName.of(
"[PROJECT]", "[LOCATION]", "[WORKSTATION_CLUSTER]", "[WORKSTATION_CONFIG]")
.toString();
Workstation workstation = Workstation.newBuilder().build();
String workstationId = "workstationId560540030";
Workstation response =
workstationsClient.createWorkstationAsync(parent, workstation, workstationId).get();
}
parent - Required. Parent resource name.workstation - Required. Workstation to create.workstationId - Required. ID to use for the workstation.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> createWorkstationAsync(CreateWorkstationRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
CreateWorkstationRequest request =
CreateWorkstationRequest.newBuilder()
.setParent(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setWorkstationId("workstationId560540030")
.setWorkstation(Workstation.newBuilder().build())
.setValidateOnly(true)
.build();
Workstation response = workstationsClient.createWorkstationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateWorkstationRequest,Workstation,OperationMetadata> createWorkstationOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
CreateWorkstationRequest request =
CreateWorkstationRequest.newBuilder()
.setParent(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setWorkstationId("workstationId560540030")
.setWorkstation(Workstation.newBuilder().build())
.setValidateOnly(true)
.build();
OperationFuture<Workstation, OperationMetadata> future =
workstationsClient.createWorkstationOperationCallable().futureCall(request);
// Do something.
Workstation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateWorkstationRequest,com.google.longrunning.Operation> createWorkstationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
CreateWorkstationRequest request =
CreateWorkstationRequest.newBuilder()
.setParent(
WorkstationConfigName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]")
.toString())
.setWorkstationId("workstationId560540030")
.setWorkstation(Workstation.newBuilder().build())
.setValidateOnly(true)
.build();
ApiFuture<Operation> future =
workstationsClient.createWorkstationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> updateWorkstationAsync(Workstation workstation, com.google.protobuf.FieldMask updateMask)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
Workstation workstation = Workstation.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Workstation response =
workstationsClient.updateWorkstationAsync(workstation, updateMask).get();
}
workstation - Required. Workstation to update.updateMask - Required. Mask specifying which fields in the workstation configuration
should be updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> updateWorkstationAsync(UpdateWorkstationRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
UpdateWorkstationRequest request =
UpdateWorkstationRequest.newBuilder()
.setWorkstation(Workstation.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.setAllowMissing(true)
.build();
Workstation response = workstationsClient.updateWorkstationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateWorkstationRequest,Workstation,OperationMetadata> updateWorkstationOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
UpdateWorkstationRequest request =
UpdateWorkstationRequest.newBuilder()
.setWorkstation(Workstation.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.setAllowMissing(true)
.build();
OperationFuture<Workstation, OperationMetadata> future =
workstationsClient.updateWorkstationOperationCallable().futureCall(request);
// Do something.
Workstation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateWorkstationRequest,com.google.longrunning.Operation> updateWorkstationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
UpdateWorkstationRequest request =
UpdateWorkstationRequest.newBuilder()
.setWorkstation(Workstation.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.setAllowMissing(true)
.build();
ApiFuture<Operation> future =
workstationsClient.updateWorkstationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> deleteWorkstationAsync(WorkstationName name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationName name =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]");
Workstation response = workstationsClient.deleteWorkstationAsync(name).get();
}
name - Required. Name of the workstation to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> deleteWorkstationAsync(String name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String name =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString();
Workstation response = workstationsClient.deleteWorkstationAsync(name).get();
}
name - Required. Name of the workstation to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> deleteWorkstationAsync(DeleteWorkstationRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
DeleteWorkstationRequest request =
DeleteWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
Workstation response = workstationsClient.deleteWorkstationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteWorkstationRequest,Workstation,OperationMetadata> deleteWorkstationOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
DeleteWorkstationRequest request =
DeleteWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
OperationFuture<Workstation, OperationMetadata> future =
workstationsClient.deleteWorkstationOperationCallable().futureCall(request);
// Do something.
Workstation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteWorkstationRequest,com.google.longrunning.Operation> deleteWorkstationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
DeleteWorkstationRequest request =
DeleteWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
ApiFuture<Operation> future =
workstationsClient.deleteWorkstationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> startWorkstationAsync(WorkstationName name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationName name =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]");
Workstation response = workstationsClient.startWorkstationAsync(name).get();
}
name - Required. Name of the workstation to start.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> startWorkstationAsync(String name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String name =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString();
Workstation response = workstationsClient.startWorkstationAsync(name).get();
}
name - Required. Name of the workstation to start.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> startWorkstationAsync(StartWorkstationRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
StartWorkstationRequest request =
StartWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
Workstation response = workstationsClient.startWorkstationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<StartWorkstationRequest,Workstation,OperationMetadata> startWorkstationOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
StartWorkstationRequest request =
StartWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
OperationFuture<Workstation, OperationMetadata> future =
workstationsClient.startWorkstationOperationCallable().futureCall(request);
// Do something.
Workstation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<StartWorkstationRequest,com.google.longrunning.Operation> startWorkstationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
StartWorkstationRequest request =
StartWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
ApiFuture<Operation> future =
workstationsClient.startWorkstationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> stopWorkstationAsync(WorkstationName name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationName name =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]");
Workstation response = workstationsClient.stopWorkstationAsync(name).get();
}
name - Required. Name of the workstation to stop.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> stopWorkstationAsync(String name)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String name =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString();
Workstation response = workstationsClient.stopWorkstationAsync(name).get();
}
name - Required. Name of the workstation to stop.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workstation,OperationMetadata> stopWorkstationAsync(StopWorkstationRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
StopWorkstationRequest request =
StopWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
Workstation response = workstationsClient.stopWorkstationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<StopWorkstationRequest,Workstation,OperationMetadata> stopWorkstationOperationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
StopWorkstationRequest request =
StopWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
OperationFuture<Workstation, OperationMetadata> future =
workstationsClient.stopWorkstationOperationCallable().futureCall(request);
// Do something.
Workstation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<StopWorkstationRequest,com.google.longrunning.Operation> stopWorkstationCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
StopWorkstationRequest request =
StopWorkstationRequest.newBuilder()
.setName(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
ApiFuture<Operation> future =
workstationsClient.stopWorkstationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final GenerateAccessTokenResponse generateAccessToken(WorkstationName workstation)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
WorkstationName workstation =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]");
GenerateAccessTokenResponse response = workstationsClient.generateAccessToken(workstation);
}
workstation - Required. Name of the workstation for which the access token should be
generated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final GenerateAccessTokenResponse generateAccessToken(String workstation)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
String workstation =
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString();
GenerateAccessTokenResponse response = workstationsClient.generateAccessToken(workstation);
}
workstation - Required. Name of the workstation for which the access token should be
generated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final GenerateAccessTokenResponse generateAccessToken(GenerateAccessTokenRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GenerateAccessTokenRequest request =
GenerateAccessTokenRequest.newBuilder()
.setWorkstation(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.build();
GenerateAccessTokenResponse response = workstationsClient.generateAccessToken(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GenerateAccessTokenRequest,GenerateAccessTokenResponse> generateAccessTokenCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GenerateAccessTokenRequest request =
GenerateAccessTokenRequest.newBuilder()
.setWorkstation(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.build();
ApiFuture<GenerateAccessTokenResponse> future =
workstationsClient.generateAccessTokenCallable().futureCall(request);
// Do something.
GenerateAccessTokenResponse response = future.get();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = workstationsClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future = workstationsClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = workstationsClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = workstationsClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = workstationsClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (WorkstationsClient workstationsClient = WorkstationsClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
WorkstationName.of(
"[PROJECT]",
"[LOCATION]",
"[WORKSTATION_CLUSTER]",
"[WORKSTATION_CONFIG]",
"[WORKSTATION]")
.toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
workstationsClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2025 Google LLC. All rights reserved.