Class ClusterManagerClient (2.5.2)

public class ClusterManagerClient implements BackgroundResource

Service Description: Google Kubernetes Engine Cluster Manager v1

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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String parent = "parent-995424086";
   ListClustersResponse response = clusterManagerClient.listClusters(parent);
 }
 

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

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

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of ClusterManagerSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 ClusterManagerSettings clusterManagerSettings =
     ClusterManagerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ClusterManagerClient clusterManagerClient = ClusterManagerClient.create(clusterManagerSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 ClusterManagerSettings clusterManagerSettings =
     ClusterManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
 ClusterManagerClient clusterManagerClient = ClusterManagerClient.create(clusterManagerSettings);
 

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

Inheritance

java.lang.Object > ClusterManagerClient

Implements

BackgroundResource

Static Methods

create()

public static final ClusterManagerClient create()

Constructs an instance of ClusterManagerClient with default settings.

Returns
TypeDescription
ClusterManagerClient
Exceptions
TypeDescription
IOException

create(ClusterManagerSettings settings)

public static final ClusterManagerClient create(ClusterManagerSettings settings)

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

Parameter
NameDescription
settingsClusterManagerSettings
Returns
TypeDescription
ClusterManagerClient
Exceptions
TypeDescription
IOException

create(ClusterManagerStub stub)

public static final ClusterManagerClient create(ClusterManagerStub stub)

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

Parameter
NameDescription
stubClusterManagerStub
Returns
TypeDescription
ClusterManagerClient

Constructors

ClusterManagerClient(ClusterManagerSettings settings)

protected ClusterManagerClient(ClusterManagerSettings settings)

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

Parameter
NameDescription
settingsClusterManagerSettings

ClusterManagerClient(ClusterManagerStub stub)

protected ClusterManagerClient(ClusterManagerStub stub)
Parameter
NameDescription
stubClusterManagerStub

Methods

awaitTermination(long duration, TimeUnit unit)

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

cancelOperation(CancelOperationRequest request)

public final void cancelOperation(CancelOperationRequest request)

Cancels the specified operation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CancelOperationRequest request =
       CancelOperationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setOperationId("operationId129704162")
           .setName("name3373707")
           .build();
   clusterManagerClient.cancelOperation(request);
 }
 
Parameter
NameDescription
requestCancelOperationRequest

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

cancelOperation(String name)

public final void cancelOperation(String name)

Cancels the specified operation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String name = "name3373707";
   clusterManagerClient.cancelOperation(name);
 }
 
Parameter
NameDescription
nameString

