Class ConfigClient (0.7.0)

GitHub RepositoryProduct Reference

Service Description: Infrastructure Manager is a managed service that automates the deployment and management of Google Cloud infrastructure resources.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
   Deployment response = configClient.getDeployment(name);
 }
 

Note: close() needs to be called on the ConfigClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns 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 ConfigSettings 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
 ConfigSettings configSettings =
     ConfigSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ConfigClient configClient = ConfigClient.create(configSettings);
 

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
 ConfigSettings configSettings = ConfigSettings.newBuilder().setEndpoint(myEndpoint).build();
 ConfigClient configClient = ConfigClient.create(configSettings);
 

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
 ConfigSettings configSettings = ConfigSettings.newHttpJsonBuilder().build();
 ConfigClient configClient = ConfigClient.create(configSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > ConfigClient

Static Methods

create()

public static final ConfigClient create()

Constructs an instance of ConfigClient with default settings.

Returns
TypeDescription
ConfigClient
Exceptions
TypeDescription
IOException

create(ConfigSettings settings)

public static final ConfigClient create(ConfigSettings settings)

Constructs an instance of ConfigClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsConfigSettings
Returns
TypeDescription
ConfigClient
Exceptions
TypeDescription
IOException

create(ConfigStub stub)

public static final ConfigClient create(ConfigStub stub)

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

Parameter
NameDescription
stubConfigStub
Returns
TypeDescription
ConfigClient

Constructors

ConfigClient(ConfigSettings settings)

protected ConfigClient(ConfigSettings settings)

Constructs an instance of ConfigClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
NameDescription
settingsConfigSettings

ConfigClient(ConfigStub stub)

protected ConfigClient(ConfigStub stub)
Parameter
NameDescription
stubConfigStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

createDeploymentAsync(CreateDeploymentRequest request)

public final OperationFuture<Deployment,OperationMetadata> createDeploymentAsync(CreateDeploymentRequest request)

Creates a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   CreateDeploymentRequest request =
       CreateDeploymentRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDeploymentId("deploymentId-136894784")
           .setDeployment(Deployment.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Deployment response = configClient.createDeploymentAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateDeploymentRequest

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

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

createDeploymentAsync(LocationName parent, Deployment deployment, String deploymentId)

public final OperationFuture<Deployment,OperationMetadata> createDeploymentAsync(LocationName parent, Deployment deployment, String deploymentId)

Creates a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Deployment deployment = Deployment.newBuilder().build();
   String deploymentId = "deploymentId-136894784";
   Deployment response =
       configClient.createDeploymentAsync(parent, deployment, deploymentId).get();
 }
 
Parameters
NameDescription
parentLocationName

Required. The parent in whose context the Deployment is created. The parent value is in the format: 'projects/{project_id}/locations/{location}'.

deploymentDeployment

Required. Deployment resource to be created.

deploymentIdString

Required. The Deployment ID.

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

createDeploymentAsync(String parent, Deployment deployment, String deploymentId)

public final OperationFuture<Deployment,OperationMetadata> createDeploymentAsync(String parent, Deployment deployment, String deploymentId)

Creates a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Deployment deployment = Deployment.newBuilder().build();
   String deploymentId = "deploymentId-136894784";
   Deployment response =
       configClient.createDeploymentAsync(parent, deployment, deploymentId).get();
 }
 
Parameters
NameDescription
parentString

Required. The parent in whose context the Deployment is created. The parent value is in the format: 'projects/{project_id}/locations/{location}'.

deploymentDeployment

Required. Deployment resource to be created.

deploymentIdString

Required. The Deployment ID.

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

createDeploymentCallable()

public final UnaryCallable<CreateDeploymentRequest,Operation> createDeploymentCallable()

