@Generated(value="by gapic-generator") @BetaApi public class ClusterManagerClient extends Object implements BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
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:
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);
Modifier | Constructor and Description |
---|---|
protected |
ClusterManagerClient(ClusterManagerSettings settings)
Constructs an instance of ClusterManagerClient, using the given settings.
|
protected |
ClusterManagerClient(ClusterManagerStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
cancelOperation(com.google.container.v1.CancelOperationRequest request)
Cancels the specified operation.
|
void |
cancelOperation(String projectId,
String zone,
String operationId)
Cancels the specified operation.
|
UnaryCallable<com.google.container.v1.CancelOperationRequest,Empty> |
cancelOperationCallable()
Cancels the specified operation.
|
void |
close() |
com.google.container.v1.Operation |
completeIPRotation(com.google.container.v1.CompleteIPRotationRequest request)
Completes master IP rotation.
|
com.google.container.v1.Operation |
completeIPRotation(String projectId,
String zone,
String clusterId)
Completes master IP rotation.
|
UnaryCallable<com.google.container.v1.CompleteIPRotationRequest,com.google.container.v1.Operation> |
completeIPRotationCallable()
Completes master IP rotation.
|
static ClusterManagerClient |
create()
Constructs an instance of ClusterManagerClient with default settings.
|
static ClusterManagerClient |
create(ClusterManagerSettings settings)
Constructs an instance of ClusterManagerClient, using the given settings.
|
static ClusterManagerClient |
create(ClusterManagerStub stub)
Constructs an instance of ClusterManagerClient, using the given stub for making calls.
|
com.google.container.v1.Operation |
createCluster(com.google.container.v1.CreateClusterRequest request)
Creates a cluster, consisting of the specified number and type of Google Compute Engine
instances.
|
com.google.container.v1.Operation |
createCluster(String projectId,
String zone,
com.google.container.v1.Cluster cluster)
Creates a cluster, consisting of the specified number and type of Google Compute Engine
instances.
|
UnaryCallable<com.google.container.v1.CreateClusterRequest,com.google.container.v1.Operation> |
createClusterCallable()
Creates a cluster, consisting of the specified number and type of Google Compute Engine
instances.
|
com.google.container.v1.Operation |
createNodePool(com.google.container.v1.CreateNodePoolRequest request)
Creates a node pool for a cluster.
|
com.google.container.v1.Operation |
createNodePool(String projectId,
String zone,
String clusterId,
com.google.container.v1.NodePool nodePool)
Creates a node pool for a cluster.
|
UnaryCallable<com.google.container.v1.CreateNodePoolRequest,com.google.container.v1.Operation> |
createNodePoolCallable()
Creates a node pool for a cluster.
|
com.google.container.v1.Operation |
deleteCluster(com.google.container.v1.DeleteClusterRequest request)
Deletes the cluster, including the Kubernetes endpoint and all worker nodes.
|
com.google.container.v1.Operation |
deleteCluster(String projectId,
String zone,
String clusterId)
Deletes the cluster, including the Kubernetes endpoint and all worker nodes.
|
UnaryCallable<com.google.container.v1.DeleteClusterRequest,com.google.container.v1.Operation> |
deleteClusterCallable()
Deletes the cluster, including the Kubernetes endpoint and all worker nodes.
|
com.google.container.v1.Operation |
deleteNodePool(com.google.container.v1.DeleteNodePoolRequest request)
Deletes a node pool from a cluster.
|
com.google.container.v1.Operation |
deleteNodePool(String projectId,
String zone,
String clusterId,
String nodePoolId)
Deletes a node pool from a cluster.
|
UnaryCallable<com.google.container.v1.DeleteNodePoolRequest,com.google.container.v1.Operation> |
deleteNodePoolCallable()
Deletes a node pool from a cluster.
|
com.google.container.v1.Cluster |
getCluster(com.google.container.v1.GetClusterRequest request)
Gets the details of a specific cluster.
|
com.google.container.v1.Cluster |
getCluster(String projectId,
String zone,
String clusterId)
Gets the details of a specific cluster.
|
UnaryCallable<com.google.container.v1.GetClusterRequest,com.google.container.v1.Cluster> |
getClusterCallable()
Gets the details of a specific cluster.
|
com.google.container.v1.NodePool |
getNodePool(com.google.container.v1.GetNodePoolRequest request)
Retrieves the node pool requested.
|
com.google.container.v1.NodePool |
getNodePool(String projectId,
String zone,
String clusterId,
String nodePoolId)
Retrieves the node pool requested.
|
UnaryCallable<com.google.container.v1.GetNodePoolRequest,com.google.container.v1.NodePool> |
getNodePoolCallable()
Retrieves the node pool requested.
|
com.google.container.v1.Operation |
getOperation(com.google.container.v1.GetOperationRequest request)
Gets the specified operation.
|
com.google.container.v1.Operation |
getOperation(String projectId,
String zone,
String operationId)
Gets the specified operation.
|
UnaryCallable<com.google.container.v1.GetOperationRequest,com.google.container.v1.Operation> |
getOperationCallable()
Gets the specified operation.
|
com.google.container.v1.ServerConfig |
getServerConfig(com.google.container.v1.GetServerConfigRequest request)
Returns configuration info about the Kubernetes Engine service.
|
com.google.container.v1.ServerConfig |
getServerConfig(String projectId,
String zone)
Returns configuration info about the Kubernetes Engine service.
|
UnaryCallable<com.google.container.v1.GetServerConfigRequest,com.google.container.v1.ServerConfig> |
getServerConfigCallable()
Returns configuration info about the Kubernetes Engine service.
|
ClusterManagerSettings |
getSettings() |
ClusterManagerStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
com.google.container.v1.ListClustersResponse |
listClusters(com.google.container.v1.ListClustersRequest request)
Lists all clusters owned by a project in either the specified zone or all zones.
|
com.google.container.v1.ListClustersResponse |
listClusters(String projectId,
String zone)
Lists all clusters owned by a project in either the specified zone or all zones.
|
UnaryCallable<com.google.container.v1.ListClustersRequest,com.google.container.v1.ListClustersResponse> |
listClustersCallable()
Lists all clusters owned by a project in either the specified zone or all zones.
|
com.google.container.v1.ListNodePoolsResponse |
listNodePools(com.google.container.v1.ListNodePoolsRequest request)
Lists the node pools for a cluster.
|
com.google.container.v1.ListNodePoolsResponse |
listNodePools(String projectId,
String zone,
String clusterId)
Lists the node pools for a cluster.
|
UnaryCallable<com.google.container.v1.ListNodePoolsRequest,com.google.container.v1.ListNodePoolsResponse> |
listNodePoolsCallable()
Lists the node pools for a cluster.
|
com.google.container.v1.ListOperationsResponse |
listOperations(com.google.container.v1.ListOperationsRequest request)
Lists all operations in a project in a specific zone or all zones.
|
com.google.container.v1.ListOperationsResponse |
listOperations(String projectId,
String zone)
Lists all operations in a project in a specific zone or all zones.
|
UnaryCallable<com.google.container.v1.ListOperationsRequest,com.google.container.v1.ListOperationsResponse> |
listOperationsCallable()
Lists all operations in a project in a specific zone or all zones.
|
com.google.container.v1.Operation |
rollbackNodePoolUpgrade(com.google.container.v1.RollbackNodePoolUpgradeRequest request)
Roll back the previously Aborted or Failed NodePool upgrade.
|
com.google.container.v1.Operation |
rollbackNodePoolUpgrade(String projectId,
String zone,
String clusterId,
String nodePoolId)
Roll back the previously Aborted or Failed NodePool upgrade.
|
UnaryCallable<com.google.container.v1.RollbackNodePoolUpgradeRequest,com.google.container.v1.Operation> |
rollbackNodePoolUpgradeCallable()
Roll back the previously Aborted or Failed NodePool upgrade.
|
com.google.container.v1.Operation |
setAddonsConfig(com.google.container.v1.SetAddonsConfigRequest request)
Sets the addons for a specific cluster.
|
com.google.container.v1.Operation |
setAddonsConfig(String projectId,
String zone,
String clusterId,
com.google.container.v1.AddonsConfig addonsConfig)
Sets the addons for a specific cluster.
|
UnaryCallable<com.google.container.v1.SetAddonsConfigRequest,com.google.container.v1.Operation> |
setAddonsConfigCallable()
Sets the addons for a specific cluster.
|
com.google.container.v1.Operation |
setLabels(com.google.container.v1.SetLabelsRequest request)
Sets labels on a cluster.
|
UnaryCallable<com.google.container.v1.SetLabelsRequest,com.google.container.v1.Operation> |
setLabelsCallable()
Sets labels on a cluster.
|
com.google.container.v1.Operation |
setLegacyAbac(com.google.container.v1.SetLegacyAbacRequest request)
Enables or disables the ABAC authorization mechanism on a cluster.
|
com.google.container.v1.Operation |
setLegacyAbac(String projectId,
String zone,
String clusterId,
boolean enabled)
Enables or disables the ABAC authorization mechanism on a cluster.
|
UnaryCallable<com.google.container.v1.SetLegacyAbacRequest,com.google.container.v1.Operation> |
setLegacyAbacCallable()
Enables or disables the ABAC authorization mechanism on a cluster.
|
com.google.container.v1.Operation |
setLocations(com.google.container.v1.SetLocationsRequest request)
Sets the locations for a specific cluster.
|
com.google.container.v1.Operation |
setLocations(String projectId,
String zone,
String clusterId,
List<String> locations)
Sets the locations for a specific cluster.
|
UnaryCallable<com.google.container.v1.SetLocationsRequest,com.google.container.v1.Operation> |
setLocationsCallable()
Sets the locations for a specific cluster.
|
com.google.container.v1.Operation |
setLoggingService(com.google.container.v1.SetLoggingServiceRequest request)
Sets the logging service for a specific cluster.
|
com.google.container.v1.Operation |
setLoggingService(String projectId,
String zone,
String clusterId,
String loggingService)
Sets the logging service for a specific cluster.
|
UnaryCallable<com.google.container.v1.SetLoggingServiceRequest,com.google.container.v1.Operation> |
setLoggingServiceCallable()
Sets the logging service for a specific cluster.
|
com.google.container.v1.Operation |
setMaintenancePolicy(com.google.container.v1.SetMaintenancePolicyRequest request)
Sets the maintenance policy for a cluster.
|
com.google.container.v1.Operation |
setMaintenancePolicy(String projectId,
String zone,
String clusterId,
com.google.container.v1.MaintenancePolicy maintenancePolicy)
Sets the maintenance policy for a cluster.
|
UnaryCallable<com.google.container.v1.SetMaintenancePolicyRequest,com.google.container.v1.Operation> |
setMaintenancePolicyCallable()
Sets the maintenance policy for a cluster.
|
com.google.container.v1.Operation |
setMasterAuth(com.google.container.v1.SetMasterAuthRequest request)
Used to set master auth materials.
|
UnaryCallable<com.google.container.v1.SetMasterAuthRequest,com.google.container.v1.Operation> |
setMasterAuthCallable()
Used to set master auth materials.
|
com.google.container.v1.Operation |
setMonitoringService(com.google.container.v1.SetMonitoringServiceRequest request)
Sets the monitoring service for a specific cluster.
|
com.google.container.v1.Operation |
setMonitoringService(String projectId,
String zone,
String clusterId,
String monitoringService)
Sets the monitoring service for a specific cluster.
|
UnaryCallable<com.google.container.v1.SetMonitoringServiceRequest,com.google.container.v1.Operation> |
setMonitoringServiceCallable()
Sets the monitoring service for a specific cluster.
|
com.google.container.v1.Operation |
setNetworkPolicy(com.google.container.v1.SetNetworkPolicyRequest request)
Enables/Disables Network Policy for a cluster.
|
com.google.container.v1.Operation |
setNetworkPolicy(String projectId,
String zone,
String clusterId,
com.google.container.v1.NetworkPolicy networkPolicy)
Enables/Disables Network Policy for a cluster.
|
UnaryCallable<com.google.container.v1.SetNetworkPolicyRequest,com.google.container.v1.Operation> |
setNetworkPolicyCallable()
Enables/Disables Network Policy for a cluster.
|
com.google.container.v1.Operation |
setNodePoolAutoscaling(com.google.container.v1.SetNodePoolAutoscalingRequest request)
Sets the autoscaling settings for a specific node pool.
|
UnaryCallable<com.google.container.v1.SetNodePoolAutoscalingRequest,com.google.container.v1.Operation> |
setNodePoolAutoscalingCallable()
Sets the autoscaling settings for a specific node pool.
|
com.google.container.v1.Operation |
setNodePoolManagement(com.google.container.v1.SetNodePoolManagementRequest request)
Sets the NodeManagement options for a node pool.
|
UnaryCallable<com.google.container.v1.SetNodePoolManagementRequest,com.google.container.v1.Operation> |
setNodePoolManagementCallable()
Sets the NodeManagement options for a node pool.
|
com.google.container.v1.Operation |
setNodePoolSize(com.google.container.v1.SetNodePoolSizeRequest request)
Sets the size for a specific node pool.
|
UnaryCallable<com.google.container.v1.SetNodePoolSizeRequest,com.google.container.v1.Operation> |
setNodePoolSizeCallable()
Sets the size for a specific node pool.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.container.v1.Operation |
startIPRotation(com.google.container.v1.StartIPRotationRequest request)
Start master IP rotation.
|
com.google.container.v1.Operation |
startIPRotation(String projectId,
String zone,
String clusterId)
Start master IP rotation.
|
UnaryCallable<com.google.container.v1.StartIPRotationRequest,com.google.container.v1.Operation> |
startIPRotationCallable()
Start master IP rotation.
|
com.google.container.v1.Operation |
updateCluster(String projectId,
String zone,
String clusterId,
com.google.container.v1.ClusterUpdate update)
Updates the settings of a specific cluster.
|
com.google.container.v1.Operation |
updateCluster(com.google.container.v1.UpdateClusterRequest request)
Updates the settings of a specific cluster.
|
UnaryCallable<com.google.container.v1.UpdateClusterRequest,com.google.container.v1.Operation> |
updateClusterCallable()
Updates the settings of a specific cluster.
|
com.google.container.v1.Operation |
updateMaster(String projectId,
String zone,
String clusterId,
String masterVersion)
Updates the master for a specific cluster.
|
com.google.container.v1.Operation |
updateMaster(com.google.container.v1.UpdateMasterRequest request)
Updates the master for a specific cluster.
|
UnaryCallable<com.google.container.v1.UpdateMasterRequest,com.google.container.v1.Operation> |
updateMasterCallable()
Updates the master for a specific cluster.
|
com.google.container.v1.Operation |
updateNodePool(com.google.container.v1.UpdateNodePoolRequest request)
Updates the version and/or image type for a specific node pool.
|
UnaryCallable<com.google.container.v1.UpdateNodePoolRequest,com.google.container.v1.Operation> |
updateNodePoolCallable()
Updates the version and/or image type for a specific node pool.
|
protected ClusterManagerClient(ClusterManagerSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected ClusterManagerClient(ClusterManagerStub stub)
public static final ClusterManagerClient create() throws IOException
IOException
public static final ClusterManagerClient create(ClusterManagerSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final ClusterManagerClient create(ClusterManagerStub stub)
public final ClusterManagerSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public ClusterManagerStub getStub()
public final com.google.container.v1.ListClustersResponse listClusters(String projectId, String zone)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
ListClustersResponse response = clusterManagerClient.listClusters(projectId, zone);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the parent field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones.
This field has been deprecated and replaced by the parent field.ApiException
- if the remote call failspublic final com.google.container.v1.ListClustersResponse listClusters(com.google.container.v1.ListClustersRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
ListClustersRequest request = ListClustersRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.build();
ListClustersResponse response = clusterManagerClient.listClusters(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.ListClustersRequest,com.google.container.v1.ListClustersResponse> listClustersCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
ListClustersRequest request = ListClustersRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.build();
ApiFuture<ListClustersResponse> future = clusterManagerClient.listClustersCallable().futureCall(request);
// Do something
ListClustersResponse response = future.get();
}
public final com.google.container.v1.Cluster getCluster(String projectId, String zone, String clusterId)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
Cluster response = clusterManagerClient.getCluster(projectId, zone, clusterId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to retrieve. This field has been
deprecated and replaced by the name field.ApiException
- if the remote call failspublic final com.google.container.v1.Cluster getCluster(com.google.container.v1.GetClusterRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
GetClusterRequest request = GetClusterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
Cluster response = clusterManagerClient.getCluster(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.GetClusterRequest,com.google.container.v1.Cluster> getClusterCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
GetClusterRequest request = GetClusterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
ApiFuture<Cluster> future = clusterManagerClient.getClusterCallable().futureCall(request);
// Do something
Cluster response = future.get();
}
public final com.google.container.v1.Operation createCluster(String projectId, String zone, com.google.container.v1.Cluster cluster)
By default, the cluster is created in the project's [default network](/compute/docs/networks-and-firewalls#networks).
One firewall is added for the cluster. After cluster creation, the cluster 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 is being used by the cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
Cluster cluster = Cluster.newBuilder().build();
Operation response = clusterManagerClient.createCluster(projectId, zone, cluster);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the parent field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the parent field.cluster
- A [cluster
resource](/container-engine/reference/rest/v1/projects.zones.clusters)ApiException
- if the remote call failspublic final com.google.container.v1.Operation createCluster(com.google.container.v1.CreateClusterRequest request)
By default, the cluster is created in the project's [default network](/compute/docs/networks-and-firewalls#networks).
One firewall is added for the cluster. After cluster creation, the cluster 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 is being used by the cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
Cluster cluster = Cluster.newBuilder().build();
CreateClusterRequest request = CreateClusterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setCluster(cluster)
.build();
Operation response = clusterManagerClient.createCluster(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.CreateClusterRequest,com.google.container.v1.Operation> createClusterCallable()
By default, the cluster is created in the project's [default network](/compute/docs/networks-and-firewalls#networks).
One firewall is added for the cluster. After cluster creation, the cluster 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 is being used by the cluster.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
Cluster cluster = Cluster.newBuilder().build();
CreateClusterRequest request = CreateClusterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setCluster(cluster)
.build();
ApiFuture<Operation> future = clusterManagerClient.createClusterCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation updateCluster(String projectId, String zone, String clusterId, com.google.container.v1.ClusterUpdate update)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
ClusterUpdate update = ClusterUpdate.newBuilder().build();
Operation response = clusterManagerClient.updateCluster(projectId, zone, clusterId, update);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to upgrade. This field has been deprecated
and replaced by the name field.update
- A description of the update.ApiException
- if the remote call failspublic final com.google.container.v1.Operation updateCluster(com.google.container.v1.UpdateClusterRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
ClusterUpdate update = ClusterUpdate.newBuilder().build();
UpdateClusterRequest request = UpdateClusterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setUpdate(update)
.build();
Operation response = clusterManagerClient.updateCluster(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.UpdateClusterRequest,com.google.container.v1.Operation> updateClusterCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
ClusterUpdate update = ClusterUpdate.newBuilder().build();
UpdateClusterRequest request = UpdateClusterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setUpdate(update)
.build();
ApiFuture<Operation> future = clusterManagerClient.updateClusterCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation updateNodePool(com.google.container.v1.UpdateNodePoolRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
String nodeVersion = "";
String imageType = "";
UpdateNodePoolRequest request = UpdateNodePoolRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.setNodeVersion(nodeVersion)
.setImageType(imageType)
.build();
Operation response = clusterManagerClient.updateNodePool(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.UpdateNodePoolRequest,com.google.container.v1.Operation> updateNodePoolCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
String nodeVersion = "";
String imageType = "";
UpdateNodePoolRequest request = UpdateNodePoolRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.setNodeVersion(nodeVersion)
.setImageType(imageType)
.build();
ApiFuture<Operation> future = clusterManagerClient.updateNodePoolCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setNodePoolAutoscaling(com.google.container.v1.SetNodePoolAutoscalingRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
NodePoolAutoscaling autoscaling = NodePoolAutoscaling.newBuilder().build();
SetNodePoolAutoscalingRequest request = SetNodePoolAutoscalingRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.setAutoscaling(autoscaling)
.build();
Operation response = clusterManagerClient.setNodePoolAutoscaling(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetNodePoolAutoscalingRequest,com.google.container.v1.Operation> setNodePoolAutoscalingCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
NodePoolAutoscaling autoscaling = NodePoolAutoscaling.newBuilder().build();
SetNodePoolAutoscalingRequest request = SetNodePoolAutoscalingRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.setAutoscaling(autoscaling)
.build();
ApiFuture<Operation> future = clusterManagerClient.setNodePoolAutoscalingCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setLoggingService(String projectId, String zone, String clusterId, String loggingService)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String loggingService = "";
Operation response = clusterManagerClient.setLoggingService(projectId, zone, clusterId, loggingService);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to upgrade. This field has been deprecated
and replaced by the name field.loggingService
- The logging service the cluster should use to write metrics. Currently
available options:
* "logging.googleapis.com" - the Google Cloud Logging service * "none" - no metrics will be exported from the cluster
ApiException
- if the remote call failspublic final com.google.container.v1.Operation setLoggingService(com.google.container.v1.SetLoggingServiceRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String loggingService = "";
SetLoggingServiceRequest request = SetLoggingServiceRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setLoggingService(loggingService)
.build();
Operation response = clusterManagerClient.setLoggingService(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetLoggingServiceRequest,com.google.container.v1.Operation> setLoggingServiceCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String loggingService = "";
SetLoggingServiceRequest request = SetLoggingServiceRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setLoggingService(loggingService)
.build();
ApiFuture<Operation> future = clusterManagerClient.setLoggingServiceCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setMonitoringService(String projectId, String zone, String clusterId, String monitoringService)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String monitoringService = "";
Operation response = clusterManagerClient.setMonitoringService(projectId, zone, clusterId, monitoringService);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to upgrade. This field has been deprecated
and replaced by the name field.monitoringService
- The monitoring service the cluster should use to write metrics.
Currently available options:
* "monitoring.googleapis.com" - the Google Cloud Monitoring service * "none" - no metrics will be exported from the cluster
ApiException
- if the remote call failspublic final com.google.container.v1.Operation setMonitoringService(com.google.container.v1.SetMonitoringServiceRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String monitoringService = "";
SetMonitoringServiceRequest request = SetMonitoringServiceRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setMonitoringService(monitoringService)
.build();
Operation response = clusterManagerClient.setMonitoringService(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetMonitoringServiceRequest,com.google.container.v1.Operation> setMonitoringServiceCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String monitoringService = "";
SetMonitoringServiceRequest request = SetMonitoringServiceRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setMonitoringService(monitoringService)
.build();
ApiFuture<Operation> future = clusterManagerClient.setMonitoringServiceCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setAddonsConfig(String projectId, String zone, String clusterId, com.google.container.v1.AddonsConfig addonsConfig)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
AddonsConfig addonsConfig = AddonsConfig.newBuilder().build();
Operation response = clusterManagerClient.setAddonsConfig(projectId, zone, clusterId, addonsConfig);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to upgrade. This field has been deprecated
and replaced by the name field.addonsConfig
- The desired configurations for the various addons available to run in the
cluster.ApiException
- if the remote call failspublic final com.google.container.v1.Operation setAddonsConfig(com.google.container.v1.SetAddonsConfigRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
AddonsConfig addonsConfig = AddonsConfig.newBuilder().build();
SetAddonsConfigRequest request = SetAddonsConfigRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setAddonsConfig(addonsConfig)
.build();
Operation response = clusterManagerClient.setAddonsConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetAddonsConfigRequest,com.google.container.v1.Operation> setAddonsConfigCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
AddonsConfig addonsConfig = AddonsConfig.newBuilder().build();
SetAddonsConfigRequest request = SetAddonsConfigRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setAddonsConfig(addonsConfig)
.build();
ApiFuture<Operation> future = clusterManagerClient.setAddonsConfigCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setLocations(String projectId, String zone, String clusterId, List<String> locations)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
List<String> locations = new ArrayList<>();
Operation response = clusterManagerClient.setLocations(projectId, zone, clusterId, locations);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to upgrade. This field has been deprecated
and replaced by the name field.locations
- The desired list of Google Compute Engine
[locations](/compute/docs/zones#available) in which the cluster's nodes should be located.
Changing the locations a cluster is in will result in nodes being either created or removed
from the cluster, depending on whether locations are being added or removed.
This list must always include the cluster's primary zone.
ApiException
- if the remote call failspublic final com.google.container.v1.Operation setLocations(com.google.container.v1.SetLocationsRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
List<String> locations = new ArrayList<>();
SetLocationsRequest request = SetLocationsRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.addAllLocations(locations)
.build();
Operation response = clusterManagerClient.setLocations(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetLocationsRequest,com.google.container.v1.Operation> setLocationsCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
List<String> locations = new ArrayList<>();
SetLocationsRequest request = SetLocationsRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.addAllLocations(locations)
.build();
ApiFuture<Operation> future = clusterManagerClient.setLocationsCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation updateMaster(String projectId, String zone, String clusterId, String masterVersion)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String masterVersion = "";
Operation response = clusterManagerClient.updateMaster(projectId, zone, clusterId, masterVersion);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to upgrade. This field has been deprecated
and replaced by the name field.masterVersion
- The Kubernetes version to change the master to.
Users may specify either explicit versions offered by Kubernetes Engine or version aliases, which have the following behavior:
- "latest": picks the highest valid Kubernetes version - "1.X": picks the highest valid patch+gke.N patch in the 1.X version - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": picks the default Kubernetes version
ApiException
- if the remote call failspublic final com.google.container.v1.Operation updateMaster(com.google.container.v1.UpdateMasterRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String masterVersion = "";
UpdateMasterRequest request = UpdateMasterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setMasterVersion(masterVersion)
.build();
Operation response = clusterManagerClient.updateMaster(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.UpdateMasterRequest,com.google.container.v1.Operation> updateMasterCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String masterVersion = "";
UpdateMasterRequest request = UpdateMasterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setMasterVersion(masterVersion)
.build();
ApiFuture<Operation> future = clusterManagerClient.updateMasterCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setMasterAuth(com.google.container.v1.SetMasterAuthRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
SetMasterAuthRequest.Action action = SetMasterAuthRequest.Action.UNKNOWN;
MasterAuth update = MasterAuth.newBuilder().build();
SetMasterAuthRequest request = SetMasterAuthRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setAction(action)
.setUpdate(update)
.build();
Operation response = clusterManagerClient.setMasterAuth(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetMasterAuthRequest,com.google.container.v1.Operation> setMasterAuthCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
SetMasterAuthRequest.Action action = SetMasterAuthRequest.Action.UNKNOWN;
MasterAuth update = MasterAuth.newBuilder().build();
SetMasterAuthRequest request = SetMasterAuthRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setAction(action)
.setUpdate(update)
.build();
ApiFuture<Operation> future = clusterManagerClient.setMasterAuthCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation deleteCluster(String projectId, String zone, String clusterId)
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 (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
Operation response = clusterManagerClient.deleteCluster(projectId, zone, clusterId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to delete. This field has been deprecated
and replaced by the name field.ApiException
- if the remote call failspublic final com.google.container.v1.Operation deleteCluster(com.google.container.v1.DeleteClusterRequest request)
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 (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
DeleteClusterRequest request = DeleteClusterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
Operation response = clusterManagerClient.deleteCluster(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.DeleteClusterRequest,com.google.container.v1.Operation> deleteClusterCallable()
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 (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time.
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
DeleteClusterRequest request = DeleteClusterRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
ApiFuture<Operation> future = clusterManagerClient.deleteClusterCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.ListOperationsResponse listOperations(String projectId, String zone)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
ListOperationsResponse response = clusterManagerClient.listOperations(projectId, zone);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the parent field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This
field has been deprecated and replaced by the parent field.ApiException
- if the remote call failspublic final com.google.container.v1.ListOperationsResponse listOperations(com.google.container.v1.ListOperationsRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
ListOperationsRequest request = ListOperationsRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.build();
ListOperationsResponse response = clusterManagerClient.listOperations(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.ListOperationsRequest,com.google.container.v1.ListOperationsResponse> listOperationsCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
ListOperationsRequest request = ListOperationsRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.build();
ApiFuture<ListOperationsResponse> future = clusterManagerClient.listOperationsCallable().futureCall(request);
// Do something
ListOperationsResponse response = future.get();
}
public final com.google.container.v1.Operation getOperation(String projectId, String zone, String operationId)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String operationId = "";
Operation response = clusterManagerClient.getOperation(projectId, zone, operationId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.operationId
- Deprecated. The server-assigned `name` of the operation. This field has been
deprecated and replaced by the name field.ApiException
- if the remote call failspublic final com.google.container.v1.Operation getOperation(com.google.container.v1.GetOperationRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String operationId = "";
GetOperationRequest request = GetOperationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setOperationId(operationId)
.build();
Operation response = clusterManagerClient.getOperation(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.GetOperationRequest,com.google.container.v1.Operation> getOperationCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String operationId = "";
GetOperationRequest request = GetOperationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setOperationId(operationId)
.build();
ApiFuture<Operation> future = clusterManagerClient.getOperationCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final void cancelOperation(String projectId, String zone, String operationId)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String operationId = "";
clusterManagerClient.cancelOperation(projectId, zone, operationId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the operation resides. This field has been
deprecated and replaced by the name field.operationId
- Deprecated. The server-assigned `name` of the operation. This field has been
deprecated and replaced by the name field.ApiException
- if the remote call failspublic final void cancelOperation(com.google.container.v1.CancelOperationRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String operationId = "";
CancelOperationRequest request = CancelOperationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setOperationId(operationId)
.build();
clusterManagerClient.cancelOperation(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.CancelOperationRequest,Empty> cancelOperationCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String operationId = "";
CancelOperationRequest request = CancelOperationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setOperationId(operationId)
.build();
ApiFuture<Void> future = clusterManagerClient.cancelOperationCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.container.v1.ServerConfig getServerConfig(String projectId, String zone)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
ServerConfig response = clusterManagerClient.getServerConfig(projectId, zone);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) to return operations for. This field has been
deprecated and replaced by the name field.ApiException
- if the remote call failspublic final com.google.container.v1.ServerConfig getServerConfig(com.google.container.v1.GetServerConfigRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
GetServerConfigRequest request = GetServerConfigRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.build();
ServerConfig response = clusterManagerClient.getServerConfig(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.GetServerConfigRequest,com.google.container.v1.ServerConfig> getServerConfigCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
GetServerConfigRequest request = GetServerConfigRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.build();
ApiFuture<ServerConfig> future = clusterManagerClient.getServerConfigCallable().futureCall(request);
// Do something
ServerConfig response = future.get();
}
public final com.google.container.v1.ListNodePoolsResponse listNodePools(String projectId, String zone, String clusterId)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
ListNodePoolsResponse response = clusterManagerClient.listNodePools(projectId, zone, clusterId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://developers.google.com/console/help/new/#projectnumber). This field has been
deprecated and replaced by the parent field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the parent field.clusterId
- Deprecated. The name of the cluster. This field has been deprecated and
replaced by the parent field.ApiException
- if the remote call failspublic final com.google.container.v1.ListNodePoolsResponse listNodePools(com.google.container.v1.ListNodePoolsRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
ListNodePoolsRequest request = ListNodePoolsRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
ListNodePoolsResponse response = clusterManagerClient.listNodePools(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.ListNodePoolsRequest,com.google.container.v1.ListNodePoolsResponse> listNodePoolsCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
ListNodePoolsRequest request = ListNodePoolsRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
ApiFuture<ListNodePoolsResponse> future = clusterManagerClient.listNodePoolsCallable().futureCall(request);
// Do something
ListNodePoolsResponse response = future.get();
}
public final com.google.container.v1.NodePool getNodePool(String projectId, String zone, String clusterId, String nodePoolId)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
NodePool response = clusterManagerClient.getNodePool(projectId, zone, clusterId, nodePoolId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://developers.google.com/console/help/new/#projectnumber). This field has been
deprecated and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster. This field has been deprecated and
replaced by the name field.nodePoolId
- Deprecated. The name of the node pool. This field has been deprecated and
replaced by the name field.ApiException
- if the remote call failspublic final com.google.container.v1.NodePool getNodePool(com.google.container.v1.GetNodePoolRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
GetNodePoolRequest request = GetNodePoolRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.build();
NodePool response = clusterManagerClient.getNodePool(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.GetNodePoolRequest,com.google.container.v1.NodePool> getNodePoolCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
GetNodePoolRequest request = GetNodePoolRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.build();
ApiFuture<NodePool> future = clusterManagerClient.getNodePoolCallable().futureCall(request);
// Do something
NodePool response = future.get();
}
public final com.google.container.v1.Operation createNodePool(String projectId, String zone, String clusterId, com.google.container.v1.NodePool nodePool)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
NodePool nodePool = NodePool.newBuilder().build();
Operation response = clusterManagerClient.createNodePool(projectId, zone, clusterId, nodePool);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://developers.google.com/console/help/new/#projectnumber). This field has been
deprecated and replaced by the parent field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the parent field.clusterId
- Deprecated. The name of the cluster. This field has been deprecated and
replaced by the parent field.nodePool
- The node pool to create.ApiException
- if the remote call failspublic final com.google.container.v1.Operation createNodePool(com.google.container.v1.CreateNodePoolRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
NodePool nodePool = NodePool.newBuilder().build();
CreateNodePoolRequest request = CreateNodePoolRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePool(nodePool)
.build();
Operation response = clusterManagerClient.createNodePool(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.CreateNodePoolRequest,com.google.container.v1.Operation> createNodePoolCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
NodePool nodePool = NodePool.newBuilder().build();
CreateNodePoolRequest request = CreateNodePoolRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePool(nodePool)
.build();
ApiFuture<Operation> future = clusterManagerClient.createNodePoolCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation deleteNodePool(String projectId, String zone, String clusterId, String nodePoolId)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
Operation response = clusterManagerClient.deleteNodePool(projectId, zone, clusterId, nodePoolId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://developers.google.com/console/help/new/#projectnumber). This field has been
deprecated and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster. This field has been deprecated and
replaced by the name field.nodePoolId
- Deprecated. The name of the node pool to delete. This field has been
deprecated and replaced by the name field.ApiException
- if the remote call failspublic final com.google.container.v1.Operation deleteNodePool(com.google.container.v1.DeleteNodePoolRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
DeleteNodePoolRequest request = DeleteNodePoolRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.build();
Operation response = clusterManagerClient.deleteNodePool(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.DeleteNodePoolRequest,com.google.container.v1.Operation> deleteNodePoolCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
DeleteNodePoolRequest request = DeleteNodePoolRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.build();
ApiFuture<Operation> future = clusterManagerClient.deleteNodePoolCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation rollbackNodePoolUpgrade(String projectId, String zone, String clusterId, String nodePoolId)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
Operation response = clusterManagerClient.rollbackNodePoolUpgrade(projectId, zone, clusterId, nodePoolId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to rollback. This field has been
deprecated and replaced by the name field.nodePoolId
- Deprecated. The name of the node pool to rollback. This field has been
deprecated and replaced by the name field.ApiException
- if the remote call failspublic final com.google.container.v1.Operation rollbackNodePoolUpgrade(com.google.container.v1.RollbackNodePoolUpgradeRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
RollbackNodePoolUpgradeRequest request = RollbackNodePoolUpgradeRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.build();
Operation response = clusterManagerClient.rollbackNodePoolUpgrade(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.RollbackNodePoolUpgradeRequest,com.google.container.v1.Operation> rollbackNodePoolUpgradeCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
RollbackNodePoolUpgradeRequest request = RollbackNodePoolUpgradeRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.build();
ApiFuture<Operation> future = clusterManagerClient.rollbackNodePoolUpgradeCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setNodePoolManagement(com.google.container.v1.SetNodePoolManagementRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
NodeManagement management = NodeManagement.newBuilder().build();
SetNodePoolManagementRequest request = SetNodePoolManagementRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.setManagement(management)
.build();
Operation response = clusterManagerClient.setNodePoolManagement(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetNodePoolManagementRequest,com.google.container.v1.Operation> setNodePoolManagementCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
NodeManagement management = NodeManagement.newBuilder().build();
SetNodePoolManagementRequest request = SetNodePoolManagementRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.setManagement(management)
.build();
ApiFuture<Operation> future = clusterManagerClient.setNodePoolManagementCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setLabels(com.google.container.v1.SetLabelsRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
Map<String, String> resourceLabels = new HashMap<>();
String labelFingerprint = "";
SetLabelsRequest request = SetLabelsRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.putAllResourceLabels(resourceLabels)
.setLabelFingerprint(labelFingerprint)
.build();
Operation response = clusterManagerClient.setLabels(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetLabelsRequest,com.google.container.v1.Operation> setLabelsCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
Map<String, String> resourceLabels = new HashMap<>();
String labelFingerprint = "";
SetLabelsRequest request = SetLabelsRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.putAllResourceLabels(resourceLabels)
.setLabelFingerprint(labelFingerprint)
.build();
ApiFuture<Operation> future = clusterManagerClient.setLabelsCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setLegacyAbac(String projectId, String zone, String clusterId, boolean enabled)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
boolean enabled = false;
Operation response = clusterManagerClient.setLegacyAbac(projectId, zone, clusterId, enabled);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster to update. This field has been deprecated
and replaced by the name field.enabled
- Whether ABAC authorization will be enabled in the cluster.ApiException
- if the remote call failspublic final com.google.container.v1.Operation setLegacyAbac(com.google.container.v1.SetLegacyAbacRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
boolean enabled = false;
SetLegacyAbacRequest request = SetLegacyAbacRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setEnabled(enabled)
.build();
Operation response = clusterManagerClient.setLegacyAbac(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetLegacyAbacRequest,com.google.container.v1.Operation> setLegacyAbacCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
boolean enabled = false;
SetLegacyAbacRequest request = SetLegacyAbacRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setEnabled(enabled)
.build();
ApiFuture<Operation> future = clusterManagerClient.setLegacyAbacCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation startIPRotation(String projectId, String zone, String clusterId)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
Operation response = clusterManagerClient.startIPRotation(projectId, zone, clusterId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://developers.google.com/console/help/new/#projectnumber). This field has been
deprecated and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster. This field has been deprecated and
replaced by the name field.ApiException
- if the remote call failspublic final com.google.container.v1.Operation startIPRotation(com.google.container.v1.StartIPRotationRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
StartIPRotationRequest request = StartIPRotationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
Operation response = clusterManagerClient.startIPRotation(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.StartIPRotationRequest,com.google.container.v1.Operation> startIPRotationCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
StartIPRotationRequest request = StartIPRotationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
ApiFuture<Operation> future = clusterManagerClient.startIPRotationCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation completeIPRotation(String projectId, String zone, String clusterId)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
Operation response = clusterManagerClient.completeIPRotation(projectId, zone, clusterId);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://developers.google.com/console/help/new/#projectnumber). This field has been
deprecated and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster. This field has been deprecated and
replaced by the name field.ApiException
- if the remote call failspublic final com.google.container.v1.Operation completeIPRotation(com.google.container.v1.CompleteIPRotationRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
CompleteIPRotationRequest request = CompleteIPRotationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
Operation response = clusterManagerClient.completeIPRotation(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.CompleteIPRotationRequest,com.google.container.v1.Operation> completeIPRotationCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
CompleteIPRotationRequest request = CompleteIPRotationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.build();
ApiFuture<Operation> future = clusterManagerClient.completeIPRotationCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setNodePoolSize(com.google.container.v1.SetNodePoolSizeRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
int nodeCount = 0;
SetNodePoolSizeRequest request = SetNodePoolSizeRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.setNodeCount(nodeCount)
.build();
Operation response = clusterManagerClient.setNodePoolSize(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetNodePoolSizeRequest,com.google.container.v1.Operation> setNodePoolSizeCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
String nodePoolId = "";
int nodeCount = 0;
SetNodePoolSizeRequest request = SetNodePoolSizeRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNodePoolId(nodePoolId)
.setNodeCount(nodeCount)
.build();
ApiFuture<Operation> future = clusterManagerClient.setNodePoolSizeCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setNetworkPolicy(String projectId, String zone, String clusterId, com.google.container.v1.NetworkPolicy networkPolicy)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
NetworkPolicy networkPolicy = NetworkPolicy.newBuilder().build();
Operation response = clusterManagerClient.setNetworkPolicy(projectId, zone, clusterId, networkPolicy);
}
projectId
- Deprecated. The Google Developers Console [project ID or project
number](https://developers.google.com/console/help/new/#projectnumber). This field has been
deprecated and replaced by the name field.zone
- Deprecated. The name of the Google Compute Engine
[zone](/compute/docs/zones#available) in which the cluster resides. This field has been
deprecated and replaced by the name field.clusterId
- Deprecated. The name of the cluster. This field has been deprecated and
replaced by the name field.networkPolicy
- Configuration options for the NetworkPolicy feature.ApiException
- if the remote call failspublic final com.google.container.v1.Operation setNetworkPolicy(com.google.container.v1.SetNetworkPolicyRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
NetworkPolicy networkPolicy = NetworkPolicy.newBuilder().build();
SetNetworkPolicyRequest request = SetNetworkPolicyRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNetworkPolicy(networkPolicy)
.build();
Operation response = clusterManagerClient.setNetworkPolicy(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetNetworkPolicyRequest,com.google.container.v1.Operation> setNetworkPolicyCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
NetworkPolicy networkPolicy = NetworkPolicy.newBuilder().build();
SetNetworkPolicyRequest request = SetNetworkPolicyRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setNetworkPolicy(networkPolicy)
.build();
ApiFuture<Operation> future = clusterManagerClient.setNetworkPolicyCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.container.v1.Operation setMaintenancePolicy(String projectId, String zone, String clusterId, com.google.container.v1.MaintenancePolicy maintenancePolicy)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build();
Operation response = clusterManagerClient.setMaintenancePolicy(projectId, zone, clusterId, maintenancePolicy);
}
projectId
- The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840).zone
- The name of the Google Compute Engine [zone](/compute/docs/zones#available) in
which the cluster resides.clusterId
- The name of the cluster to update.maintenancePolicy
- The maintenance policy to be set for the cluster. An empty field
clears the existing maintenance policy.ApiException
- if the remote call failspublic final com.google.container.v1.Operation setMaintenancePolicy(com.google.container.v1.SetMaintenancePolicyRequest request)
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build();
SetMaintenancePolicyRequest request = SetMaintenancePolicyRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setMaintenancePolicy(maintenancePolicy)
.build();
Operation response = clusterManagerClient.setMaintenancePolicy(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.container.v1.SetMaintenancePolicyRequest,com.google.container.v1.Operation> setMaintenancePolicyCallable()
Sample code:
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String clusterId = "";
MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build();
SetMaintenancePolicyRequest request = SetMaintenancePolicyRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setClusterId(clusterId)
.setMaintenancePolicy(maintenancePolicy)
.build();
ApiFuture<Operation> future = clusterManagerClient.setMaintenancePolicyCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.