public class ClusterManagerClient implements BackgroundResource
Service Description: Google Kubernetes Engine Cluster Manager v1beta1
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:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
ListClustersResponse response = clusterManagerClient.listClusters(projectId, zone);
}
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:
- 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 ClusterManagerSettings to create(). For example:
To customize credentials:
ClusterManagerSettings clusterManagerSettings =
ClusterManagerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ClusterManagerClient clusterManagerClient = ClusterManagerClient.create(clusterManagerSettings);
To customize the endpoint:
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.
Implements
BackgroundResourceStatic Methods
create()
public static final ClusterManagerClient create()
Constructs an instance of ClusterManagerClient with default settings.
Type | Description |
ClusterManagerClient |
Type | Description |
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.
Name | Description |
settings | ClusterManagerSettings |
Type | Description |
ClusterManagerClient |
Type | Description |
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).
Name | Description |
stub | ClusterManagerStub |
Type | Description |
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.
Name | Description |
settings | ClusterManagerSettings |
ClusterManagerClient(ClusterManagerStub stub)
protected ClusterManagerClient(ClusterManagerStub stub)
Name | Description |
stub | ClusterManagerStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
cancelOperation(CancelOperationRequest request)
public final void cancelOperation(CancelOperationRequest request)
Cancels the specified operation.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
CancelOperationRequest request =
CancelOperationRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setOperationId("operationId129704162")
.setName("name3373707")
.build();
clusterManagerClient.cancelOperation(request);
}
Name | Description |
request | CancelOperationRequest The request object containing all of the parameters for the API call. |
cancelOperation(String projectId, String zone, String operationId)
public final void cancelOperation(String projectId, String zone, String operationId)
Cancels the specified operation.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
String operationId = "operationId129704162";
clusterManagerClient.cancelOperation(projectId, zone, operationId);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. 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. |
operationId | String Required. Deprecated. The server-assigned |
cancelOperationCallable()
public final UnaryCallable<CancelOperationRequest,Empty> cancelOperationCallable()
Cancels the specified operation.
Sample code:
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();
}
Type | Description |
UnaryCallable<CancelOperationRequest,Empty> |
close()
public final void close()
completeIPRotation(CompleteIPRotationRequest request)
public final Operation completeIPRotation(CompleteIPRotationRequest request)
Completes master IP rotation.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
CompleteIPRotationRequest request =
CompleteIPRotationRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setClusterId("clusterId561939637")
.setName("name3373707")
.build();
Operation response = clusterManagerClient.completeIPRotation(request);
}
Name | Description |
request | CompleteIPRotationRequest The request object containing all of the parameters for the API call. |
Type | Description |
Operation |
completeIPRotation(String projectId, String zone, String clusterId)
public final Operation completeIPRotation(String projectId, String zone, String clusterId)
Completes master IP rotation.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
String clusterId = "clusterId561939637";
Operation response = clusterManagerClient.completeIPRotation(projectId, zone, clusterId);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. 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. |
clusterId | String Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. |
Type | Description |
Operation |
completeIPRotationCallable()
public final UnaryCallable<CompleteIPRotationRequest,Operation> completeIPRotationCallable()
Completes master IP rotation.
Sample code:
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();
}
Type | Description |
UnaryCallable<CompleteIPRotationRequest,Operation> |
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:
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);
}
Name | Description |
request | CreateClusterRequest The request object containing all of the parameters for the API call. |
Type | Description |
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:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
Cluster cluster = Cluster.newBuilder().build();
Operation response = clusterManagerClient.createCluster(projectId, zone, cluster);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field. |
zone | String Required. 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. |
cluster | Cluster Required. A cluster resource |
Type | Description |
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:
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();
}
Type | Description |
UnaryCallable<CreateClusterRequest,Operation> |
createNodePool(CreateNodePoolRequest request)
public final Operation createNodePool(CreateNodePoolRequest request)
Creates a node pool for a cluster.
Sample code:
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);
}
Name | Description |
request | CreateNodePoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
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:
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);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field. |
zone | String Required. 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. |
clusterId | String Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. |
nodePool | NodePool Required. The node pool to create. |
Type | Description |
Operation |
createNodePoolCallable()
public final UnaryCallable<CreateNodePoolRequest,Operation> createNodePoolCallable()
Creates a node pool for a cluster.
Sample code:
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();
}
Type | Description |
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:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
DeleteClusterRequest request =
DeleteClusterRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setClusterId("clusterId561939637")
.setName("name3373707")
.build();
Operation response = clusterManagerClient.deleteCluster(request);
}
Name | Description |
request | DeleteClusterRequest The request object containing all of the parameters for the API call. |
Type | Description |
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:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
String clusterId = "clusterId561939637";
Operation response = clusterManagerClient.deleteCluster(projectId, zone, clusterId);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. 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. |
clusterId | String Required. Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. |
Type | Description |
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:
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();
}
Type | Description |
UnaryCallable<DeleteClusterRequest,Operation> |
deleteNodePool(DeleteNodePoolRequest request)
public final Operation deleteNodePool(DeleteNodePoolRequest request)
Deletes a node pool from a cluster.
Sample code:
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);
}
Name | Description |
request | DeleteNodePoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
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:
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);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. 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. |
clusterId | String Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. |
nodePoolId | String Required. Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. |
Type | Description |
Operation |
deleteNodePoolCallable()
public final UnaryCallable<DeleteNodePoolRequest,Operation> deleteNodePoolCallable()
Deletes a node pool from a cluster.
Sample code:
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();
}
Type | Description |
UnaryCallable<DeleteNodePoolRequest,Operation> |
getCluster(GetClusterRequest request)
public final Cluster getCluster(GetClusterRequest request)
Gets the details for a specific cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
GetClusterRequest request =
GetClusterRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setClusterId("clusterId561939637")
.setName("name3373707")
.build();
Cluster response = clusterManagerClient.getCluster(request);
}
Name | Description |
request | GetClusterRequest The request object containing all of the parameters for the API call. |
Type | Description |
Cluster |
getCluster(String projectId, String zone, String clusterId)
public final Cluster getCluster(String projectId, String zone, String clusterId)
Gets the details for a specific cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
String clusterId = "clusterId561939637";
Cluster response = clusterManagerClient.getCluster(projectId, zone, clusterId);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. 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. |
clusterId | String Required. Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. |
Type | Description |
Cluster |
getClusterCallable()
public final UnaryCallable<GetClusterRequest,Cluster> getClusterCallable()
Gets the details for a specific cluster.
Sample code:
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();
}
Type | Description |
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:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
GetJSONWebKeysRequest request =
GetJSONWebKeysRequest.newBuilder().setParent("parent-995424086").build();
GetJSONWebKeysResponse response = clusterManagerClient.getJSONWebKeys(request);
}
Name | Description |
request | GetJSONWebKeysRequest The request object containing all of the parameters for the API call. |
Type | Description |
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:
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();
}
Type | Description |
UnaryCallable<GetJSONWebKeysRequest,GetJSONWebKeysResponse> |
getNodePool(GetNodePoolRequest request)
public final NodePool getNodePool(GetNodePoolRequest request)
Retrieves the requested node pool.
Sample code:
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);
}
Name | Description |
request | GetNodePoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
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:
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);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. 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. |
clusterId | String Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. |
nodePoolId | String Required. Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. |
Type | Description |
NodePool |
getNodePoolCallable()
public final UnaryCallable<GetNodePoolRequest,NodePool> getNodePoolCallable()
Retrieves the requested node pool.
Sample code:
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();
}
Type | Description |
UnaryCallable<GetNodePoolRequest,NodePool> |
getOperation(GetOperationRequest request)
public final Operation getOperation(GetOperationRequest request)
Gets the specified operation.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
GetOperationRequest request =
GetOperationRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setOperationId("operationId129704162")
.setName("name3373707")
.build();
Operation response = clusterManagerClient.getOperation(request);
}
Name | Description |
request | GetOperationRequest The request object containing all of the parameters for the API call. |
Type | Description |
Operation |
getOperation(String projectId, String zone, String operationId)
public final Operation getOperation(String projectId, String zone, String operationId)
Gets the specified operation.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
String operationId = "operationId129704162";
Operation response = clusterManagerClient.getOperation(projectId, zone, operationId);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. 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. |
operationId | String Required. Deprecated. The server-assigned |
Type | Description |
Operation |
getOperationCallable()
public final UnaryCallable<GetOperationRequest,Operation> getOperationCallable()
Gets the specified operation.
Sample code:
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();
}
Type | Description |
UnaryCallable<GetOperationRequest,Operation> |
getServerConfig(GetServerConfigRequest request)
public final ServerConfig getServerConfig(GetServerConfigRequest request)
Returns configuration info about the Google Kubernetes Engine service.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
GetServerConfigRequest request =
GetServerConfigRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setName("name3373707")
.build();
ServerConfig response = clusterManagerClient.getServerConfig(request);
}
Name | Description |
request | GetServerConfigRequest The request object containing all of the parameters for the API call. |
Type | Description |
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:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
ServerConfig response = clusterManagerClient.getServerConfig(projectId, zone);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. Deprecated. The name of the Google Compute Engine zone to return operations for. This field has been deprecated and replaced by the name field. |
Type | Description |
ServerConfig |
getServerConfigCallable()
public final UnaryCallable<GetServerConfigRequest,ServerConfig> getServerConfigCallable()
Returns configuration info about the Google Kubernetes Engine service.
Sample code:
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();
}
Type | Description |
UnaryCallable<GetServerConfigRequest,ServerConfig> |
getSettings()
public final ClusterManagerSettings getSettings()
Type | Description |
ClusterManagerSettings |
getStub()
public ClusterManagerStub getStub()
Type | Description |
ClusterManagerStub |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
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:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListClustersRequest request =
ListClustersRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setParent("parent-995424086")
.build();
ListClustersResponse response = clusterManagerClient.listClusters(request);
}
Name | Description |
request | ListClustersRequest The request object containing all of the parameters for the API call. |
Type | Description |
ListClustersResponse |
listClusters(String projectId, String zone)
public final ListClustersResponse listClusters(String projectId, String zone)
Lists all clusters owned by a project in either the specified zone or all zones.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
ListClustersResponse response = clusterManagerClient.listClusters(projectId, zone);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field. |
zone | String Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. |
Type | Description |
ListClustersResponse |
listClustersCallable()
public final UnaryCallable<ListClustersRequest,ListClustersResponse> listClustersCallable()
Lists all clusters owned by a project in either the specified zone or all zones.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListClustersRequest request =
ListClustersRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setParent("parent-995424086")
.build();
ApiFuture<ListClustersResponse> future =
clusterManagerClient.listClustersCallable().futureCall(request);
// Do something.
ListClustersResponse response = future.get();
}
Type | Description |
UnaryCallable<ListClustersRequest,ListClustersResponse> |
listLocations(ListLocationsRequest request)
public final ListLocationsResponse listLocations(ListLocationsRequest request)
Fetches locations that offer Google Kubernetes Engine.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder().setParent("parent-995424086").build();
ListLocationsResponse response = clusterManagerClient.listLocations(request);
}
Name | Description |
request | ListLocationsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ListLocationsResponse |
listLocations(String parent)
public final ListLocationsResponse listLocations(String parent)
Fetches locations that offer Google Kubernetes Engine.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String parent = "parent-995424086";
ListLocationsResponse response = clusterManagerClient.listLocations(parent);
}
Name | Description |
parent | String Required. Contains the name of the resource requested. Specified in the format
|
Type | Description |
ListLocationsResponse |
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
Fetches locations that offer Google Kubernetes Engine.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder().setParent("parent-995424086").build();
ApiFuture<ListLocationsResponse> future =
clusterManagerClient.listLocationsCallable().futureCall(request);
// Do something.
ListLocationsResponse response = future.get();
}
Type | Description |
UnaryCallable<ListLocationsRequest,ListLocationsResponse> |
listNodePools(ListNodePoolsRequest request)
public final ListNodePoolsResponse listNodePools(ListNodePoolsRequest request)
Lists the node pools for a cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListNodePoolsRequest request =
ListNodePoolsRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setClusterId("clusterId561939637")
.setParent("parent-995424086")
.build();
ListNodePoolsResponse response = clusterManagerClient.listNodePools(request);
}
Name | Description |
request | ListNodePoolsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ListNodePoolsResponse |
listNodePools(String projectId, String zone, String clusterId)
public final ListNodePoolsResponse listNodePools(String projectId, String zone, String clusterId)
Lists the node pools for a cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
String clusterId = "clusterId561939637";
ListNodePoolsResponse response =
clusterManagerClient.listNodePools(projectId, zone, clusterId);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field. |
zone | String Required. 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. |
clusterId | String Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. |
Type | Description |
ListNodePoolsResponse |
listNodePoolsCallable()
public final UnaryCallable<ListNodePoolsRequest,ListNodePoolsResponse> listNodePoolsCallable()
Lists the node pools for a cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListNodePoolsRequest request =
ListNodePoolsRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setClusterId("clusterId561939637")
.setParent("parent-995424086")
.build();
ApiFuture<ListNodePoolsResponse> future =
clusterManagerClient.listNodePoolsCallable().futureCall(request);
// Do something.
ListNodePoolsResponse response = future.get();
}
Type | Description |
UnaryCallable<ListNodePoolsRequest,ListNodePoolsResponse> |
listOperations(ListOperationsRequest request)
public final ListOperationsResponse listOperations(ListOperationsRequest request)
Lists all operations in a project in the specified zone or all zones.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListOperationsRequest request =
ListOperationsRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setParent("parent-995424086")
.build();
ListOperationsResponse response = clusterManagerClient.listOperations(request);
}
Name | Description |
request | ListOperationsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ListOperationsResponse |
listOperations(String projectId, String zone)
public final ListOperationsResponse listOperations(String projectId, String zone)
Lists all operations in a project in the specified zone or all zones.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
ListOperationsResponse response = clusterManagerClient.listOperations(projectId, zone);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field. |
zone | String Required. Deprecated. The name of the Google Compute Engine
zone to return operations for, or
|
Type | Description |
ListOperationsResponse |
listOperationsCallable()
public final UnaryCallable<ListOperationsRequest,ListOperationsResponse> listOperationsCallable()
Lists all operations in a project in the specified zone or all zones.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListOperationsRequest request =
ListOperationsRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setParent("parent-995424086")
.build();
ApiFuture<ListOperationsResponse> future =
clusterManagerClient.listOperationsCallable().futureCall(request);
// Do something.
ListOperationsResponse response = future.get();
}
Type | Description |
UnaryCallable<ListOperationsRequest,ListOperationsResponse> |
listUsableSubnetworks(ListUsableSubnetworksRequest request)
public final ClusterManagerClient.ListUsableSubnetworksPagedResponse listUsableSubnetworks(ListUsableSubnetworksRequest request)
Lists subnetworks that can be used for creating clusters in a project.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListUsableSubnetworksRequest request =
ListUsableSubnetworksRequest.newBuilder()
.setParent("parent-995424086")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (UsableSubnetwork element :
clusterManagerClient.listUsableSubnetworks(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListUsableSubnetworksRequest The request object containing all of the parameters for the API call. |
Type | Description |
ClusterManagerClient.ListUsableSubnetworksPagedResponse |
listUsableSubnetworks(String parent)
public final ClusterManagerClient.ListUsableSubnetworksPagedResponse listUsableSubnetworks(String parent)
Lists subnetworks that can be used for creating clusters in a project.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String parent = "parent-995424086";
for (UsableSubnetwork element :
clusterManagerClient.listUsableSubnetworks(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The parent project where subnetworks are usable. Specified in the
format |
Type | Description |
ClusterManagerClient.ListUsableSubnetworksPagedResponse |
listUsableSubnetworksCallable()
public final UnaryCallable<ListUsableSubnetworksRequest,ListUsableSubnetworksResponse> listUsableSubnetworksCallable()
Lists subnetworks that can be used for creating clusters in a project.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListUsableSubnetworksRequest request =
ListUsableSubnetworksRequest.newBuilder()
.setParent("parent-995424086")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListUsableSubnetworksResponse response =
clusterManagerClient.listUsableSubnetworksCallable().call(request);
for (UsableSubnetwork element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListUsableSubnetworksRequest,ListUsableSubnetworksResponse> |
listUsableSubnetworksPagedCallable()
public final UnaryCallable<ListUsableSubnetworksRequest,ClusterManagerClient.ListUsableSubnetworksPagedResponse> listUsableSubnetworksPagedCallable()
Lists subnetworks that can be used for creating clusters in a project.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
ListUsableSubnetworksRequest request =
ListUsableSubnetworksRequest.newBuilder()
.setParent("parent-995424086")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<UsableSubnetwork> future =
clusterManagerClient.listUsableSubnetworksPagedCallable().futureCall(request);
// Do something.
for (UsableSubnetwork element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListUsableSubnetworksRequest,ListUsableSubnetworksPagedResponse> |
rollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest request)
public final Operation rollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest request)
Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
RollbackNodePoolUpgradeRequest request =
RollbackNodePoolUpgradeRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setClusterId("clusterId561939637")
.setNodePoolId("nodePoolId1121557241")
.setName("name3373707")
.build();
Operation response = clusterManagerClient.rollbackNodePoolUpgrade(request);
}
Name | Description |
request | RollbackNodePoolUpgradeRequest The request object containing all of the parameters for the API call. |
Type | Description |
Operation |
rollbackNodePoolUpgrade(String projectId, String zone, String clusterId, String nodePoolId)
public final Operation rollbackNodePoolUpgrade(String projectId, String zone, String clusterId, String nodePoolId)
Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
String clusterId = "clusterId561939637";
String nodePoolId = "nodePoolId1121557241";
Operation response =
clusterManagerClient.rollbackNodePoolUpgrade(projectId, zone, clusterId, nodePoolId);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. 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. |
clusterId | String Required. Deprecated. The name of the cluster to rollback. This field has been deprecated and replaced by the name field. |
nodePoolId | String Required. Deprecated. The name of the node pool to rollback. This field has been deprecated and replaced by the name field. |
Type | Description |
Operation |
rollbackNodePoolUpgradeCallable()
public final UnaryCallable<RollbackNodePoolUpgradeRequest,Operation> rollbackNodePoolUpgradeCallable()
Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
RollbackNodePoolUpgradeRequest request =
RollbackNodePoolUpgradeRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setClusterId("clusterId561939637")
.setNodePoolId("nodePoolId1121557241")
.setName("name3373707")
.build();
ApiFuture<Operation> future =
clusterManagerClient.rollbackNodePoolUpgradeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<RollbackNodePoolUpgradeRequest,Operation> |
setAddonsConfig(SetAddonsConfigRequest request)
public final Operation setAddonsConfig(SetAddonsConfigRequest request)
Sets the addons for a specific cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
SetAddonsConfigRequest request =
SetAddonsConfigRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setClusterId("clusterId561939637")
.setAddonsConfig(AddonsConfig.newBuilder().build())
.setName("name3373707")
.build();
Operation response = clusterManagerClient.setAddonsConfig(request);
}
Name | Description |
request | SetAddonsConfigRequest The request object containing all of the parameters for the API call. |
Type | Description |
Operation |
setAddonsConfig(String projectId, String zone, String clusterId, AddonsConfig addonsConfig)
public final Operation setAddonsConfig(String projectId, String zone, String clusterId, AddonsConfig addonsConfig)
Sets the addons for a specific cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "projectId-894832108";
String zone = "zone3744684";
String clusterId = "clusterId561939637";
AddonsConfig addonsConfig = AddonsConfig.newBuilder().build();
Operation response =
clusterManagerClient.setAddonsConfig(projectId, zone, clusterId, addonsConfig);
}
Name | Description |
projectId | String Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field. |
zone | String Required. 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. |
clusterId | String Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. |
addonsConfig | AddonsConfig Required. The desired configurations for the various addons available to run in the cluster. |
Type | Description |
Operation |
setAddonsConfigCallable()
public final UnaryCallable<SetAddonsConfigRequest,Operation> setAddonsConfigCallable()
Sets the addons for a specific cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
SetAddonsConfigRequest request =
SetAddonsConfigRequest.newBuilder()
.setProjectId("projectId-894832108")
.setZone("zone3744684")
.setClusterId("clusterId561939637")
.setAddonsConfig(AddonsConfig.newBuilder().build())
.setName("name3373707")
.build();
ApiFuture<Operation> future =
clusterManagerClient.setAddonsConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<SetAddonsConfigRequest,Op |