Creates a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   CreateDeploymentRequest request =
       CreateDeploymentRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDeploymentId("deploymentId-136894784")
           .setDeployment(Deployment.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = configClient.createDeploymentCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateDeploymentRequest,Operation>

createDeploymentOperationCallable()

public final OperationCallable<CreateDeploymentRequest,Deployment,OperationMetadata> createDeploymentOperationCallable()

Creates a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   CreateDeploymentRequest request =
       CreateDeploymentRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDeploymentId("deploymentId-136894784")
           .setDeployment(Deployment.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Deployment, OperationMetadata> future =
       configClient.createDeploymentOperationCallable().futureCall(request);
   // Do something.
   Deployment response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<CreateDeploymentRequest,Deployment,OperationMetadata>

deleteDeploymentAsync(DeleteDeploymentRequest request)

public final OperationFuture<Deployment,OperationMetadata> deleteDeploymentAsync(DeleteDeploymentRequest request)

Deletes a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeleteDeploymentRequest request =
       DeleteDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setRequestId("requestId693933066")
           .setForce(true)
           .build();
   Deployment response = configClient.deleteDeploymentAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteDeploymentRequest

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

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

deleteDeploymentAsync(DeploymentName name)

public final OperationFuture<Deployment,OperationMetadata> deleteDeploymentAsync(DeploymentName name)

Deletes a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
   Deployment response = configClient.deleteDeploymentAsync(name).get();
 }
 
Parameter
NameDescription
nameDeploymentName

Required. The name of the Deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

deleteDeploymentAsync(String name)

public final OperationFuture<Deployment,OperationMetadata> deleteDeploymentAsync(String name)

Deletes a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
   Deployment response = configClient.deleteDeploymentAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. The name of the Deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

deleteDeploymentCallable()

public final UnaryCallable<DeleteDeploymentRequest,Operation> deleteDeploymentCallable()

Deletes a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeleteDeploymentRequest request =
       DeleteDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setRequestId("requestId693933066")
           .setForce(true)
           .build();
   ApiFuture<Operation> future = configClient.deleteDeploymentCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteDeploymentRequest,Operation>

deleteDeploymentOperationCallable()

public final OperationCallable<DeleteDeploymentRequest,Deployment,OperationMetadata> deleteDeploymentOperationCallable()

Deletes a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeleteDeploymentRequest request =
       DeleteDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setRequestId("requestId693933066")
           .setForce(true)
           .build();
   OperationFuture<Deployment, OperationMetadata> future =
       configClient.deleteDeploymentOperationCallable().futureCall(request);
   // Do something.
   Deployment response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeleteDeploymentRequest,Deployment,OperationMetadata>

deleteStatefile(DeleteStatefileRequest request)

public final void deleteStatefile(DeleteStatefileRequest request)

Deletes Terraform state file in a given deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeleteStatefileRequest request =
       DeleteStatefileRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setLockId(338696367)
           .build();
   configClient.deleteStatefile(request);
 }
 
Parameter
NameDescription
requestDeleteStatefileRequest

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

deleteStatefile(DeploymentName name)

public final void deleteStatefile(DeploymentName name)

Deletes Terraform state file in a given deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
   configClient.deleteStatefile(name);
 }
 
Parameter
NameDescription
nameDeploymentName

Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

deleteStatefile(String name)

public final void deleteStatefile(String name)

Deletes Terraform state file in a given deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
   configClient.deleteStatefile(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

deleteStatefileCallable()

public final UnaryCallable<DeleteStatefileRequest,Empty> deleteStatefileCallable()

Deletes Terraform state file in a given deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeleteStatefileRequest request =
       DeleteStatefileRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setLockId(338696367)
           .build();
   ApiFuture<Empty> future = configClient.deleteStatefileCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteStatefileRequest,Empty>

exportDeploymentStatefile(ExportDeploymentStatefileRequest request)

public final Statefile exportDeploymentStatefile(ExportDeploymentStatefileRequest request)

Exports Terraform state file from a given deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   ExportDeploymentStatefileRequest request =
       ExportDeploymentStatefileRequest.newBuilder()
           .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setDraft(true)
           .build();
   Statefile response = configClient.exportDeploymentStatefile(request);
 }
 
