@Generated(value="by gapic-generator") @BetaApi public class ClusterManagerClient extends Object implements com.google.api.gax.core.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(CancelOperationRequest request)
Cancels the specified operation.
|
void |
cancelOperation(String projectId,
String zone,
String operationId)
Cancels the specified operation.
|
com.google.api.gax.rpc.UnaryCallable<CancelOperationRequest,Empty> |
cancelOperationCallable()
Cancels the specified operation.
|
void |
close() |
Operation |
completeIPRotation(CompleteIPRotationRequest request)
Completes master IP rotation.
|
Operation |
completeIPRotation(String projectId,
String zone,
String clusterId)
Completes master IP rotation.
|
com.google.api.gax.rpc.UnaryCallable<CompleteIPRotationRequest,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.
|
Operation |
createCluster(CreateClusterRequest request)
Creates a cluster, consisting of the specified number and type of Google Compute Engine
instances.
|
Operation |
createCluster(String projectId,
String zone,
Cluster cluster)
Creates a cluster, consisting of the specified number and type of Google Compute Engine
instances.
|
com.google.api.gax.rpc.UnaryCallable<CreateClusterRequest,Operation> |
createClusterCallable()
Creates a cluster, consisting of the specified number and type of Google Compute Engine
instances.
|
Operation |
createNodePool(CreateNodePoolRequest request)
Creates a node pool for a cluster.
|
Operation |
createNodePool(String projectId,
String zone,
String clusterId,
NodePool nodePool)
Creates a node pool for a cluster.
|
com.google.api.gax.rpc.UnaryCallable<CreateNodePoolRequest,Operation> |
createNodePoolCallable()
Creates a node pool for a cluster.
|
Operation |
deleteCluster(DeleteClusterRequest request)
Deletes the cluster, including the Kubernetes endpoint and all worker nodes.
|
Operation |
deleteCluster(String projectId,
String zone,
String clusterId)
Deletes the cluster, including the Kubernetes endpoint and all worker nodes.
|
com.google.api.gax.rpc.UnaryCallable<DeleteClusterRequest,Operation> |
deleteClusterCallable()
Deletes the cluster, including the Kubernetes endpoint and all worker nodes.
|
Operation |
deleteNodePool(DeleteNodePoolRequest request)
Deletes a node pool from a cluster.
|
Operation |
deleteNodePool(String projectId,
String zone,
String clusterId,
String nodePoolId)
Deletes a node pool from a cluster.
|
com.google.api.gax.rpc.UnaryCallable<DeleteNodePoolRequest,Operation> |
deleteNodePoolCallable()
Deletes a node pool from a cluster.
|
Cluster |
getCluster(GetClusterRequest request)
Gets the details of a specific cluster.
|
Cluster |
getCluster(String projectId,
String zone,
String clusterId)
Gets the details of a specific cluster.
|
com.google.api.gax.rpc.UnaryCallable<GetClusterRequest,Cluster> |
getClusterCallable()
Gets the details of a specific cluster.
|
NodePool |
getNodePool(GetNodePoolRequest request)
Retrieves the node pool requested.
|
NodePool |
getNodePool(String projectId,
String zone,
String clusterId,
String nodePoolId)
Retrieves the node pool requested.
|
com.google.api.gax.rpc.UnaryCallable<GetNodePoolRequest,NodePool> |
getNodePoolCallable()
Retrieves the node pool requested.
|
Operation |
getOperation(GetOperationRequest request)
Gets the specified operation.
|
Operation |
getOperation(String projectId,
String zone,
String operationId)
Gets the specified operation.
|
com.google.api.gax.rpc.UnaryCallable<GetOperationRequest,Operation> |
getOperationCallable()
Gets the specified operation.
|
ServerConfig |
getServerConfig(GetServerConfigRequest request)
Returns configuration info about the Kubernetes Engine service.
|
ServerConfig |
getServerConfig(String projectId,
String zone)
Returns configuration info about the Kubernetes Engine service.
|
com.google.api.gax.rpc.UnaryCallable<GetServerConfigRequest,ServerConfig> |
getServerConfigCallable()
Returns configuration info about the Kubernetes Engine service.
|
ClusterManagerSettings |
getSettings() |
ClusterManagerStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
ListClustersResponse |
listClusters(ListClustersRequest request)
Lists all clusters owned by a project in either the specified zone or all zones.
|
ListClustersResponse |
listClusters(String projectId,
String zone)
Lists all clusters owned by a project in either the specified zone or all zones.
|
com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,ListClustersResponse> |
listClustersCallable()
Lists all clusters owned by a project in either the specified zone or all zones.
|
ListNodePoolsResponse |
listNodePools(ListNodePoolsRequest request)
Lists the node pools for a cluster.
|
ListNodePoolsResponse |
listNodePools(String projectId,
String zone,
String clusterId)
Lists the node pools for a cluster.
|
com.google.api.gax.rpc.UnaryCallable<ListNodePoolsRequest,ListNodePoolsResponse> |
listNodePoolsCallable()
Lists the node pools for a cluster.
|
ListOperationsResponse |
listOperations(ListOperationsRequest request)
Lists all operations in a project in a specific zone or all zones.
|
ListOperationsResponse |
listOperations(String projectId,
String zone)
Lists all operations in a project in a specific zone or all zones.
|
com.google.api.gax.rpc.UnaryCallable<ListOperationsRequest,ListOperationsResponse> |
listOperationsCallable()
Lists all operations in a project in a specific zone or all zones.
|
Operation |
rollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest request)
Roll back the previously Aborted or Failed NodePool upgrade.
|
Operation |
rollbackNodePoolUpgrade(String projectId,
String zone,
String clusterId,
String nodePoolId)
Roll back the previously Aborted or Failed NodePool upgrade.
|
com.google.api.gax.rpc.UnaryCallable<RollbackNodePoolUpgradeRequest,Operation> |
rollbackNodePoolUpgradeCallable()
Roll back the previously Aborted or Failed NodePool upgrade.
|
Operation |
setAddonsConfig(SetAddonsConfigRequest request)
Sets the addons for a specific cluster.
|
Operation |
setAddonsConfig(String projectId,
String zone,
String clusterId,
AddonsConfig addonsConfig)
Sets the addons for a specific cluster.
|
com.google.api.gax.rpc.UnaryCallable<SetAddonsConfigRequest,Operation> |
setAddonsConfigCallable()
Sets the addons for a specific cluster.
|
Operation |
setLabels(SetLabelsRequest request)
Sets labels on a cluster.
|
com.google.api.gax.rpc.UnaryCallable<SetLabelsRequest,Operation> |
setLabelsCallable()
Sets labels on a cluster.
|
Operation |
setLegacyAbac(SetLegacyAbacRequest request)
Enables or disables the ABAC authorization mechanism on a cluster.
|
Operation |
setLegacyAbac(String projectId,
String zone,
String clusterId,
boolean enabled)
Enables or disables the ABAC authorization mechanism on a cluster.
|
com.google.api.gax.rpc.UnaryCallable<SetLegacyAbacRequest,Operation> |
setLegacyAbacCallable()
Enables or disables the ABAC authorization mechanism on a cluster.
|
Operation |
setLocations(SetLocationsRequest request)
Sets the locations for a specific cluster.
|
Operation |
setLocations(String projectId,
String zone,
String clusterId,
List<String> locations)
Sets the locations for a specific cluster.
|
com.google.api.gax.rpc.UnaryCallable<SetLocationsRequest,Operation> |
setLocationsCallable()
Sets the locations for a specific cluster.
|
Operation |
setLoggingService(SetLoggingServiceRequest request)
Sets the logging service for a specific cluster.
|
Operation |
setLoggingService(String projectId,
String zone,
String clusterId,
String loggingService)
Sets the logging service for a specific cluster.
|
com.google.api.gax.rpc.UnaryCallable<SetLoggingServiceRequest,Operation> |
setLoggingServiceCallable()
Sets the logging service for a specific cluster.
|
Operation |
setMaintenancePolicy(SetMaintenancePolicyRequest request)
Sets the maintenance policy for a cluster.
|
Operation |
setMaintenancePolicy(String projectId,
String zone,
String clusterId,
MaintenancePolicy maintenancePolicy)
Sets the maintenance policy for a cluster.
|
com.google.api.gax.rpc.UnaryCallable<SetMaintenancePolicyRequest,Operation> |
setMaintenancePolicyCallable()
Sets the maintenance policy for a cluster.
|
Operation |
setMasterAuth(SetMasterAuthRequest request)
Used to set master auth materials.
|
com.google.api.gax.rpc.UnaryCallable<SetMasterAuthRequest,Operation> |
setMasterAuthCallable()
Used to set master auth materials.
|
Operation |
setMonitoringService(SetMonitoringServiceRequest request)
Sets the monitoring service for a specific cluster.
|
Operation |
setMonitoringService(String projectId,
String zone,
String clusterId,
String monitoringService)
Sets the monitoring service for a specific cluster.
|
com.google.api.gax.rpc.UnaryCallable<SetMonitoringServiceRequest,Operation> |
setMonitoringServiceCallable()
Sets the monitoring service for a specific cluster.
|
Operation |
setNetworkPolicy(SetNetworkPolicyRequest request)
Enables/Disables Network Policy for a cluster.
|
Operation |
setNetworkPolicy(String projectId,
String zone,
String clusterId,
NetworkPolicy networkPolicy)
Enables/Disables Network Policy for a cluster.
|
com.google.api.gax.rpc.UnaryCallable<SetNetworkPolicyRequest,Operation> |
setNetworkPolicyCallable()
Enables/Disables Network Policy for a cluster.
|
Operation |
setNodePoolAutoscaling(SetNodePoolAutoscalingRequest request)
Sets the autoscaling settings for a specific node pool.
|
com.google.api.gax.rpc.UnaryCallable<SetNodePoolAutoscalingRequest,Operation> |
setNodePoolAutoscalingCallable()
Sets the autoscaling settings for a specific node pool.
|
Operation |
setNodePoolManagement(SetNodePoolManagementRequest request)
Sets the NodeManagement options for a node pool.
|
com.google.api.gax.rpc.UnaryCallable<SetNodePoolManagementRequest,Operation> |
setNodePoolManagementCallable()
Sets the NodeManagement options for a node pool.
|
Operation |
setNodePoolSize(SetNodePoolSizeRequest request)
Sets the size for a specific node pool.
|
com.google.api.gax.rpc.UnaryCallable<SetNodePoolSizeRequest,Operation> |
setNodePoolSizeCallable()
Sets the size for a specific node pool.
|
void |
shutdown() |
void |
shutdownNow() |
Operation |
startIPRotation(StartIPRotationRequest request)
Start master IP rotation.
|
Operation |
startIPRotation(String projectId,
String zone,
String clusterId)
Start master IP rotation.
|
com.google.api.gax.rpc.UnaryCallable<StartIPRotationRequest,Operation> |
startIPRotationCallable()
Start master IP rotation.
|
Operation |
updateCluster(String projectId,
String zone,
String clusterId,
ClusterUpdate update)
Updates the settings of a specific cluster.
|
Operation |
updateCluster(UpdateClusterRequest request)
Updates the settings of a specific cluster.
|
com.google.api.gax.rpc.UnaryCallable<UpdateClusterRequest,Operation> |
updateClusterCallable()
Updates the settings of a specific cluster.
|
Operation |
updateMaster(String projectId,
String zone,
String clusterId,
String masterVersion)
Updates the master for a specific cluster.
|
Operation |
updateMaster(UpdateMasterRequest request)
Updates the master for a specific cluster.
|
com.google.api.gax.rpc.UnaryCallable<UpdateMasterRequest,Operation> |
updateMasterCallable()
Updates the master for a specific cluster.
|
Operation |
updateNodePool(UpdateNodePoolRequest request)
Updates the version and/or image type for a specific node pool.
|
com.google.api.gax.rpc.UnaryCallable<UpdateNodePoolRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final ListClustersResponse listClusters(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Cluster getCluster(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetClusterRequest,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 Operation createCluster(String projectId, String zone, 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)com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation createCluster(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateClusterRequest,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 Operation updateCluster(String projectId, String zone, String clusterId, 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation updateCluster(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateClusterRequest,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 Operation updateNodePool(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateNodePoolRequest,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 Operation setNodePoolAutoscaling(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetNodePoolAutoscalingRequest,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 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
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation setLoggingService(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetLoggingServiceRequest,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 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
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation setMonitoringService(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetMonitoringServiceRequest,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 Operation setAddonsConfig(String projectId, String zone, String clusterId, 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation setAddonsConfig(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetAddonsConfigRequest,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 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.
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation setLocations(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetLocationsRequest,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 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
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation updateMaster(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateMasterRequest,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 Operation setMasterAuth(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetMasterAuthRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation deleteCluster(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteClusterRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final ListOperationsResponse listOperations(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListOperationsRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation getOperation(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetOperationRequest,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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelOperation(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final ServerConfig getServerConfig(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetServerConfigRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final ListNodePoolsResponse listNodePools(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListNodePoolsRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final NodePool getNodePool(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetNodePoolRequest,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 Operation createNodePool(String projectId, String zone, String clusterId, 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation createNodePool(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateNodePoolRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation deleteNodePool(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteNodePoolRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation rollbackNodePoolUpgrade(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<RollbackNodePoolUpgradeRequest,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 Operation setNodePoolManagement(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetNodePoolManagementRequest,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 Operation setLabels(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetLabelsRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation setLegacyAbac(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetLegacyAbacRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation startIPRotation(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<StartIPRotationRequest,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 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation completeIPRotation(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CompleteIPRotationRequest,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 Operation setNodePoolSize(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetNodePoolSizeRequest,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 Operation setNetworkPolicy(String projectId, String zone, String clusterId, 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation setNetworkPolicy(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetNetworkPolicyRequest,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 Operation setMaintenancePolicy(String projectId, String zone, String clusterId, 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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final Operation setMaintenancePolicy(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetMaintenancePolicyRequest,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 com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.