GitHub Repository | Product 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:
- 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.
- 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.
- 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.
Static Methods
create()
public static final ConfigClient create()
Constructs an instance of ConfigClient with default settings.
Returns | |
---|---|
Type | Description |
ConfigClient |
Exceptions | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
settings | ConfigSettings |
Returns | |
---|---|
Type | Description |
ConfigClient |
Exceptions | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
stub | ConfigStub |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
settings | ConfigSettings |
ConfigClient(ConfigStub stub)
protected ConfigClient(ConfigStub stub)
Parameter | |
---|---|
Name | Description |
stub | ConfigStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration | long |
unit | TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
close()
public final void close()
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 | |
---|---|
Name | Description |
request | CreateDeploymentRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | LocationName Required. The parent in whose context the Deployment is created. The parent value is in the format: 'projects/{project_id}/locations/{location}'. |
deployment | Deployment Required. Deployment resource to be created. |
deploymentId | String Required. The Deployment ID. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | String Required. The parent in whose context the Deployment is created. The parent value is in the format: 'projects/{project_id}/locations/{location}'. |
deployment | Deployment Required. Deployment resource to be created. |
deploymentId | String Required. The Deployment ID. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | DeleteDeploymentRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | DeploymentName Required. The name of the Deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. The name of the Deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | DeleteStatefileRequest 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 | |
---|---|
Name | Description |
name | DeploymentName 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 | |
---|---|
Name | Description |
name | String 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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | ExportDeploymentStatefileRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | DeploymentName Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | ExportLockInfoRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | ExportRevisionStatefileRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | DeploymentName Required. The name of the deployment. Format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | GetDeploymentRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. The name of the deployment. Format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | com.google.iam.v1.GetIamPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | com.google.cloud.location.GetLocationRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
com.google.cloud.location.Location |
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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 | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
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 | |
---|---|
Name | Description |
request | GetResourceRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | ResourceName Required. The name of the Resource in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. The name of the Resource in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | GetRevisionRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | RevisionName Required. The name of the Revision in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. The name of the Revision in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
UnaryCallable<GetRevisionRequest,Revision> |
getSettings()
public final ConfigSettings getSettings()
Returns | |
---|---|
Type | Description |
ConfigSettings |
getStub()
public ConfigStub getStub()
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | DeploymentName Required. The parent in whose context the statefile is listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
lockId | long Required. Lock ID of the lock file to verify that the user who is importing the state file previously locked the Deployment. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | ImportStatefileRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | String Required. The parent in whose context the statefile is listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
lockId | long Required. Lock ID of the lock file to verify that the user who is importing the state file previously locked the Deployment. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
UnaryCallable<ImportStatefileRequest,Statefile> |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | ListDeploymentsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | LocationName Required. The parent in whose context the Deployments are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | String Required. The parent in whose context the Deployments are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | com.google.cloud.location.ListLocationsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | ListResourcesRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | RevisionName 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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | String 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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | DeploymentName 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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | ListRevisionsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | String 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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | DeploymentName Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | LockDeploymentRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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_DENIED
errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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 | |
---|---|
Name | Description |
request | com.google.iam.v1.SetIamPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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_DENIED
errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | com.google.iam.v1.TestIamPermissionsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | DeploymentName Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
lockId | long Required. Lock ID of the lock file to be unlocked. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | UnlockDeploymentRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. The name of the deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'. |
lockId | long Required. Lock ID of the lock file to be unlocked. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
deployment | Deployment Required. Deployment to update. The deployment's |
updateMask | FieldMask 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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | UpdateDeploymentRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
OperationCallable<UpdateDeploymentRequest,Deployment,OperationMetadata> |