Parameter
NameDescription
requestExportDeploymentStatefileRequest

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

Returns
TypeDescription
Statefile

exportDeploymentStatefileCallable()

public final UnaryCallable<ExportDeploymentStatefileRequest,Statefile> exportDeploymentStatefileCallable()

Exports Terraform state file from a given deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   ExportDeploymentStatefileRequest request =
       ExportDeploymentStatefileRequest.newBuilder()
           .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setDraft(true)
           .build();
   ApiFuture<Statefile> future =
       configClient.exportDeploymentStatefileCallable().futureCall(request);
   // Do something.
   Statefile response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ExportDeploymentStatefileRequest,Statefile>

exportLockInfo(DeploymentName name)

public final LockInfo exportLockInfo(DeploymentName name)

Exports the lock info on a locked deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
   LockInfo response = configClient.exportLockInfo(name);
 }
 
Parameter
NameDescription
nameDeploymentName

Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
LockInfo

exportLockInfo(ExportLockInfoRequest request)

public final LockInfo exportLockInfo(ExportLockInfoRequest request)

Exports the lock info on a locked deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   ExportLockInfoRequest request =
       ExportLockInfoRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .build();
   LockInfo response = configClient.exportLockInfo(request);
 }
 
Parameter
NameDescription
requestExportLockInfoRequest

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

Returns
TypeDescription
LockInfo

exportLockInfo(String name)

public final LockInfo exportLockInfo(String name)

Exports the lock info on a locked deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
   LockInfo response = configClient.exportLockInfo(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
LockInfo

exportLockInfoCallable()

public final UnaryCallable<ExportLockInfoRequest,LockInfo> exportLockInfoCallable()

Exports the lock info on a locked deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   ExportLockInfoRequest request =
       ExportLockInfoRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .build();
   ApiFuture<LockInfo> future = configClient.exportLockInfoCallable().futureCall(request);
   // Do something.
   LockInfo response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ExportLockInfoRequest,LockInfo>

exportRevisionStatefile(ExportRevisionStatefileRequest request)

public final Statefile exportRevisionStatefile(ExportRevisionStatefileRequest request)

Exports Terraform state file from a given revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   ExportRevisionStatefileRequest request =
       ExportRevisionStatefileRequest.newBuilder()
           .setParent(
               RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
                   .toString())
           .build();
   Statefile response = configClient.exportRevisionStatefile(request);
 }
 
Parameter
NameDescription
requestExportRevisionStatefileRequest

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

Returns
TypeDescription
Statefile

exportRevisionStatefileCallable()

public final UnaryCallable<ExportRevisionStatefileRequest,Statefile> exportRevisionStatefileCallable()

Exports Terraform state file from a given revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   ExportRevisionStatefileRequest request =
       ExportRevisionStatefileRequest.newBuilder()
           .setParent(
               RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
                   .toString())
           .build();
   ApiFuture<Statefile> future =
       configClient.exportRevisionStatefileCallable().futureCall(request);
   // Do something.
   Statefile response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ExportRevisionStatefileRequest,Statefile>

getDeployment(DeploymentName name)

public final Deployment getDeployment(DeploymentName name)

Gets details about a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
   Deployment response = configClient.getDeployment(name);
 }
 
Parameter
NameDescription
nameDeploymentName

Required. The name of the deployment. Format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
Deployment

getDeployment(GetDeploymentRequest request)

public final Deployment getDeployment(GetDeploymentRequest request)

Gets details about a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   GetDeploymentRequest request =
       GetDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .build();
   Deployment response = configClient.getDeployment(request);
 }
 
Parameter
NameDescription
requestGetDeploymentRequest

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

Returns
TypeDescription
Deployment

getDeployment(String name)

public final Deployment getDeployment(String name)