The name (project, location, operation id) of the operation to cancel. Specified in the format projects/*/locations/*/operations/*.

cancelOperation(String projectId, String zone, String operationId)

public final void cancelOperation(String projectId, String zone, String operationId)

Cancels the specified operation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String operationId = "operationId129704162";
   clusterManagerClient.cancelOperation(projectId, zone, operationId);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

zoneString

Deprecated. The name of the Google Compute Engine zone in which the operation resides. This field has been deprecated and replaced by the name field.

operationIdString

Deprecated. The server-assigned name of the operation. This field has been deprecated and replaced by the name field.

cancelOperationCallable()

public final UnaryCallable<CancelOperationRequest,Empty> cancelOperationCallable()

Cancels the specified operation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CancelOperationRequest request =
       CancelOperationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setOperationId("operationId129704162")
           .setName("name3373707")
           .build();
   ApiFuture<Empty> future = clusterManagerClient.cancelOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CancelOperationRequest,Empty>

close()

public final void close()

completeIPRotation(CompleteIPRotationRequest request)

public final Operation completeIPRotation(CompleteIPRotationRequest request)

Completes master IP rotation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CompleteIPRotationRequest request =
       CompleteIPRotationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.completeIPRotation(request);
 }
 
Parameter
NameDescription
requestCompleteIPRotationRequest

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

Returns
TypeDescription
Operation

completeIPRotation(String name)

public final Operation completeIPRotation(String name)

Completes master IP rotation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String name = "name3373707";
   Operation response = clusterManagerClient.completeIPRotation(name);
 }
 
Parameter
NameDescription
nameString

The name (project, location, cluster name) of the cluster to complete IP rotation. Specified in the format projects/*/locations/*/clusters/*.

Returns
TypeDescription
Operation

completeIPRotation(String projectId, String zone, String clusterId)

public final Operation completeIPRotation(String projectId, String zone, String clusterId)

Completes master IP rotation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   Operation response = clusterManagerClient.completeIPRotation(projectId, zone, clusterId);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

zoneString

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterIdString

Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.

Returns
TypeDescription
Operation

completeIPRotationCallable()

public final UnaryCallable<CompleteIPRotationRequest,Operation> completeIPRotationCallable()

Completes master IP rotation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CompleteIPRotationRequest request =
       CompleteIPRotationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.completeIPRotationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CompleteIPRotationRequest,Operation>

completeNodePoolUpgrade(CompleteNodePoolUpgradeRequest request)

public final void completeNodePoolUpgrade(CompleteNodePoolUpgradeRequest request)

CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CompleteNodePoolUpgradeRequest request =
       CompleteNodePoolUpgradeRequest.newBuilder().setName("name3373707").build();
   clusterManagerClient.completeNodePoolUpgrade(request);
 }
 
Parameter
NameDescription
requestCompleteNodePoolUpgradeRequest

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

completeNodePoolUpgradeCallable()

public final UnaryCallable<CompleteNodePoolUpgradeRequest,Empty> completeNodePoolUpgradeCallable()

CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CompleteNodePoolUpgradeRequest request =
       CompleteNodePoolUpgradeRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Empty> future =
       clusterManagerClient.completeNodePoolUpgradeCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CompleteNodePoolUpgradeRequest,Empty>

createCluster(CreateClusterRequest request)

public final Operation createCluster(CreateClusterRequest request)

Creates a cluster, consisting of the specified number and type of Google Compute Engine instances.

By default, the cluster is created in the project's default network.

One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster.

Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CreateClusterRequest request =
       CreateClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setCluster(Cluster.newBuilder().build())
           .setParent("parent-995424086")
           .build();
   Operation response = clusterManagerClient.createCluster(request);
 }
 
Parameter
NameDescription
requestCreateClusterRequest

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

Returns
TypeDescription
Operation

createCluster(String parent, Cluster cluster)

public final Operation createCluster(String parent, Cluster cluster)

Creates a cluster, consisting of the specified number and type of Google Compute Engine instances.

By default, the cluster is created in the project's default network.

One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster.

Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String parent = "parent-995424086";
   Cluster cluster = Cluster.newBuilder().build();
   Operation response = clusterManagerClient.createCluster(parent, cluster);
 }
 
Parameters
NameDescription
parentString

The parent (project and location) where the cluster will be created. Specified in the format projects/*/locations/*.

clusterCluster

Required. A cluster resource

Returns
TypeDescription
Operation

createCluster(String projectId, String zone, Cluster cluster)

public final Operation createCluster(String projectId, String zone, Cluster cluster)

Creates a cluster, consisting of the specified number and type of Google Compute Engine instances.

By default, the cluster is created in the project's default network.

One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster.

Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   Cluster cluster = Cluster.newBuilder().build();
   Operation response = clusterManagerClient.createCluster(projectId, zone, cluster);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field.

zoneString

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.

clusterCluster

Required. A cluster resource

Returns
TypeDescription
Operation

createClusterCallable()

public final UnaryCallable<CreateClusterRequest,Operation> createClusterCallable()

Creates a cluster, consisting of the specified number and type of Google Compute Engine instances.

By default, the cluster is created in the project's default network.

One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster.

Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CreateClusterRequest request =
       CreateClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setCluster(Cluster.newBuilder().build())
           .setParent("parent-995424086")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.createClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateClusterRequest,Operation>

createNodePool(CreateNodePoolRequest request)

public final Operation createNodePool(CreateNodePoolRequest request)

Creates a node pool for a cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CreateNodePoolRequest request =
       CreateNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePool(NodePool.newBuilder().build())
           .setParent("parent-995424086")
           .build();
   Operation response = clusterManagerClient.createNodePool(request);
 }
 
Parameter
NameDescription
requestCreateNodePoolRequest

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

Returns
TypeDescription
Operation

createNodePool(String parent, NodePool nodePool)

public final Operation createNodePool(String parent, NodePool nodePool)

Creates a node pool for a cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String parent = "parent-995424086";
   NodePool nodePool = NodePool.newBuilder().build();
   Operation response = clusterManagerClient.createNodePool(parent, nodePool);
 }
 
Parameters
NameDescription
parentString

The parent (project, location, cluster name) where the node pool will be created. Specified in the format projects/*/locations/*/clusters/*.

nodePoolNodePool

Required. The node pool to create.

Returns
TypeDescription
Operation

createNodePool(String projectId, String zone, String clusterId, NodePool nodePool)

public final Operation createNodePool(String projectId, String zone, String clusterId, NodePool nodePool)

Creates a node pool for a cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   NodePool nodePool = NodePool.newBuilder().build();
   Operation response =
       clusterManagerClient.createNodePool(projectId, zone, clusterId, nodePool);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field.

zoneString

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.

clusterIdString

Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field.

nodePoolNodePool

Required. The node pool to create.

Returns
TypeDescription
Operation

createNodePoolCallable()

public final UnaryCallable<CreateNodePoolRequest,Operation> createNodePoolCallable()

Creates a node pool for a cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CreateNodePoolRequest request =
       CreateNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePool(NodePool.newBuilder().build())
           .setParent("parent-995424086")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.createNodePoolCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateNodePoolRequest,Operation>

deleteCluster(DeleteClusterRequest request)

public final Operation deleteCluster(DeleteClusterRequest request)

Deletes the cluster, including the Kubernetes endpoint and all worker nodes.

Firewalls and routes that were configured during cluster creation are also deleted.

Other Google Compute Engine resources that might be in use by the cluster, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   DeleteClusterRequest request =
       DeleteClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.deleteCluster(request);
 }
 
Parameter
NameDescription
requestDeleteClusterRequest

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

Returns
TypeDescription
Operation

deleteCluster(String name)

public final Operation deleteCluster(String name)

Deletes the cluster, including the Kubernetes endpoint and all worker nodes.

Firewalls and routes that were configured during cluster creation are also deleted.

Other Google Compute Engine resources that might be in use by the cluster, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String name = "name3373707";
   Operation response = clusterManagerClient.deleteCluster(name);
 }
 
Parameter
NameDescription
nameString

The name (project, location, cluster) of the cluster to delete. Specified in the format projects/*/locations/*/clusters/*.

Returns
TypeDescription
Operation

deleteCluster(String projectId, String zone, String clusterId)

public final Operation deleteCluster(String projectId, String zone, String clusterId)

Deletes the cluster, including the Kubernetes endpoint and all worker nodes.

Firewalls and routes that were configured during cluster creation are also deleted.

Other Google Compute Engine resources that might be in use by the cluster, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   Operation response = clusterManagerClient.deleteCluster(projectId, zone, clusterId);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

zoneString

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterIdString

Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field.

Returns
TypeDescription
Operation

deleteClusterCallable()

public final UnaryCallable<DeleteClusterRequest,Operation> deleteClusterCallable()

Deletes the cluster, including the Kubernetes endpoint and all worker nodes.

Firewalls and routes that were configured during cluster creation are also deleted.

Other Google Compute Engine resources that might be in use by the cluster, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   DeleteClusterRequest request =
       DeleteClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.deleteClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteClusterRequest,Operation>

deleteNodePool(DeleteNodePoolRequest request)

public final Operation deleteNodePool(DeleteNodePoolRequest request)

Deletes a node pool from a cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   DeleteNodePoolRequest request =
       DeleteNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.deleteNodePool(request);
 }
 
Parameter
NameDescription
requestDeleteNodePoolRequest

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

Returns
TypeDescription
Operation

deleteNodePool(String name)

public final Operation deleteNodePool(String name)

Deletes a node pool from a cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String name = "name3373707";
   Operation response = clusterManagerClient.deleteNodePool(name);
 }
 
Parameter
NameDescription
nameString

The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

Returns
TypeDescription
Operation

deleteNodePool(String projectId, String zone, String clusterId, String nodePoolId)

public final Operation deleteNodePool(String projectId, String zone, String clusterId, String nodePoolId)

Deletes a node pool from a cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   String nodePoolId = "nodePoolId1121557241";
   Operation response =
       clusterManagerClient.deleteNodePool(projectId, zone, clusterId, nodePoolId);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

zoneString

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterIdString

Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.

nodePoolIdString

Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field.

Returns
TypeDescription
Operation

deleteNodePoolCallable()

public final UnaryCallable<DeleteNodePoolRequest,Operation> deleteNodePoolCallable()

Deletes a node pool from a cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   DeleteNodePoolRequest request =
       DeleteNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.deleteNodePoolCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteNodePoolRequest,Operation>

getCluster(GetClusterRequest request)

public final Cluster getCluster(GetClusterRequest request)

Gets the details of a specific cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetClusterRequest request =
       GetClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   Cluster response = clusterManagerClient.getCluster(request);
 }
 
Parameter
NameDescription
requestGetClusterRequest

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

Returns
TypeDescription
Cluster

getCluster(String name)

public final Cluster getCluster(String name)

Gets the details of a specific cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String name = "name3373707";
   Cluster response = clusterManagerClient.getCluster(name);
 }
 
Parameter
NameDescription
nameString

The name (project, location, cluster) of the cluster to retrieve. Specified in the format projects/*/locations/*/clusters/*.

Returns
TypeDescription
Cluster

getCluster(String projectId, String zone, String clusterId)

public final Cluster getCluster(String projectId, String zone, String clusterId)

Gets the details of a specific cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   Cluster response = clusterManagerClient.getCluster(projectId, zone, clusterId);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

zoneString

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterIdString

Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field.

Returns
TypeDescription
Cluster

getClusterCallable()

public final UnaryCallable<GetClusterRequest,Cluster> getClusterCallable()

Gets the details of a specific cluster.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetClusterRequest request =
       GetClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   ApiFuture<Cluster> future = clusterManagerClient.getClusterCallable().futureCall(request);
   // Do something.
   Cluster response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetClusterRequest,Cluster>

getJSONWebKeys(GetJSONWebKeysRequest request)

public final GetJSONWebKeysResponse getJSONWebKeys(GetJSONWebKeysRequest request)

Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetJSONWebKeysRequest request =
       GetJSONWebKeysRequest.newBuilder().setParent("parent-995424086").build();
   GetJSONWebKeysResponse response = clusterManagerClient.getJSONWebKeys(request);
 }
 
Parameter
NameDescription
requestGetJSONWebKeysRequest

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

Returns
TypeDescription
GetJSONWebKeysResponse

getJSONWebKeysCallable()

public final UnaryCallable<GetJSONWebKeysRequest,GetJSONWebKeysResponse> getJSONWebKeysCallable()

Gets the public component of the cluster signing keys in JSON Web Key format. This API is not yet intended for general use, and is not available for all clusters.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetJSONWebKeysRequest request =
       GetJSONWebKeysRequest.newBuilder().setParent("parent-995424086").build();
   ApiFuture<GetJSONWebKeysResponse> future =
       clusterManagerClient.getJSONWebKeysCallable().futureCall(request);
   // Do something.
   GetJSONWebKeysResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetJSONWebKeysRequest,GetJSONWebKeysResponse>

getNodePool(GetNodePoolRequest request)

public final NodePool getNodePool(GetNodePoolRequest request)

Retrieves the requested node pool.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetNodePoolRequest request =
       GetNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .build();
   NodePool response = clusterManagerClient.getNodePool(request);
 }
 
Parameter
NameDescription
requestGetNodePoolRequest

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

Returns
TypeDescription
NodePool

getNodePool(String name)

public final NodePool getNodePool(String name)

Retrieves the requested node pool.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String name = "name3373707";
   NodePool response = clusterManagerClient.getNodePool(name);
 }
 
Parameter
NameDescription
nameString

The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

Returns
TypeDescription
NodePool

getNodePool(String projectId, String zone, String clusterId, String nodePoolId)

public final NodePool getNodePool(String projectId, String zone, String clusterId, String nodePoolId)

Retrieves the requested node pool.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   String nodePoolId = "nodePoolId1121557241";
   NodePool response = clusterManagerClient.getNodePool(projectId, zone, clusterId, nodePoolId);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

zoneString

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterIdString

Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.

nodePoolIdString

Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field.

Returns
TypeDescription
NodePool

getNodePoolCallable()

public final UnaryCallable<GetNodePoolRequest,NodePool> getNodePoolCallable()

Retrieves the requested node pool.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetNodePoolRequest request =
       GetNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .build();
   ApiFuture<NodePool> future = clusterManagerClient.getNodePoolCallable().futureCall(request);
   // Do something.
   NodePool response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetNodePoolRequest,NodePool>

getOperation(GetOperationRequest request)

public final Operation getOperation(GetOperationRequest request)

Gets the specified operation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetOperationRequest request =
       GetOperationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setOperationId("operationId129704162")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.getOperation(request);
 }
 
Parameter
NameDescription
requestGetOperationRequest

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

Returns
TypeDescription
Operation

getOperation(String name)

public final Operation getOperation(String name)

Gets the specified operation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String name = "name3373707";
   Operation response = clusterManagerClient.getOperation(name);
 }
 
Parameter
NameDescription
nameString

The name (project, location, operation id) of the operation to get. Specified in the format projects/*/locations/*/operations/*.

Returns
TypeDescription
Operation

getOperation(String projectId, String zone, String operationId)

public final Operation getOperation(String projectId, String zone, String operationId)

Gets the specified operation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String operationId = "operationId129704162";
   Operation response = clusterManagerClient.getOperation(projectId, zone, operationId);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

zoneString

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

operationIdString

Deprecated. The server-assigned name of the operation. This field has been deprecated and replaced by the name field.

Returns
TypeDescription
Operation

getOperationCallable()

public final UnaryCallable<GetOperationRequest,Operation> getOperationCallable()

Gets the specified operation.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetOperationRequest request =
       GetOperationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setOperationId("operationId129704162")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future = clusterManagerClient.getOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetOperationRequest,Operation>

getServerConfig(GetServerConfigRequest request)

public final ServerConfig getServerConfig(GetServerConfigRequest request)

Returns configuration info about the Google Kubernetes Engine service.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetServerConfigRequest request =
       GetServerConfigRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setName("name3373707")
           .build();
   ServerConfig response = clusterManagerClient.getServerConfig(request);
 }
 
Parameter
NameDescription
requestGetServerConfigRequest

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

Returns
TypeDescription
ServerConfig

getServerConfig(String name)

public final ServerConfig getServerConfig(String name)

Returns configuration info about the Google Kubernetes Engine service.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String name = "name3373707";
   ServerConfig response = clusterManagerClient.getServerConfig(name);
 }
 
Parameter
NameDescription
nameString

The name (project and location) of the server config to get, specified in the format projects/*/locations/*.

Returns
TypeDescription
ServerConfig

getServerConfig(String projectId, String zone)

public final ServerConfig getServerConfig(String projectId, String zone)

Returns configuration info about the Google Kubernetes Engine service.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   ServerConfig response = clusterManagerClient.getServerConfig(projectId, zone);
 }
 
Parameters
NameDescription
projectIdString

Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

zoneString

Deprecated. The name of the Google Compute Engine zone to return operations for. This field has been deprecated and replaced by the name field.

Returns
TypeDescription
ServerConfig

getServerConfigCallable()

public final UnaryCallable<GetServerConfigRequest,ServerConfig> getServerConfigCallable()

Returns configuration info about the Google Kubernetes Engine service.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetServerConfigRequest request =
       GetServerConfigRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setName("name3373707")
           .build();
   ApiFuture<ServerConfig> future =
       clusterManagerClient.getServerConfigCallable().futureCall(request);
   // Do something.
   ServerConfig response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetServerConfigRequest,ServerConfig>

getSettings()

public final ClusterManagerSettings getSettings()
Returns
TypeDescription
ClusterManagerSettings

getStub()

public ClusterManagerStub getStub()
Returns
TypeDescription
ClusterManagerStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listClusters(ListClustersRequest request)

public final ListClustersResponse listClusters(ListClustersRequest request)

Lists all clusters owned by a project in either the specified zone or all zones.

Sample code:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListClustersRequest request =
       ListClustersRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setParent("parent-995424086")
           .build();
   ListClustersResponse response = clusterManagerClient.listClusters(request);
 }
 
Parameter
NameDescription
requestListClustersRequest

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

Returns