Class ClusterManagerClient (2.48.0)

GitHub RepositoryProduct ReferenceREST Documentation

Service Description: Google Kubernetes Engine Cluster Manager v1beta1

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   ListClustersResponse response = clusterManagerClient.listClusters(projectId, zone);
 }
 

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

Methods
Method Description Method Variants

ListClusters

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

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listClusters(ListClustersRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listClusters(String projectId, String zone)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listClustersCallable()

GetCluster

Gets the details for a specific cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getCluster(GetClusterRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getCluster(String projectId, String zone, String clusterId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getClusterCallable()

CreateCluster

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

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

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

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

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createCluster(CreateClusterRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createCluster(String projectId, String zone, Cluster cluster)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createClusterCallable()

UpdateCluster

Updates the settings for a specific cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateCluster(UpdateClusterRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateCluster(String projectId, String zone, String clusterId, ClusterUpdate update)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateClusterCallable()

UpdateNodePool

Updates the version and/or image type of a specific node pool.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateNodePool(UpdateNodePoolRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateNodePoolCallable()

SetNodePoolAutoscaling

Sets the autoscaling settings of a specific node pool.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setNodePoolAutoscaling(SetNodePoolAutoscalingRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setNodePoolAutoscalingCallable()

SetLoggingService

Sets the logging service for a specific cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setLoggingService(SetLoggingServiceRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setLoggingService(String projectId, String zone, String clusterId, String loggingService)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setLoggingServiceCallable()

SetMonitoringService

Sets the monitoring service for a specific cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setMonitoringService(SetMonitoringServiceRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setMonitoringService(String projectId, String zone, String clusterId, String monitoringService)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setMonitoringServiceCallable()

SetAddonsConfig

Sets the addons for a specific cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setAddonsConfig(SetAddonsConfigRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setAddonsConfig(String projectId, String zone, String clusterId, AddonsConfig addonsConfig)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setAddonsConfigCallable()

SetLocations

Sets the locations for a specific cluster. Deprecated. Use projects.locations.clusters.update instead.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setLocations(SetLocationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setLocations(String projectId, String zone, String clusterId, List<String> locations)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setLocationsCallable()

UpdateMaster

Updates the master for a specific cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateMaster(UpdateMasterRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateMaster(String projectId, String zone, String clusterId, String masterVersion)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateMasterCallable()

SetMasterAuth

Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setMasterAuth(SetMasterAuthRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setMasterAuthCallable()

DeleteCluster

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

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

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

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteCluster(DeleteClusterRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteCluster(String projectId, String zone, String clusterId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteClusterCallable()

ListOperations

Lists all operations in a project in the specified zone or all zones.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listOperations(ListOperationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listOperations(String projectId, String zone)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listOperationsCallable()

GetOperation

Gets the specified operation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getOperation(GetOperationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getOperation(String projectId, String zone, String operationId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getOperationCallable()

CancelOperation

Cancels the specified operation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • cancelOperation(CancelOperationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • cancelOperation(String projectId, String zone, String operationId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • cancelOperationCallable()

GetServerConfig

Returns configuration info about the Google Kubernetes Engine service.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getServerConfig(GetServerConfigRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getServerConfig(String projectId, String zone)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getServerConfigCallable()

GetJSONWebKeys

Gets the public component of the cluster signing keys in JSON Web Key format.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getJSONWebKeys(GetJSONWebKeysRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getJSONWebKeysCallable()

ListNodePools

Lists the node pools for a cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listNodePools(ListNodePoolsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listNodePools(String projectId, String zone, String clusterId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listNodePoolsCallable()

GetNodePool

Retrieves the requested node pool.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getNodePool(GetNodePoolRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

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

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getNodePoolCallable()

CreateNodePool

Creates a node pool for a cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createNodePool(CreateNodePoolRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

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

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createNodePoolCallable()

DeleteNodePool

Deletes a node pool from a cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteNodePool(DeleteNodePoolRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

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

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteNodePoolCallable()

CompleteNodePoolUpgrade

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

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • completeNodePoolUpgrade(CompleteNodePoolUpgradeRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • completeNodePoolUpgradeCallable()

RollbackNodePoolUpgrade

Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • rollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • rollbackNodePoolUpgrade(String projectId, String zone, String clusterId, String nodePoolId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • rollbackNodePoolUpgradeCallable()

SetNodePoolManagement

Sets the NodeManagement options for a node pool.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setNodePoolManagement(SetNodePoolManagementRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setNodePoolManagement(String projectId, String zone, String clusterId, String nodePoolId, NodeManagement management)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setNodePoolManagementCallable()

SetLabels

Sets labels on a cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setLabels(SetLabelsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setLabels(String projectId, String zone, String clusterId, Map<String, String> resourceLabels, String labelFingerprint)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setLabelsCallable()

SetLegacyAbac

Enables or disables the ABAC authorization mechanism on a cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setLegacyAbac(SetLegacyAbacRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setLegacyAbac(String projectId, String zone, String clusterId, boolean enabled)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setLegacyAbacCallable()

StartIPRotation

Starts master IP rotation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • startIPRotation(StartIPRotationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • startIPRotation(String projectId, String zone, String clusterId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • startIPRotationCallable()

CompleteIPRotation

Completes master IP rotation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • completeIPRotation(CompleteIPRotationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • completeIPRotation(String projectId, String zone, String clusterId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • completeIPRotationCallable()

SetNodePoolSize

SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all replicas, including future replicas created by modifying NodePool.locations.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setNodePoolSize(SetNodePoolSizeRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setNodePoolSizeCallable()

SetNetworkPolicy

Enables or disables Network Policy for a cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setNetworkPolicy(SetNetworkPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setNetworkPolicy(String projectId, String zone, String clusterId, NetworkPolicy networkPolicy)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setNetworkPolicyCallable()

SetMaintenancePolicy

Sets the maintenance policy for a cluster.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setMaintenancePolicy(SetMaintenancePolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setMaintenancePolicy(String projectId, String zone, String clusterId, MaintenancePolicy maintenancePolicy)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setMaintenancePolicyCallable()

ListUsableSubnetworks

Lists subnetworks that can be used for creating clusters in a project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listUsableSubnetworks(ListUsableSubnetworksRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listUsableSubnetworks(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listUsableSubnetworksPagedCallable()

  • listUsableSubnetworksCallable()

CheckAutopilotCompatibility

Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • checkAutopilotCompatibility(CheckAutopilotCompatibilityRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • checkAutopilotCompatibilityCallable()

ListLocations

Fetches locations that offer Google Kubernetes Engine.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listLocations(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsCallable()

See the individual methods for example code.

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

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

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 ClusterManagerSettings clusterManagerSettings =
     ClusterManagerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ClusterManagerClient clusterManagerClient = ClusterManagerClient.create(clusterManagerSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 ClusterManagerSettings clusterManagerSettings =
     ClusterManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
 ClusterManagerClient clusterManagerClient = ClusterManagerClient.create(clusterManagerSettings);
 

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

Inheritance

java.lang.Object > ClusterManagerClient

Static Methods

create()

public static final ClusterManagerClient create()

Constructs an instance of ClusterManagerClient with default settings.

Returns
Type Description
ClusterManagerClient
Exceptions
Type Description
IOException

create(ClusterManagerSettings settings)

public static final ClusterManagerClient create(ClusterManagerSettings settings)

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

Parameter
Name Description
settings ClusterManagerSettings
Returns
Type Description
ClusterManagerClient
Exceptions
Type Description
IOException

create(ClusterManagerStub stub)

public static final ClusterManagerClient create(ClusterManagerStub stub)

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

Parameter
Name Description
stub ClusterManagerStub
Returns
Type Description
ClusterManagerClient

Constructors

ClusterManagerClient(ClusterManagerSettings settings)

protected ClusterManagerClient(ClusterManagerSettings settings)

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

Parameter
Name Description
settings ClusterManagerSettings

ClusterManagerClient(ClusterManagerStub stub)

protected ClusterManagerClient(ClusterManagerStub stub)
Parameter
Name Description
stub ClusterManagerStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

cancelOperation(CancelOperationRequest request)

public final void cancelOperation(CancelOperationRequest request)

Cancels the specified operation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CancelOperationRequest request =
       CancelOperationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setOperationId("operationId129704162")
           .setName("name3373707")
           .build();
   clusterManagerClient.cancelOperation(request);
 }
 
Parameter
Name Description
request CancelOperationRequest

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

cancelOperation(String projectId, String zone, String operationId)

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

Cancels the specified operation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String operationId = "operationId129704162";
   clusterManagerClient.cancelOperation(projectId, zone, operationId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

operationId String

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

cancelOperationCallable()

public final UnaryCallable<CancelOperationRequest,Empty> cancelOperationCallable()

Cancels the specified operation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CancelOperationRequest request =
       CancelOperationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setOperationId("operationId129704162")
           .setName("name3373707")
           .build();
   ApiFuture<Empty> future = clusterManagerClient.cancelOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<CancelOperationRequest,Empty>

checkAutopilotCompatibility(CheckAutopilotCompatibilityRequest request)

public final CheckAutopilotCompatibilityResponse checkAutopilotCompatibility(CheckAutopilotCompatibilityRequest request)

Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CheckAutopilotCompatibilityRequest request =
       CheckAutopilotCompatibilityRequest.newBuilder().setName("name3373707").build();
   CheckAutopilotCompatibilityResponse response =
       clusterManagerClient.checkAutopilotCompatibility(request);
 }
 
Parameter
Name Description
request CheckAutopilotCompatibilityRequest

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

Returns
Type Description
CheckAutopilotCompatibilityResponse

checkAutopilotCompatibilityCallable()

public final UnaryCallable<CheckAutopilotCompatibilityRequest,CheckAutopilotCompatibilityResponse> checkAutopilotCompatibilityCallable()

Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CheckAutopilotCompatibilityRequest request =
       CheckAutopilotCompatibilityRequest.newBuilder().setName("name3373707").build();
   ApiFuture<CheckAutopilotCompatibilityResponse> future =
       clusterManagerClient.checkAutopilotCompatibilityCallable().futureCall(request);
   // Do something.
   CheckAutopilotCompatibilityResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CheckAutopilotCompatibilityRequest,CheckAutopilotCompatibilityResponse>

close()

public final void close()

completeIPRotation(CompleteIPRotationRequest request)

public final Operation completeIPRotation(CompleteIPRotationRequest request)

Completes master IP rotation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CompleteIPRotationRequest request =
       CompleteIPRotationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.completeIPRotation(request);
 }
 
Parameter
Name Description
request CompleteIPRotationRequest

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

Returns
Type Description
Operation

completeIPRotation(String projectId, String zone, String clusterId)

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

Completes master IP rotation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   Operation response = clusterManagerClient.completeIPRotation(projectId, zone, clusterId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

Returns
Type Description
Operation

completeIPRotationCallable()

public final UnaryCallable<CompleteIPRotationRequest,Operation> completeIPRotationCallable()

Completes master IP rotation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CompleteIPRotationRequest request =
       CompleteIPRotationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.completeIPRotationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CompleteIPRotationRequest,Operation>

completeNodePoolUpgrade(CompleteNodePoolUpgradeRequest request)

public final void completeNodePoolUpgrade(CompleteNodePoolUpgradeRequest request)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CompleteNodePoolUpgradeRequest request =
       CompleteNodePoolUpgradeRequest.newBuilder().setName("name3373707").build();
   clusterManagerClient.completeNodePoolUpgrade(request);
 }
 
Parameter
Name Description
request CompleteNodePoolUpgradeRequest

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

completeNodePoolUpgradeCallable()

public final UnaryCallable<CompleteNodePoolUpgradeRequest,Empty> completeNodePoolUpgradeCallable()

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CompleteNodePoolUpgradeRequest request =
       CompleteNodePoolUpgradeRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Empty> future =
       clusterManagerClient.completeNodePoolUpgradeCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<CompleteNodePoolUpgradeRequest,Empty>

createCluster(CreateClusterRequest request)

public final Operation createCluster(CreateClusterRequest request)

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

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

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

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CreateClusterRequest request =
       CreateClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setCluster(Cluster.newBuilder().build())
           .setParent("parent-995424086")
           .build();
   Operation response = clusterManagerClient.createCluster(request);
 }
 
Parameter
Name Description
request CreateClusterRequest

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

Returns
Type Description
Operation

createCluster(String projectId, String zone, Cluster cluster)

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

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

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

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

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   Cluster cluster = Cluster.newBuilder().build();
   Operation response = clusterManagerClient.createCluster(projectId, zone, cluster);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

cluster Cluster

Required. A cluster resource

Returns
Type Description
Operation

createClusterCallable()

public final UnaryCallable<CreateClusterRequest,Operation> createClusterCallable()

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

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

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

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CreateClusterRequest request =
       CreateClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setCluster(Cluster.newBuilder().build())
           .setParent("parent-995424086")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.createClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateClusterRequest,Operation>

createNodePool(CreateNodePoolRequest request)

public final Operation createNodePool(CreateNodePoolRequest request)

Creates a node pool for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CreateNodePoolRequest request =
       CreateNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePool(NodePool.newBuilder().build())
           .setParent("parent-995424086")
           .build();
   Operation response = clusterManagerClient.createNodePool(request);
 }
 
Parameter
Name Description
request CreateNodePoolRequest

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

Returns
Type Description
Operation

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

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

Creates a node pool for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   NodePool nodePool = NodePool.newBuilder().build();
   Operation response =
       clusterManagerClient.createNodePool(projectId, zone, clusterId, nodePool);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

nodePool NodePool

Required. The node pool to create.

Returns
Type Description
Operation

createNodePoolCallable()

public final UnaryCallable<CreateNodePoolRequest,Operation> createNodePoolCallable()

Creates a node pool for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   CreateNodePoolRequest request =
       CreateNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePool(NodePool.newBuilder().build())
           .setParent("parent-995424086")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.createNodePoolCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateNodePoolRequest,Operation>

deleteCluster(DeleteClusterRequest request)

public final Operation deleteCluster(DeleteClusterRequest request)

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

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

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   DeleteClusterRequest request =
       DeleteClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.deleteCluster(request);
 }
 
Parameter
Name Description
request DeleteClusterRequest

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

Returns
Type Description
Operation

deleteCluster(String projectId, String zone, String clusterId)

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

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

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

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   Operation response = clusterManagerClient.deleteCluster(projectId, zone, clusterId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

Returns
Type Description
Operation

deleteClusterCallable()

public final UnaryCallable<DeleteClusterRequest,Operation> deleteClusterCallable()

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

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

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   DeleteClusterRequest request =
       DeleteClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.deleteClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteClusterRequest,Operation>

deleteNodePool(DeleteNodePoolRequest request)

public final Operation deleteNodePool(DeleteNodePoolRequest request)

Deletes a node pool from a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   DeleteNodePoolRequest request =
       DeleteNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.deleteNodePool(request);
 }
 
Parameter
Name Description
request DeleteNodePoolRequest

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

Returns
Type Description
Operation

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

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

Deletes a node pool from a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   String nodePoolId = "nodePoolId1121557241";
   Operation response =
       clusterManagerClient.deleteNodePool(projectId, zone, clusterId, nodePoolId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

nodePoolId String

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

Returns
Type Description
Operation

deleteNodePoolCallable()

public final UnaryCallable<DeleteNodePoolRequest,Operation> deleteNodePoolCallable()

Deletes a node pool from a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   DeleteNodePoolRequest request =
       DeleteNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.deleteNodePoolCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteNodePoolRequest,Operation>

getCluster(GetClusterRequest request)

public final Cluster getCluster(GetClusterRequest request)

Gets the details for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetClusterRequest request =
       GetClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   Cluster response = clusterManagerClient.getCluster(request);
 }
 
Parameter
Name Description
request GetClusterRequest

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

Returns
Type Description
Cluster

getCluster(String projectId, String zone, String clusterId)

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

Gets the details for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   Cluster response = clusterManagerClient.getCluster(projectId, zone, clusterId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

Returns
Type Description
Cluster

getClusterCallable()

public final UnaryCallable<GetClusterRequest,Cluster> getClusterCallable()

Gets the details for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetClusterRequest request =
       GetClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .build();
   ApiFuture<Cluster> future = clusterManagerClient.getClusterCallable().futureCall(request);
   // Do something.
   Cluster response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetClusterRequest,Cluster>

getJSONWebKeys(GetJSONWebKeysRequest request)

public final GetJSONWebKeysResponse getJSONWebKeys(GetJSONWebKeysRequest request)

Gets the public component of the cluster signing keys in JSON Web Key format.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetJSONWebKeysRequest request =
       GetJSONWebKeysRequest.newBuilder().setParent("parent-995424086").build();
   GetJSONWebKeysResponse response = clusterManagerClient.getJSONWebKeys(request);
 }
 
Parameter
Name Description
request GetJSONWebKeysRequest

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

Returns
Type Description
GetJSONWebKeysResponse

getJSONWebKeysCallable()

public final UnaryCallable<GetJSONWebKeysRequest,GetJSONWebKeysResponse> getJSONWebKeysCallable()

Gets the public component of the cluster signing keys in JSON Web Key format.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetJSONWebKeysRequest request =
       GetJSONWebKeysRequest.newBuilder().setParent("parent-995424086").build();
   ApiFuture<GetJSONWebKeysResponse> future =
       clusterManagerClient.getJSONWebKeysCallable().futureCall(request);
   // Do something.
   GetJSONWebKeysResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetJSONWebKeysRequest,GetJSONWebKeysResponse>

getNodePool(GetNodePoolRequest request)

public final NodePool getNodePool(GetNodePoolRequest request)

Retrieves the requested node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetNodePoolRequest request =
       GetNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .build();
   NodePool response = clusterManagerClient.getNodePool(request);
 }
 
Parameter
Name Description
request GetNodePoolRequest

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

Returns
Type Description
NodePool

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

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

Retrieves the requested node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   String nodePoolId = "nodePoolId1121557241";
   NodePool response = clusterManagerClient.getNodePool(projectId, zone, clusterId, nodePoolId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

nodePoolId String

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

Returns
Type Description
NodePool

getNodePoolCallable()

public final UnaryCallable<GetNodePoolRequest,NodePool> getNodePoolCallable()

Retrieves the requested node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetNodePoolRequest request =
       GetNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .build();
   ApiFuture<NodePool> future = clusterManagerClient.getNodePoolCallable().futureCall(request);
   // Do something.
   NodePool response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetNodePoolRequest,NodePool>

getOperation(GetOperationRequest request)

public final Operation getOperation(GetOperationRequest request)

Gets the specified operation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetOperationRequest request =
       GetOperationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setOperationId("operationId129704162")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.getOperation(request);
 }
 
Parameter
Name Description
request GetOperationRequest

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

Returns
Type Description
Operation

getOperation(String projectId, String zone, String operationId)

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

Gets the specified operation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String operationId = "operationId129704162";
   Operation response = clusterManagerClient.getOperation(projectId, zone, operationId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

operationId String

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

Returns
Type Description
Operation

getOperationCallable()

public final UnaryCallable<GetOperationRequest,Operation> getOperationCallable()

Gets the specified operation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetOperationRequest request =
       GetOperationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setOperationId("operationId129704162")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future = clusterManagerClient.getOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetOperationRequest,Operation>

getServerConfig(GetServerConfigRequest request)

public final ServerConfig getServerConfig(GetServerConfigRequest request)

Returns configuration info about the Google Kubernetes Engine service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetServerConfigRequest request =
       GetServerConfigRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setName("name3373707")
           .build();
   ServerConfig response = clusterManagerClient.getServerConfig(request);
 }
 
Parameter
Name Description
request GetServerConfigRequest

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

Returns
Type Description
ServerConfig

getServerConfig(String projectId, String zone)

public final ServerConfig getServerConfig(String projectId, String zone)

Returns configuration info about the Google Kubernetes Engine service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   ServerConfig response = clusterManagerClient.getServerConfig(projectId, zone);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

Returns
Type Description
ServerConfig

getServerConfigCallable()

public final UnaryCallable<GetServerConfigRequest,ServerConfig> getServerConfigCallable()

Returns configuration info about the Google Kubernetes Engine service.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   GetServerConfigRequest request =
       GetServerConfigRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setName("name3373707")
           .build();
   ApiFuture<ServerConfig> future =
       clusterManagerClient.getServerConfigCallable().futureCall(request);
   // Do something.
   ServerConfig response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetServerConfigRequest,ServerConfig>

getSettings()

public final ClusterManagerSettings getSettings()
Returns
Type Description
ClusterManagerSettings

getStub()

public ClusterManagerStub getStub()
Returns
Type Description
ClusterManagerStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listClusters(ListClustersRequest request)

public final ListClustersResponse listClusters(ListClustersRequest request)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListClustersRequest request =
       ListClustersRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setParent("parent-995424086")
           .build();
   ListClustersResponse response = clusterManagerClient.listClusters(request);
 }
 
Parameter
Name Description
request ListClustersRequest

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

Returns
Type Description
ListClustersResponse

listClusters(String projectId, String zone)

public final ListClustersResponse listClusters(String projectId, String zone)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   ListClustersResponse response = clusterManagerClient.listClusters(projectId, zone);
 }
 
Parameters
Name Description
projectId String

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

zone String

Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field.

Returns
Type Description
ListClustersResponse

listClustersCallable()

public final UnaryCallable<ListClustersRequest,ListClustersResponse> listClustersCallable()

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListClustersRequest request =
       ListClustersRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setParent("parent-995424086")
           .build();
   ApiFuture<ListClustersResponse> future =
       clusterManagerClient.listClustersCallable().futureCall(request);
   // Do something.
   ListClustersResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ListClustersRequest,ListClustersResponse>

listLocations(ListLocationsRequest request)

public final ListLocationsResponse listLocations(ListLocationsRequest request)

Fetches locations that offer Google Kubernetes Engine.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder().setParent("parent-995424086").build();
   ListLocationsResponse response = clusterManagerClient.listLocations(request);
 }
 
Parameter
Name Description
request ListLocationsRequest

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

Returns
Type Description
ListLocationsResponse

listLocations(String parent)

public final ListLocationsResponse listLocations(String parent)

Fetches locations that offer Google Kubernetes Engine.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String parent = "parent-995424086";
   ListLocationsResponse response = clusterManagerClient.listLocations(parent);
 }
 
Parameter
Name Description
parent String

Required. Contains the name of the resource requested. Specified in the format projects/*.

Returns
Type Description
ListLocationsResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Fetches locations that offer Google Kubernetes Engine.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder().setParent("parent-995424086").build();
   ApiFuture<ListLocationsResponse> future =
       clusterManagerClient.listLocationsCallable().futureCall(request);
   // Do something.
   ListLocationsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ListLocationsRequest,ListLocationsResponse>

listNodePools(ListNodePoolsRequest request)

public final ListNodePoolsResponse listNodePools(ListNodePoolsRequest request)

Lists the node pools for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListNodePoolsRequest request =
       ListNodePoolsRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setParent("parent-995424086")
           .build();
   ListNodePoolsResponse response = clusterManagerClient.listNodePools(request);
 }
 
Parameter
Name Description
request ListNodePoolsRequest

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

Returns
Type Description
ListNodePoolsResponse

listNodePools(String projectId, String zone, String clusterId)

public final ListNodePoolsResponse listNodePools(String projectId, String zone, String clusterId)

Lists the node pools for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   ListNodePoolsResponse response =
       clusterManagerClient.listNodePools(projectId, zone, clusterId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

Returns
Type Description
ListNodePoolsResponse

listNodePoolsCallable()

public final UnaryCallable<ListNodePoolsRequest,ListNodePoolsResponse> listNodePoolsCallable()

Lists the node pools for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListNodePoolsRequest request =
       ListNodePoolsRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setParent("parent-995424086")
           .build();
   ApiFuture<ListNodePoolsResponse> future =
       clusterManagerClient.listNodePoolsCallable().futureCall(request);
   // Do something.
   ListNodePoolsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ListNodePoolsRequest,ListNodePoolsResponse>

listOperations(ListOperationsRequest request)

public final ListOperationsResponse listOperations(ListOperationsRequest request)

Lists all operations in a project in the specified zone or all zones.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListOperationsRequest request =
       ListOperationsRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setParent("parent-995424086")
           .build();
   ListOperationsResponse response = clusterManagerClient.listOperations(request);
 }
 
Parameter
Name Description
request ListOperationsRequest

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

Returns
Type Description
ListOperationsResponse

listOperations(String projectId, String zone)

public final ListOperationsResponse listOperations(String projectId, String zone)

Lists all operations in a project in the specified zone or all zones.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   ListOperationsResponse response = clusterManagerClient.listOperations(projectId, zone);
 }
 
Parameters
Name Description
projectId String

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

zone String

Required. Deprecated. The name of the Google Compute Engine zone to return operations for, or - for all zones. This field has been deprecated and replaced by the parent field.

Returns
Type Description
ListOperationsResponse

listOperationsCallable()

public final UnaryCallable<ListOperationsRequest,ListOperationsResponse> listOperationsCallable()

Lists all operations in a project in the specified zone or all zones.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListOperationsRequest request =
       ListOperationsRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setParent("parent-995424086")
           .build();
   ApiFuture<ListOperationsResponse> future =
       clusterManagerClient.listOperationsCallable().futureCall(request);
   // Do something.
   ListOperationsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ListOperationsRequest,ListOperationsResponse>

listUsableSubnetworks(ListUsableSubnetworksRequest request)

public final ClusterManagerClient.ListUsableSubnetworksPagedResponse listUsableSubnetworks(ListUsableSubnetworksRequest request)

Lists subnetworks that can be used for creating clusters in a project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListUsableSubnetworksRequest request =
       ListUsableSubnetworksRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (UsableSubnetwork element :
       clusterManagerClient.listUsableSubnetworks(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListUsableSubnetworksRequest

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

Returns
Type Description
ClusterManagerClient.ListUsableSubnetworksPagedResponse

listUsableSubnetworks(String parent)

public final ClusterManagerClient.ListUsableSubnetworksPagedResponse listUsableSubnetworks(String parent)

Lists subnetworks that can be used for creating clusters in a project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String parent = "parent-995424086";
   for (UsableSubnetwork element :
       clusterManagerClient.listUsableSubnetworks(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent project where subnetworks are usable. Specified in the format projects/*.

Returns
Type Description
ClusterManagerClient.ListUsableSubnetworksPagedResponse

listUsableSubnetworksCallable()

public final UnaryCallable<ListUsableSubnetworksRequest,ListUsableSubnetworksResponse> listUsableSubnetworksCallable()

Lists subnetworks that can be used for creating clusters in a project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListUsableSubnetworksRequest request =
       ListUsableSubnetworksRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListUsableSubnetworksResponse response =
         clusterManagerClient.listUsableSubnetworksCallable().call(request);
     for (UsableSubnetwork element : response.getSubnetworksList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListUsableSubnetworksRequest,ListUsableSubnetworksResponse>

listUsableSubnetworksPagedCallable()

public final UnaryCallable<ListUsableSubnetworksRequest,ClusterManagerClient.ListUsableSubnetworksPagedResponse> listUsableSubnetworksPagedCallable()

Lists subnetworks that can be used for creating clusters in a project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   ListUsableSubnetworksRequest request =
       ListUsableSubnetworksRequest.newBuilder()
           .setParent("parent-995424086")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<UsableSubnetwork> future =
       clusterManagerClient.listUsableSubnetworksPagedCallable().futureCall(request);
   // Do something.
   for (UsableSubnetwork element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListUsableSubnetworksRequest,ListUsableSubnetworksPagedResponse>

rollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest request)

public final Operation rollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest request)

Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   RollbackNodePoolUpgradeRequest request =
       RollbackNodePoolUpgradeRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .setRespectPdb(true)
           .build();
   Operation response = clusterManagerClient.rollbackNodePoolUpgrade(request);
 }
 
Parameter
Name Description
request RollbackNodePoolUpgradeRequest

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

Returns
Type Description
Operation

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

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

Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   String nodePoolId = "nodePoolId1121557241";
   Operation response =
       clusterManagerClient.rollbackNodePoolUpgrade(projectId, zone, clusterId, nodePoolId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

nodePoolId String

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

Returns
Type Description
Operation

rollbackNodePoolUpgradeCallable()

public final UnaryCallable<RollbackNodePoolUpgradeRequest,Operation> rollbackNodePoolUpgradeCallable()

Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   RollbackNodePoolUpgradeRequest request =
       RollbackNodePoolUpgradeRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setName("name3373707")
           .setRespectPdb(true)
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.rollbackNodePoolUpgradeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<RollbackNodePoolUpgradeRequest,Operation>

setAddonsConfig(SetAddonsConfigRequest request)

public final Operation setAddonsConfig(SetAddonsConfigRequest request)

Sets the addons for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetAddonsConfigRequest request =
       SetAddonsConfigRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setAddonsConfig(AddonsConfig.newBuilder().build())
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setAddonsConfig(request);
 }
 
Parameter
Name Description
request SetAddonsConfigRequest

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

Returns
Type Description
Operation

setAddonsConfig(String projectId, String zone, String clusterId, AddonsConfig addonsConfig)

public final Operation setAddonsConfig(String projectId, String zone, String clusterId, AddonsConfig addonsConfig)

Sets the addons for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   AddonsConfig addonsConfig = AddonsConfig.newBuilder().build();
   Operation response =
       clusterManagerClient.setAddonsConfig(projectId, zone, clusterId, addonsConfig);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

addonsConfig AddonsConfig

Required. The desired configurations for the various addons available to run in the cluster.

Returns
Type Description
Operation

setAddonsConfigCallable()

public final UnaryCallable<SetAddonsConfigRequest,Operation> setAddonsConfigCallable()

Sets the addons for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetAddonsConfigRequest request =
       SetAddonsConfigRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setAddonsConfig(AddonsConfig.newBuilder().build())
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setAddonsConfigCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetAddonsConfigRequest,Operation>

setLabels(SetLabelsRequest request)

public final Operation setLabels(SetLabelsRequest request)

Sets labels on a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetLabelsRequest request =
       SetLabelsRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .putAllResourceLabels(new HashMap<String, String>())
           .setLabelFingerprint("labelFingerprint379449680")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setLabels(request);
 }
 
Parameter
Name Description
request SetLabelsRequest

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

Returns
Type Description
Operation

setLabels(String projectId, String zone, String clusterId, Map<String,String> resourceLabels, String labelFingerprint)

public final Operation setLabels(String projectId, String zone, String clusterId, Map<String,String> resourceLabels, String labelFingerprint)

Sets labels on a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   Map<String, String> resourceLabels = new HashMap<>();
   String labelFingerprint = "labelFingerprint379449680";
   Operation response =
       clusterManagerClient.setLabels(
           projectId, zone, clusterId, resourceLabels, labelFingerprint);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

resourceLabels Map<String,String>

Required. The labels to set for that cluster.

labelFingerprint String

Required. The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Kubernetes Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels. Make a get() request to the resource to get the latest fingerprint.

Returns
Type Description
Operation

setLabelsCallable()

public final UnaryCallable<SetLabelsRequest,Operation> setLabelsCallable()

Sets labels on a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetLabelsRequest request =
       SetLabelsRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .putAllResourceLabels(new HashMap<String, String>())
           .setLabelFingerprint("labelFingerprint379449680")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future = clusterManagerClient.setLabelsCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetLabelsRequest,Operation>

setLegacyAbac(SetLegacyAbacRequest request)

public final Operation setLegacyAbac(SetLegacyAbacRequest request)

Enables or disables the ABAC authorization mechanism on a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetLegacyAbacRequest request =
       SetLegacyAbacRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setEnabled(true)
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setLegacyAbac(request);
 }
 
Parameter
Name Description
request SetLegacyAbacRequest

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

Returns
Type Description
Operation

setLegacyAbac(String projectId, String zone, String clusterId, boolean enabled)

public final Operation setLegacyAbac(String projectId, String zone, String clusterId, boolean enabled)

Enables or disables the ABAC authorization mechanism on a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   boolean enabled = true;
   Operation response = clusterManagerClient.setLegacyAbac(projectId, zone, clusterId, enabled);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

enabled boolean

Required. Whether ABAC authorization will be enabled in the cluster.

Returns
Type Description
Operation

setLegacyAbacCallable()

public final UnaryCallable<SetLegacyAbacRequest,Operation> setLegacyAbacCallable()

Enables or disables the ABAC authorization mechanism on a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetLegacyAbacRequest request =
       SetLegacyAbacRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setEnabled(true)
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setLegacyAbacCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetLegacyAbacRequest,Operation>

setLocations(SetLocationsRequest request) (deprecated)

public final Operation setLocations(SetLocationsRequest request)

Deprecated. This method is deprecated and will be removed in the next major version update.

Sets the locations for a specific cluster. Deprecated. Use projects.locations.clusters.update instead.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetLocationsRequest request =
       SetLocationsRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .addAllLocations(new ArrayList<String>())
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setLocations(request);
 }
 
Parameter
Name Description
request SetLocationsRequest

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

Returns
Type Description
Operation

setLocations(String projectId, String zone, String clusterId, List<String> locations) (deprecated)

public final Operation setLocations(String projectId, String zone, String clusterId, List<String> locations)

Deprecated. This method is deprecated and will be removed in the next major version update.

Sets the locations for a specific cluster. Deprecated. Use projects.locations.clusters.update instead.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   List<String> locations = new ArrayList<>();
   Operation response = clusterManagerClient.setLocations(projectId, zone, clusterId, locations);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

locations List<String>

Required. The desired list of Google Compute Engine zones 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.

Returns
Type Description
Operation

setLocationsCallable() (deprecated)

public final UnaryCallable<SetLocationsRequest,Operation> setLocationsCallable()

Deprecated. This method is deprecated and will be removed in the next major version update.

Sets the locations for a specific cluster. Deprecated. Use projects.locations.clusters.update instead.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetLocationsRequest request =
       SetLocationsRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .addAllLocations(new ArrayList<String>())
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future = clusterManagerClient.setLocationsCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetLocationsRequest,Operation>

setLoggingService(SetLoggingServiceRequest request)

public final Operation setLoggingService(SetLoggingServiceRequest request)

Sets the logging service for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetLoggingServiceRequest request =
       SetLoggingServiceRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setLoggingService("loggingService1098570326")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setLoggingService(request);
 }
 
Parameter
Name Description
request SetLoggingServiceRequest

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

Returns
Type Description
Operation

setLoggingService(String projectId, String zone, String clusterId, String loggingService)

public final Operation setLoggingService(String projectId, String zone, String clusterId, String loggingService)

Sets the logging service for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   String loggingService = "loggingService1098570326";
   Operation response =
       clusterManagerClient.setLoggingService(projectId, zone, clusterId, loggingService);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

loggingService String

Required. The logging service the cluster should use to write logs. Currently available options:

  • logging.googleapis.com/kubernetes - The Cloud Logging service with a Kubernetes-native resource model
  • logging.googleapis.com - The legacy Cloud Logging service (no longer available as of GKE 1.15).
  • none - no logs will be exported from the cluster.

If left as an empty string,logging.googleapis.com/kubernetes will be used for GKE 1.14+ or logging.googleapis.com for earlier versions.

Returns
Type Description
Operation

setLoggingServiceCallable()

public final UnaryCallable<SetLoggingServiceRequest,Operation> setLoggingServiceCallable()

Sets the logging service for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetLoggingServiceRequest request =
       SetLoggingServiceRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setLoggingService("loggingService1098570326")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setLoggingServiceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetLoggingServiceRequest,Operation>

setMaintenancePolicy(SetMaintenancePolicyRequest request)

public final Operation setMaintenancePolicy(SetMaintenancePolicyRequest request)

Sets the maintenance policy for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetMaintenancePolicyRequest request =
       SetMaintenancePolicyRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setMaintenancePolicy(MaintenancePolicy.newBuilder().build())
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setMaintenancePolicy(request);
 }
 
Parameter
Name Description
request SetMaintenancePolicyRequest

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

Returns
Type Description
Operation

setMaintenancePolicy(String projectId, String zone, String clusterId, MaintenancePolicy maintenancePolicy)

public final Operation setMaintenancePolicy(String projectId, String zone, String clusterId, MaintenancePolicy maintenancePolicy)

Sets the maintenance policy for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build();
   Operation response =
       clusterManagerClient.setMaintenancePolicy(projectId, zone, clusterId, maintenancePolicy);
 }
 
Parameters
Name Description
projectId String

Required. The Google Developers Console project ID or project number.

zone String

Required. The name of the Google Compute Engine zone in which the cluster resides.

clusterId String

Required. The name of the cluster to update.

maintenancePolicy MaintenancePolicy

Required. The maintenance policy to be set for the cluster. An empty field clears the existing maintenance policy.

Returns
Type Description
Operation

setMaintenancePolicyCallable()

public final UnaryCallable<SetMaintenancePolicyRequest,Operation> setMaintenancePolicyCallable()

Sets the maintenance policy for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetMaintenancePolicyRequest request =
       SetMaintenancePolicyRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setMaintenancePolicy(MaintenancePolicy.newBuilder().build())
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setMaintenancePolicyCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetMaintenancePolicyRequest,Operation>

setMasterAuth(SetMasterAuthRequest request)

public final Operation setMasterAuth(SetMasterAuthRequest request)

Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetMasterAuthRequest request =
       SetMasterAuthRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setUpdate(MasterAuth.newBuilder().build())
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setMasterAuth(request);
 }
 
Parameter
Name Description
request SetMasterAuthRequest

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

Returns
Type Description
Operation

setMasterAuthCallable()

public final UnaryCallable<SetMasterAuthRequest,Operation> setMasterAuthCallable()

Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetMasterAuthRequest request =
       SetMasterAuthRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setUpdate(MasterAuth.newBuilder().build())
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setMasterAuthCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetMasterAuthRequest,Operation>

setMonitoringService(SetMonitoringServiceRequest request)

public final Operation setMonitoringService(SetMonitoringServiceRequest request)

Sets the monitoring service for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetMonitoringServiceRequest request =
       SetMonitoringServiceRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setMonitoringService("monitoringService-1431578291")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setMonitoringService(request);
 }
 
Parameter
Name Description
request SetMonitoringServiceRequest

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

Returns
Type Description
Operation

setMonitoringService(String projectId, String zone, String clusterId, String monitoringService)

public final Operation setMonitoringService(String projectId, String zone, String clusterId, String monitoringService)

Sets the monitoring service for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   String monitoringService = "monitoringService-1431578291";
   Operation response =
       clusterManagerClient.setMonitoringService(projectId, zone, clusterId, monitoringService);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

monitoringService String

Required. The monitoring service the cluster should use to write metrics. Currently available options:

  • "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring service with a Kubernetes-native resource model
  • monitoring.googleapis.com - The legacy Cloud Monitoring service (no longer available as of GKE 1.15).
  • none - No metrics will be exported from the cluster.

If left as an empty string,monitoring.googleapis.com/kubernetes will be used for GKE 1.14+ or monitoring.googleapis.com for earlier versions.

Returns
Type Description
Operation

setMonitoringServiceCallable()

public final UnaryCallable<SetMonitoringServiceRequest,Operation> setMonitoringServiceCallable()

Sets the monitoring service for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetMonitoringServiceRequest request =
       SetMonitoringServiceRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setMonitoringService("monitoringService-1431578291")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setMonitoringServiceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetMonitoringServiceRequest,Operation>

setNetworkPolicy(SetNetworkPolicyRequest request)

public final Operation setNetworkPolicy(SetNetworkPolicyRequest request)

Enables or disables Network Policy for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetNetworkPolicyRequest request =
       SetNetworkPolicyRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNetworkPolicy(NetworkPolicy.newBuilder().build())
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setNetworkPolicy(request);
 }
 
Parameter
Name Description
request SetNetworkPolicyRequest

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

Returns
Type Description
Operation

setNetworkPolicy(String projectId, String zone, String clusterId, NetworkPolicy networkPolicy)

public final Operation setNetworkPolicy(String projectId, String zone, String clusterId, NetworkPolicy networkPolicy)

Enables or disables Network Policy for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   NetworkPolicy networkPolicy = NetworkPolicy.newBuilder().build();
   Operation response =
       clusterManagerClient.setNetworkPolicy(projectId, zone, clusterId, networkPolicy);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

networkPolicy NetworkPolicy

Required. Configuration options for the NetworkPolicy feature.

Returns
Type Description
Operation

setNetworkPolicyCallable()

public final UnaryCallable<SetNetworkPolicyRequest,Operation> setNetworkPolicyCallable()

Enables or disables Network Policy for a cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetNetworkPolicyRequest request =
       SetNetworkPolicyRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNetworkPolicy(NetworkPolicy.newBuilder().build())
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setNetworkPolicyCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetNetworkPolicyRequest,Operation>

setNodePoolAutoscaling(SetNodePoolAutoscalingRequest request)

public final Operation setNodePoolAutoscaling(SetNodePoolAutoscalingRequest request)

Sets the autoscaling settings of a specific node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetNodePoolAutoscalingRequest request =
       SetNodePoolAutoscalingRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setAutoscaling(NodePoolAutoscaling.newBuilder().build())
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setNodePoolAutoscaling(request);
 }
 
Parameter
Name Description
request SetNodePoolAutoscalingRequest

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

Returns
Type Description
Operation

setNodePoolAutoscalingCallable()

public final UnaryCallable<SetNodePoolAutoscalingRequest,Operation> setNodePoolAutoscalingCallable()

Sets the autoscaling settings of a specific node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetNodePoolAutoscalingRequest request =
       SetNodePoolAutoscalingRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setAutoscaling(NodePoolAutoscaling.newBuilder().build())
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setNodePoolAutoscalingCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetNodePoolAutoscalingRequest,Operation>

setNodePoolManagement(SetNodePoolManagementRequest request)

public final Operation setNodePoolManagement(SetNodePoolManagementRequest request)

Sets the NodeManagement options for a node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetNodePoolManagementRequest request =
       SetNodePoolManagementRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setManagement(NodeManagement.newBuilder().build())
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setNodePoolManagement(request);
 }
 
Parameter
Name Description
request SetNodePoolManagementRequest

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

Returns
Type Description
Operation

setNodePoolManagement(String projectId, String zone, String clusterId, String nodePoolId, NodeManagement management)

public final Operation setNodePoolManagement(String projectId, String zone, String clusterId, String nodePoolId, NodeManagement management)

Sets the NodeManagement options for a node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   String nodePoolId = "nodePoolId1121557241";
   NodeManagement management = NodeManagement.newBuilder().build();
   Operation response =
       clusterManagerClient.setNodePoolManagement(
           projectId, zone, clusterId, nodePoolId, management);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

nodePoolId String

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

management NodeManagement

Required. NodeManagement configuration for the node pool.

Returns
Type Description
Operation

setNodePoolManagementCallable()

public final UnaryCallable<SetNodePoolManagementRequest,Operation> setNodePoolManagementCallable()

Sets the NodeManagement options for a node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetNodePoolManagementRequest request =
       SetNodePoolManagementRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setManagement(NodeManagement.newBuilder().build())
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setNodePoolManagementCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetNodePoolManagementRequest,Operation>

setNodePoolSize(SetNodePoolSizeRequest request)

public final Operation setNodePoolSize(SetNodePoolSizeRequest request)

SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all replicas, including future replicas created by modifying NodePool.locations.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetNodePoolSizeRequest request =
       SetNodePoolSizeRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setNodeCount(1539922066)
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.setNodePoolSize(request);
 }
 
Parameter
Name Description
request SetNodePoolSizeRequest

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

Returns
Type Description
Operation

setNodePoolSizeCallable()

public final UnaryCallable<SetNodePoolSizeRequest,Operation> setNodePoolSizeCallable()

SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all replicas, including future replicas created by modifying NodePool.locations.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   SetNodePoolSizeRequest request =
       SetNodePoolSizeRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setNodeCount(1539922066)
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.setNodePoolSizeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetNodePoolSizeRequest,Operation>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

startIPRotation(StartIPRotationRequest request)

public final Operation startIPRotation(StartIPRotationRequest request)

Starts master IP rotation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   StartIPRotationRequest request =
       StartIPRotationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .setRotateCredentials(true)
           .build();
   Operation response = clusterManagerClient.startIPRotation(request);
 }
 
Parameter
Name Description
request StartIPRotationRequest

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

Returns
Type Description
Operation

startIPRotation(String projectId, String zone, String clusterId)

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

Starts master IP rotation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   Operation response = clusterManagerClient.startIPRotation(projectId, zone, clusterId);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

Returns
Type Description
Operation

startIPRotationCallable()

public final UnaryCallable<StartIPRotationRequest,Operation> startIPRotationCallable()

Starts master IP rotation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   StartIPRotationRequest request =
       StartIPRotationRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setName("name3373707")
           .setRotateCredentials(true)
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.startIPRotationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<StartIPRotationRequest,Operation>

updateCluster(UpdateClusterRequest request)

public final Operation updateCluster(UpdateClusterRequest request)

Updates the settings for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   UpdateClusterRequest request =
       UpdateClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setUpdate(ClusterUpdate.newBuilder().build())
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.updateCluster(request);
 }
 
Parameter
Name Description
request UpdateClusterRequest

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

Returns
Type Description
Operation

updateCluster(String projectId, String zone, String clusterId, ClusterUpdate update)

public final Operation updateCluster(String projectId, String zone, String clusterId, ClusterUpdate update)

Updates the settings for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   ClusterUpdate update = ClusterUpdate.newBuilder().build();
   Operation response = clusterManagerClient.updateCluster(projectId, zone, clusterId, update);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

update ClusterUpdate

Required. A description of the update.

Returns
Type Description
Operation

updateClusterCallable()

public final UnaryCallable<UpdateClusterRequest,Operation> updateClusterCallable()

Updates the settings for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   UpdateClusterRequest request =
       UpdateClusterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setUpdate(ClusterUpdate.newBuilder().build())
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.updateClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateClusterRequest,Operation>

updateMaster(UpdateMasterRequest request)

public final Operation updateMaster(UpdateMasterRequest request)

Updates the master for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   UpdateMasterRequest request =
       UpdateMasterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setMasterVersion("masterVersion1167095830")
           .setName("name3373707")
           .build();
   Operation response = clusterManagerClient.updateMaster(request);
 }
 
Parameter
Name Description
request UpdateMasterRequest

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

Returns
Type Description
Operation

updateMaster(String projectId, String zone, String clusterId, String masterVersion)

public final Operation updateMaster(String projectId, String zone, String clusterId, String masterVersion)

Updates the master for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   String projectId = "projectId-894832108";
   String zone = "zone3744684";
   String clusterId = "clusterId561939637";
   String masterVersion = "masterVersion1167095830";
   Operation response =
       clusterManagerClient.updateMaster(projectId, zone, clusterId, masterVersion);
 }
 
Parameters
Name Description
projectId String

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

zone String

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

clusterId String

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

masterVersion String

Required. 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

Returns
Type Description
Operation

updateMasterCallable()

public final UnaryCallable<UpdateMasterRequest,Operation> updateMasterCallable()

Updates the master for a specific cluster.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   UpdateMasterRequest request =
       UpdateMasterRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setMasterVersion("masterVersion1167095830")
           .setName("name3373707")
           .build();
   ApiFuture<Operation> future = clusterManagerClient.updateMasterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateMasterRequest,Operation>

updateNodePool(UpdateNodePoolRequest request)

public final Operation updateNodePool(UpdateNodePoolRequest request)

Updates the version and/or image type of a specific node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   UpdateNodePoolRequest request =
       UpdateNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setNodeVersion("nodeVersion1155309686")
           .setImageType("imageType-878147787")
           .addAllLocations(new ArrayList<String>())
           .setWorkloadMetadataConfig(WorkloadMetadataConfig.newBuilder().build())
           .setName("name3373707")
           .setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build())
           .setTags(NetworkTags.newBuilder().build())
           .setTaints(NodeTaints.newBuilder().build())
           .setLabels(NodeLabels.newBuilder().build())
           .setLinuxNodeConfig(LinuxNodeConfig.newBuilder().build())
           .setKubeletConfig(NodeKubeletConfig.newBuilder().build())
           .setNodeNetworkConfig(NodeNetworkConfig.newBuilder().build())
           .setGcfsConfig(GcfsConfig.newBuilder().build())
           .setConfidentialNodes(ConfidentialNodes.newBuilder().build())
           .setGvnic(VirtualNIC.newBuilder().build())
           .setEtag("etag3123477")
           .setFastSocket(FastSocket.newBuilder().build())
           .setLoggingConfig(NodePoolLoggingConfig.newBuilder().build())
           .setResourceLabels(ResourceLabels.newBuilder().build())
           .setWindowsNodeConfig(WindowsNodeConfig.newBuilder().build())
           .addAllAccelerators(new ArrayList<AcceleratorConfig>())
           .setMachineType("machineType-218117087")
           .setDiskType("diskType279771767")
           .setDiskSizeGb(-757478089)
           .setResourceManagerTags(ResourceManagerTags.newBuilder().build())
           .setContainerdConfig(ContainerdConfig.newBuilder().build())
           .setQueuedProvisioning(NodePool.QueuedProvisioning.newBuilder().build())
           .build();
   Operation response = clusterManagerClient.updateNodePool(request);
 }
 
Parameter
Name Description
request UpdateNodePoolRequest

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

Returns
Type Description
Operation

updateNodePoolCallable()

public final UnaryCallable<UpdateNodePoolRequest,Operation> updateNodePoolCallable()

Updates the version and/or image type of a specific node pool.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
   UpdateNodePoolRequest request =
       UpdateNodePoolRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .setZone("zone3744684")
           .setClusterId("clusterId561939637")
           .setNodePoolId("nodePoolId1121557241")
           .setNodeVersion("nodeVersion1155309686")
           .setImageType("imageType-878147787")
           .addAllLocations(new ArrayList<String>())
           .setWorkloadMetadataConfig(WorkloadMetadataConfig.newBuilder().build())
           .setName("name3373707")
           .setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build())
           .setTags(NetworkTags.newBuilder().build())
           .setTaints(NodeTaints.newBuilder().build())
           .setLabels(NodeLabels.newBuilder().build())
           .setLinuxNodeConfig(LinuxNodeConfig.newBuilder().build())
           .setKubeletConfig(NodeKubeletConfig.newBuilder().build())
           .setNodeNetworkConfig(NodeNetworkConfig.newBuilder().build())
           .setGcfsConfig(GcfsConfig.newBuilder().build())
           .setConfidentialNodes(ConfidentialNodes.newBuilder().build())
           .setGvnic(VirtualNIC.newBuilder().build())
           .setEtag("etag3123477")
           .setFastSocket(FastSocket.newBuilder().build())
           .setLoggingConfig(NodePoolLoggingConfig.newBuilder().build())
           .setResourceLabels(ResourceLabels.newBuilder().build())
           .setWindowsNodeConfig(WindowsNodeConfig.newBuilder().build())
           .addAllAccelerators(new ArrayList<AcceleratorConfig>())
           .setMachineType("machineType-218117087")
           .setDiskType("diskType279771767")
           .setDiskSizeGb(-757478089)
           .setResourceManagerTags(ResourceManagerTags.newBuilder().build())
           .setContainerdConfig(ContainerdConfig.newBuilder().build())
           .setQueuedProvisioning(NodePool.QueuedProvisioning.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       clusterManagerClient.updateNodePoolCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateNodePoolRequest,Operation>