Gets details about a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
   Deployment response = configClient.getDeployment(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the deployment. Format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
Deployment

getDeploymentCallable()

public final UnaryCallable<GetDeploymentRequest,Deployment> getDeploymentCallable()

Gets details about a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   GetDeploymentRequest request =
       GetDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .build();
   ApiFuture<Deployment> future = configClient.getDeploymentCallable().futureCall(request);
   // Do something.
   Deployment response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetDeploymentRequest,Deployment>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

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

Returns
TypeDescription
OperationsClient

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

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 (ConfigClient configClient = ConfigClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = configClient.getIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.GetIamPolicyRequest

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

Returns
TypeDescription
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

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 (ConfigClient configClient = ConfigClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   ApiFuture<Policy> future = configClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigClient configClient = ConfigClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = configClient.getLocation(request);
 }
 
Parameter
NameDescription
requestcom.google.cloud.location.GetLocationRequest

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

Returns
TypeDescription
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigClient configClient = ConfigClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = configClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getOperationsClient()

public final OperationsClient getOperationsClient()

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

Returns
TypeDescription
OperationsClient

getResource(GetResourceRequest request)

public final Resource getResource(GetResourceRequest request)

Gets details about a Resource deployed by Infra Manager.

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 (ConfigClient configClient = ConfigClient.create()) {
   GetResourceRequest request =
       GetResourceRequest.newBuilder()
           .setName(
               ResourceName.of(
                       "[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]", "[RESOURCE]")
                   .toString())
           .build();
   Resource response = configClient.getResource(request);
 }
 
Parameter
NameDescription
requestGetResourceRequest

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

Returns
TypeDescription
Resource

getResource(ResourceName name)

public final Resource getResource(ResourceName name)

Gets details about a Resource deployed by Infra Manager.

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 (ConfigClient configClient = ConfigClient.create()) {
   ResourceName name =
       ResourceName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]", "[RESOURCE]");
   Resource response = configClient.getResource(name);
 }
 
Parameter
NameDescription
nameResourceName

Required. The name of the Resource in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.

Returns
TypeDescription
Resource

getResource(String name)

public final Resource getResource(String name)

Gets details about a Resource deployed by Infra Manager.

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 (ConfigClient configClient = ConfigClient.create()) {
   String name =
       ResourceName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]", "[RESOURCE]")
           .toString();
   Resource response = configClient.getResource(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the Resource in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.

Returns
TypeDescription
Resource

getResourceCallable()

public final UnaryCallable<GetResourceRequest,Resource> getResourceCallable()

Gets details about a Resource deployed by Infra Manager.

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 (ConfigClient configClient = ConfigClient.create()) {
   GetResourceRequest request =
       GetResourceRequest.newBuilder()
           .setName(
               ResourceName.of(
                       "[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]", "[RESOURCE]")
                   .toString())
           .build();
   ApiFuture<Resource> future = configClient.getResourceCallable().futureCall(request);
   // Do something.
   Resource response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetResourceRequest,Resource>

getRevision(GetRevisionRequest request)

public final Revision getRevision(GetRevisionRequest request)

Gets details about a Revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   GetRevisionRequest request =
       GetRevisionRequest.newBuilder()
           .setName(
               RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
                   .toString())
           .build();
   Revision response = configClient.getRevision(request);
 }
 
Parameter
NameDescription
requestGetRevisionRequest

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

Returns
TypeDescription
Revision

getRevision(RevisionName name)

public final Revision getRevision(RevisionName name)

Gets details about a Revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   RevisionName name = RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]");
   Revision response = configClient.getRevision(name);
 }
 
Parameter
NameDescription
nameRevisionName

Required. The name of the Revision in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.

Returns
TypeDescription
Revision

getRevision(String name)

public final Revision getRevision(String name)

Gets details about a Revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   String name =
       RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]").toString();
   Revision response = configClient.getRevision(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the Revision in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.

Returns
TypeDescription
Revision

getRevisionCallable()

public final UnaryCallable<GetRevisionRequest,Revision> getRevisionCallable()

Gets details about a Revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   GetRevisionRequest request =
       GetRevisionRequest.newBuilder()
           .setName(
               RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
                   .toString())
           .build();
   ApiFuture<Revision> future = configClient.getRevisionCallable().futureCall(request);
   // Do something.
   Revision response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetRevisionRequest,Revision>

getSettings()

public final ConfigSettings getSettings()
Returns
TypeDescription
ConfigSettings

getStub()

public ConfigStub getStub()
Returns
TypeDescription
ConfigStub

importStatefile(DeploymentName parent, long lockId)

public final Statefile importStatefile(DeploymentName parent, long lockId)

Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeploymentName parent = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
   long lockId = 338696367;
   Statefile response = configClient.importStatefile(parent, lockId);
 }
 
Parameters
NameDescription
parentDeploymentName

Required. The parent in whose context the statefile is listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

lockIdlong

Required. Lock ID of the lock file to verify that the user who is importing the state file previously locked the Deployment.

Returns
TypeDescription
Statefile

importStatefile(ImportStatefileRequest request)

public final Statefile importStatefile(ImportStatefileRequest request)

Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.

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 (ConfigClient configClient = ConfigClient.create()) {
   ImportStatefileRequest request =
       ImportStatefileRequest.newBuilder()
           .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setLockId(338696367)
           .setSkipDraft(true)
           .build();
   Statefile response = configClient.importStatefile(request);
 }
 
Parameter
NameDescription
requestImportStatefileRequest

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

Returns
TypeDescription
Statefile

importStatefile(String parent, long lockId)

public final Statefile importStatefile(String parent, long lockId)

Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.

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 (ConfigClient configClient = ConfigClient.create()) {
   String parent = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
   long lockId = 338696367;
   Statefile response = configClient.importStatefile(parent, lockId);
 }
 
Parameters
NameDescription
parentString

Required. The parent in whose context the statefile is listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

lockIdlong

Required. Lock ID of the lock file to verify that the user who is importing the state file previously locked the Deployment.

Returns
TypeDescription
Statefile

importStatefileCallable()

public final UnaryCallable<ImportStatefileRequest,Statefile> importStatefileCallable()

Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.

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 (ConfigClient configClient = ConfigClient.create()) {
   ImportStatefileRequest request =
       ImportStatefileRequest.newBuilder()
           .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setLockId(338696367)
           .setSkipDraft(true)
           .build();
   ApiFuture<Statefile> future = configClient.importStatefileCallable().futureCall(request);
   // Do something.
   Statefile response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ImportStatefileRequest,Statefile>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listDeployments(ListDeploymentsRequest request)

public final ConfigClient.ListDeploymentsPagedResponse listDeployments(ListDeploymentsRequest request)

Lists Deployments in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigClient configClient = ConfigClient.create()) {
   ListDeploymentsRequest request =
       ListDeploymentsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Deployment element : configClient.listDeployments(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListDeploymentsRequest

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

Returns
TypeDescription
ConfigClient.ListDeploymentsPagedResponse

listDeployments(LocationName parent)

public final ConfigClient.ListDeploymentsPagedResponse listDeployments(LocationName parent)

Lists Deployments in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigClient configClient = ConfigClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Deployment element : configClient.listDeployments(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. The parent in whose context the Deployments are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}'.

Returns
TypeDescription
ConfigClient.ListDeploymentsPagedResponse

listDeployments(String parent)

public final ConfigClient.ListDeploymentsPagedResponse listDeployments(String parent)

Lists Deployments in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigClient configClient = ConfigClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Deployment element : configClient.listDeployments(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent in whose context the Deployments are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}'.

Returns
TypeDescription
ConfigClient.ListDeploymentsPagedResponse

listDeploymentsCallable()

public final UnaryCallable<ListDeploymentsRequest,ListDeploymentsResponse> listDeploymentsCallable()

Lists Deployments in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigClient configClient = ConfigClient.create()) {
   ListDeploymentsRequest request =
       ListDeploymentsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListDeploymentsResponse response = configClient.listDeploymentsCallable().call(request);
     for (Deployment element : response.getDeploymentsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDeploymentsRequest,ListDeploymentsResponse>

listDeploymentsPagedCallable()

public final UnaryCallable<ListDeploymentsRequest,ConfigClient.ListDeploymentsPagedResponse> listDeploymentsPagedCallable()

Lists Deployments in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ConfigClient configClient = ConfigClient.create()) {
   ListDeploymentsRequest request =
       ListDeploymentsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Deployment> future =
       configClient.listDeploymentsPagedCallable().futureCall(request);
   // Do something.
   for (Deployment element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDeploymentsRequest,ListDeploymentsPagedResponse>

listLocations(ListLocationsRequest request)

public final ConfigClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

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 (ConfigClient configClient = ConfigClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : configClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestcom.google.cloud.location.ListLocationsRequest

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

Returns
TypeDescription
ConfigClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

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 (ConfigClient configClient = ConfigClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response = configClient.listLocationsCallable().call(request);
     for (Location element : response.getLocationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,ConfigClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

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 (ConfigClient configClient = ConfigClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future = configClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listResources(ListResourcesRequest request)

public final ConfigClient.ListResourcesPagedResponse listResources(ListResourcesRequest request)

Lists Resources in a given revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   ListResourcesRequest request =
       ListResourcesRequest.newBuilder()
           .setParent(
               RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Resource element : configClient.listResources(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListResourcesRequest

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

Returns
TypeDescription
ConfigClient.ListResourcesPagedResponse

listResources(RevisionName parent)

public final ConfigClient.ListResourcesPagedResponse listResources(RevisionName parent)

Lists Resources in a given revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   RevisionName parent =
       RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]");
   for (Resource element : configClient.listResources(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentRevisionName

Required. The parent in whose context the Resources are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.

Returns
TypeDescription
ConfigClient.ListResourcesPagedResponse

listResources(String parent)

public final ConfigClient.ListResourcesPagedResponse listResources(String parent)

Lists Resources in a given revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   String parent =
       RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]").toString();
   for (Resource element : configClient.listResources(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent in whose context the Resources are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.

Returns
TypeDescription
ConfigClient.ListResourcesPagedResponse

listResourcesCallable()

public final UnaryCallable<ListResourcesRequest,ListResourcesResponse> listResourcesCallable()

Lists Resources in a given revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   ListResourcesRequest request =
       ListResourcesRequest.newBuilder()
           .setParent(
               RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListResourcesResponse response = configClient.listResourcesCallable().call(request);
     for (Resource element : response.getResourcesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListResourcesRequest,ListResourcesResponse>

listResourcesPagedCallable()

public final UnaryCallable<ListResourcesRequest,ConfigClient.ListResourcesPagedResponse> listResourcesPagedCallable()

Lists Resources in a given revision.

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 (ConfigClient configClient = ConfigClient.create()) {
   ListResourcesRequest request =
       ListResourcesRequest.newBuilder()
           .setParent(
               RevisionName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]", "[REVISION]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Resource> future = configClient.listResourcesPagedCallable().futureCall(request);
   // Do something.
   for (Resource element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListResourcesRequest,ListResourcesPagedResponse>

listRevisions(DeploymentName parent)

public final ConfigClient.ListRevisionsPagedResponse listRevisions(DeploymentName parent)

Lists Revisions of a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeploymentName parent = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
   for (Revision element : configClient.listRevisions(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentDeploymentName

Required. The parent in whose context the Revisions are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
ConfigClient.ListRevisionsPagedResponse

listRevisions(ListRevisionsRequest request)

public final ConfigClient.ListRevisionsPagedResponse listRevisions(ListRevisionsRequest request)

Lists Revisions of a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   ListRevisionsRequest request =
       ListRevisionsRequest.newBuilder()
           .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Revision element : configClient.listRevisions(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListRevisionsRequest

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

Returns
TypeDescription
ConfigClient.ListRevisionsPagedResponse

listRevisions(String parent)

public final ConfigClient.ListRevisionsPagedResponse listRevisions(String parent)

Lists Revisions of a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   String parent = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
   for (Revision element : configClient.listRevisions(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent in whose context the Revisions are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
ConfigClient.ListRevisionsPagedResponse

listRevisionsCallable()

public final UnaryCallable<ListRevisionsRequest,ListRevisionsResponse> listRevisionsCallable()

Lists Revisions of a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   ListRevisionsRequest request =
       ListRevisionsRequest.newBuilder()
           .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListRevisionsResponse response = configClient.listRevisionsCallable().call(request);
     for (Revision element : response.getRevisionsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListRevisionsRequest,ListRevisionsResponse>

listRevisionsPagedCallable()

public final UnaryCallable<ListRevisionsRequest,ConfigClient.ListRevisionsPagedResponse> listRevisionsPagedCallable()

Lists Revisions of a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   ListRevisionsRequest request =
       ListRevisionsRequest.newBuilder()
           .setParent(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Revision> future = configClient.listRevisionsPagedCallable().futureCall(request);
   // Do something.
   for (Revision element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListRevisionsRequest,ListRevisionsPagedResponse>

lockDeploymentAsync(DeploymentName name)

public final OperationFuture<Deployment,OperationMetadata> lockDeploymentAsync(DeploymentName name)

Locks a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
   Deployment response = configClient.lockDeploymentAsync(name).get();
 }
 
Parameter
NameDescription
nameDeploymentName

Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

lockDeploymentAsync(LockDeploymentRequest request)

public final OperationFuture<Deployment,OperationMetadata> lockDeploymentAsync(LockDeploymentRequest request)

Locks a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   LockDeploymentRequest request =
       LockDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .build();
   Deployment response = configClient.lockDeploymentAsync(request).get();
 }
 
Parameter
NameDescription
requestLockDeploymentRequest

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

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

lockDeploymentAsync(String name)

public final OperationFuture<Deployment,OperationMetadata> lockDeploymentAsync(String name)

Locks a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
   Deployment response = configClient.lockDeploymentAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

lockDeploymentCallable()

public final UnaryCallable<LockDeploymentRequest,Operation> lockDeploymentCallable()

Locks a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   LockDeploymentRequest request =
       LockDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .build();
   ApiFuture<Operation> future = configClient.lockDeploymentCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<LockDeploymentRequest,Operation>

lockDeploymentOperationCallable()

public final OperationCallable<LockDeploymentRequest,Deployment,OperationMetadata> lockDeploymentOperationCallable()

Locks a deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   LockDeploymentRequest request =
       LockDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .build();
   OperationFuture<Deployment, OperationMetadata> future =
       configClient.lockDeploymentOperationCallable().futureCall(request);
   // Do something.
   Deployment response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<LockDeploymentRequest,Deployment,OperationMetadata>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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 (ConfigClient configClient = ConfigClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Policy response = configClient.setIamPolicy(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.SetIamPolicyRequest

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

Returns
TypeDescription
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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 (ConfigClient configClient = ConfigClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Policy> future = configClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

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.

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 (ConfigClient configClient = ConfigClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   TestIamPermissionsResponse response = configClient.testIamPermissions(request);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.TestIamPermissionsRequest

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

Returns
TypeDescription
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

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.

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 (ConfigClient configClient = ConfigClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture<TestIamPermissionsResponse> future =
       configClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestIamPermissionsResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

unlockDeploymentAsync(DeploymentName name, long lockId)

public final OperationFuture<Deployment,OperationMetadata> unlockDeploymentAsync(DeploymentName name, long lockId)

Unlocks a locked deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   DeploymentName name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]");
   long lockId = 338696367;
   Deployment response = configClient.unlockDeploymentAsync(name, lockId).get();
 }
 
Parameters
NameDescription
nameDeploymentName

Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

lockIdlong

Required. Lock ID of the lock file to be unlocked.

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

unlockDeploymentAsync(UnlockDeploymentRequest request)

public final OperationFuture<Deployment,OperationMetadata> unlockDeploymentAsync(UnlockDeploymentRequest request)

Unlocks a locked deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   UnlockDeploymentRequest request =
       UnlockDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setLockId(338696367)
           .build();
   Deployment response = configClient.unlockDeploymentAsync(request).get();
 }
 
Parameter
NameDescription
requestUnlockDeploymentRequest

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

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

unlockDeploymentAsync(String name, long lockId)

public final OperationFuture<Deployment,OperationMetadata> unlockDeploymentAsync(String name, long lockId)

Unlocks a locked deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   String name = DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString();
   long lockId = 338696367;
   Deployment response = configClient.unlockDeploymentAsync(name, lockId).get();
 }
 
Parameters
NameDescription
nameString

Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

lockIdlong

Required. Lock ID of the lock file to be unlocked.

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

unlockDeploymentCallable()

public final UnaryCallable<UnlockDeploymentRequest,Operation> unlockDeploymentCallable()

Unlocks a locked deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   UnlockDeploymentRequest request =
       UnlockDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setLockId(338696367)
           .build();
   ApiFuture<Operation> future = configClient.unlockDeploymentCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UnlockDeploymentRequest,Operation>

unlockDeploymentOperationCallable()

public final OperationCallable<UnlockDeploymentRequest,Deployment,OperationMetadata> unlockDeploymentOperationCallable()

Unlocks a locked deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   UnlockDeploymentRequest request =
       UnlockDeploymentRequest.newBuilder()
           .setName(DeploymentName.of("[PROJECT]", "[LOCATION]", "[DEPLOYMENT]").toString())
           .setLockId(338696367)
           .build();
   OperationFuture<Deployment, OperationMetadata> future =
       configClient.unlockDeploymentOperationCallable().futureCall(request);
   // Do something.
   Deployment response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UnlockDeploymentRequest,Deployment,OperationMetadata>

updateDeploymentAsync(Deployment deployment, FieldMask updateMask)

public final OperationFuture<Deployment,OperationMetadata> updateDeploymentAsync(Deployment deployment, FieldMask updateMask)

Updates a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   Deployment deployment = Deployment.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Deployment response = configClient.updateDeploymentAsync(deployment, updateMask).get();
 }
 
Parameters
NameDescription
deploymentDeployment

Required. Deployment to update.

The deployment's name field is used to identify the resource to be updated. Format: projects/{project}/locations/{location}/deployments/{deployment}

updateMaskFieldMask

Optional. Field mask used to specify the fields to be overwritten in the Deployment resource by the update.

The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

updateDeploymentAsync(UpdateDeploymentRequest request)

public final OperationFuture<Deployment,OperationMetadata> updateDeploymentAsync(UpdateDeploymentRequest request)

Updates a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   UpdateDeploymentRequest request =
       UpdateDeploymentRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDeployment(Deployment.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Deployment response = configClient.updateDeploymentAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateDeploymentRequest

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

Returns
TypeDescription
OperationFuture<Deployment,OperationMetadata>

updateDeploymentCallable()

public final UnaryCallable<UpdateDeploymentRequest,Operation> updateDeploymentCallable()

Updates a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   UpdateDeploymentRequest request =
       UpdateDeploymentRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDeployment(Deployment.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = configClient.updateDeploymentCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateDeploymentRequest,Operation>

updateDeploymentOperationCallable()

public final OperationCallable<UpdateDeploymentRequest,Deployment,OperationMetadata> updateDeploymentOperationCallable()

Updates a Deployment.

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 (ConfigClient configClient = ConfigClient.create()) {
   UpdateDeploymentRequest request =
       UpdateDeploymentRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setDeployment(Deployment.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Deployment, OperationMetadata> future =
       configClient.updateDeploymentOperationCallable().futureCall(request);
   // Do something.
   Deployment response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UpdateDeploymentRequest,Deployment,OperationMetadata>