1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.cloud.container.v1; 18 19 import com.google.api.core.ApiFuture; 20 import com.google.api.core.ApiFutures; 21 import com.google.api.gax.core.BackgroundResource; 22 import com.google.api.gax.paging.AbstractFixedSizeCollection; 23 import com.google.api.gax.paging.AbstractPage; 24 import com.google.api.gax.paging.AbstractPagedListResponse; 25 import com.google.api.gax.rpc.PageContext; 26 import com.google.api.gax.rpc.UnaryCallable; 27 import com.google.cloud.container.v1.stub.ClusterManagerStub; 28 import com.google.cloud.container.v1.stub.ClusterManagerStubSettings; 29 import com.google.common.util.concurrent.MoreExecutors; 30 import com.google.container.v1.AddonsConfig; 31 import com.google.container.v1.CancelOperationRequest; 32 import com.google.container.v1.Cluster; 33 import com.google.container.v1.ClusterUpdate; 34 import com.google.container.v1.CompleteIPRotationRequest; 35 import com.google.container.v1.CompleteNodePoolUpgradeRequest; 36 import com.google.container.v1.CreateClusterRequest; 37 import com.google.container.v1.CreateNodePoolRequest; 38 import com.google.container.v1.DeleteClusterRequest; 39 import com.google.container.v1.DeleteNodePoolRequest; 40 import com.google.container.v1.GetClusterRequest; 41 import com.google.container.v1.GetJSONWebKeysRequest; 42 import com.google.container.v1.GetJSONWebKeysResponse; 43 import com.google.container.v1.GetNodePoolRequest; 44 import com.google.container.v1.GetOperationRequest; 45 import com.google.container.v1.GetServerConfigRequest; 46 import com.google.container.v1.ListClustersRequest; 47 import com.google.container.v1.ListClustersResponse; 48 import com.google.container.v1.ListNodePoolsRequest; 49 import com.google.container.v1.ListNodePoolsResponse; 50 import com.google.container.v1.ListOperationsRequest; 51 import com.google.container.v1.ListOperationsResponse; 52 import com.google.container.v1.ListUsableSubnetworksRequest; 53 import com.google.container.v1.ListUsableSubnetworksResponse; 54 import com.google.container.v1.MaintenancePolicy; 55 import com.google.container.v1.NetworkPolicy; 56 import com.google.container.v1.NodePool; 57 import com.google.container.v1.Operation; 58 import com.google.container.v1.RollbackNodePoolUpgradeRequest; 59 import com.google.container.v1.ServerConfig; 60 import com.google.container.v1.SetAddonsConfigRequest; 61 import com.google.container.v1.SetLabelsRequest; 62 import com.google.container.v1.SetLegacyAbacRequest; 63 import com.google.container.v1.SetLocationsRequest; 64 import com.google.container.v1.SetLoggingServiceRequest; 65 import com.google.container.v1.SetMaintenancePolicyRequest; 66 import com.google.container.v1.SetMasterAuthRequest; 67 import com.google.container.v1.SetMonitoringServiceRequest; 68 import com.google.container.v1.SetNetworkPolicyRequest; 69 import com.google.container.v1.SetNodePoolAutoscalingRequest; 70 import com.google.container.v1.SetNodePoolManagementRequest; 71 import com.google.container.v1.SetNodePoolSizeRequest; 72 import com.google.container.v1.StartIPRotationRequest; 73 import com.google.container.v1.UpdateClusterRequest; 74 import com.google.container.v1.UpdateMasterRequest; 75 import com.google.container.v1.UpdateNodePoolRequest; 76 import com.google.container.v1.UsableSubnetwork; 77 import com.google.protobuf.Empty; 78 import java.io.IOException; 79 import java.util.List; 80 import java.util.concurrent.TimeUnit; 81 import javax.annotation.Generated; 82 83 // AUTO-GENERATED DOCUMENTATION AND CLASS. 84 /** 85 * Service Description: Google Kubernetes Engine Cluster Manager v1 86 * 87 * <p>This class provides the ability to make remote calls to the backing service through method 88 * calls that map to API methods. Sample code to get started: 89 * 90 * <pre>{@code 91 * // This snippet has been automatically generated and should be regarded as a code template only. 92 * // It will require modifications to work: 93 * // - It may require correct/in-range values for request initialization. 94 * // - It may require specifying regional endpoints when creating the service client as shown in 95 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 96 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 97 * String parent = "parent-995424086"; 98 * ListClustersResponse response = clusterManagerClient.listClusters(parent); 99 * } 100 * }</pre> 101 * 102 * <p>Note: close() needs to be called on the ClusterManagerClient object to clean up resources such 103 * as threads. In the example above, try-with-resources is used, which automatically calls close(). 104 * 105 * <p>The surface of this class includes several types of Java methods for each of the API's 106 * methods: 107 * 108 * <ol> 109 * <li>A "flattened" method. With this type of method, the fields of the request type have been 110 * converted into function parameters. It may be the case that not all fields are available as 111 * parameters, and not every API method will have a flattened method entry point. 112 * <li>A "request object" method. This type of method only takes one parameter, a request object, 113 * which must be constructed before the call. Not every API method will have a request object 114 * method. 115 * <li>A "callable" method. This type of method takes no parameters and returns an immutable API 116 * callable object, which can be used to initiate calls to the service. 117 * </ol> 118 * 119 * <p>See the individual methods for example code. 120 * 121 * <p>Many parameters require resource names to be formatted in a particular way. To assist with 122 * these names, this class includes a format method for each type of name, and additionally a parse 123 * method to extract the individual identifiers contained within names that are returned. 124 * 125 * <p>This class can be customized by passing in a custom instance of ClusterManagerSettings to 126 * create(). For example: 127 * 128 * <p>To customize credentials: 129 * 130 * <pre>{@code 131 * // This snippet has been automatically generated and should be regarded as a code template only. 132 * // It will require modifications to work: 133 * // - It may require correct/in-range values for request initialization. 134 * // - It may require specifying regional endpoints when creating the service client as shown in 135 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 136 * ClusterManagerSettings clusterManagerSettings = 137 * ClusterManagerSettings.newBuilder() 138 * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) 139 * .build(); 140 * ClusterManagerClient clusterManagerClient = ClusterManagerClient.create(clusterManagerSettings); 141 * }</pre> 142 * 143 * <p>To customize the endpoint: 144 * 145 * <pre>{@code 146 * // This snippet has been automatically generated and should be regarded as a code template only. 147 * // It will require modifications to work: 148 * // - It may require correct/in-range values for request initialization. 149 * // - It may require specifying regional endpoints when creating the service client as shown in 150 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 151 * ClusterManagerSettings clusterManagerSettings = 152 * ClusterManagerSettings.newBuilder().setEndpoint(myEndpoint).build(); 153 * ClusterManagerClient clusterManagerClient = ClusterManagerClient.create(clusterManagerSettings); 154 * }</pre> 155 * 156 * <p>Please refer to the GitHub repository's samples for more quickstart code snippets. 157 */ 158 @Generated("by gapic-generator-java") 159 public class ClusterManagerClient implements BackgroundResource { 160 private final ClusterManagerSettings settings; 161 private final ClusterManagerStub stub; 162 163 /** Constructs an instance of ClusterManagerClient with default settings. */ create()164 public static final ClusterManagerClient create() throws IOException { 165 return create(ClusterManagerSettings.newBuilder().build()); 166 } 167 168 /** 169 * Constructs an instance of ClusterManagerClient, using the given settings. The channels are 170 * created based on the settings passed in, or defaults for any settings that are not set. 171 */ create(ClusterManagerSettings settings)172 public static final ClusterManagerClient create(ClusterManagerSettings settings) 173 throws IOException { 174 return new ClusterManagerClient(settings); 175 } 176 177 /** 178 * Constructs an instance of ClusterManagerClient, using the given stub for making calls. This is 179 * for advanced usage - prefer using create(ClusterManagerSettings). 180 */ create(ClusterManagerStub stub)181 public static final ClusterManagerClient create(ClusterManagerStub stub) { 182 return new ClusterManagerClient(stub); 183 } 184 185 /** 186 * Constructs an instance of ClusterManagerClient, using the given settings. This is protected so 187 * that it is easy to make a subclass, but otherwise, the static factory methods should be 188 * preferred. 189 */ ClusterManagerClient(ClusterManagerSettings settings)190 protected ClusterManagerClient(ClusterManagerSettings settings) throws IOException { 191 this.settings = settings; 192 this.stub = ((ClusterManagerStubSettings) settings.getStubSettings()).createStub(); 193 } 194 ClusterManagerClient(ClusterManagerStub stub)195 protected ClusterManagerClient(ClusterManagerStub stub) { 196 this.settings = null; 197 this.stub = stub; 198 } 199 getSettings()200 public final ClusterManagerSettings getSettings() { 201 return settings; 202 } 203 getStub()204 public ClusterManagerStub getStub() { 205 return stub; 206 } 207 208 // AUTO-GENERATED DOCUMENTATION AND METHOD. 209 /** 210 * Lists all clusters owned by a project in either the specified zone or all zones. 211 * 212 * <p>Sample code: 213 * 214 * <pre>{@code 215 * // This snippet has been automatically generated and should be regarded as a code template only. 216 * // It will require modifications to work: 217 * // - It may require correct/in-range values for request initialization. 218 * // - It may require specifying regional endpoints when creating the service client as shown in 219 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 220 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 221 * String parent = "parent-995424086"; 222 * ListClustersResponse response = clusterManagerClient.listClusters(parent); 223 * } 224 * }</pre> 225 * 226 * @param parent The parent (project and location) where the clusters will be listed. Specified in 227 * the format `projects/*/locations/*`. Location "-" matches all zones and all 228 * regions. 229 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 230 */ listClusters(String parent)231 public final ListClustersResponse listClusters(String parent) { 232 ListClustersRequest request = ListClustersRequest.newBuilder().setParent(parent).build(); 233 return listClusters(request); 234 } 235 236 // AUTO-GENERATED DOCUMENTATION AND METHOD. 237 /** 238 * Lists all clusters owned by a project in either the specified zone or all zones. 239 * 240 * <p>Sample code: 241 * 242 * <pre>{@code 243 * // This snippet has been automatically generated and should be regarded as a code template only. 244 * // It will require modifications to work: 245 * // - It may require correct/in-range values for request initialization. 246 * // - It may require specifying regional endpoints when creating the service client as shown in 247 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 248 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 249 * String projectId = "projectId-894832108"; 250 * String zone = "zone3744684"; 251 * ListClustersResponse response = clusterManagerClient.listClusters(projectId, zone); 252 * } 253 * }</pre> 254 * 255 * @param projectId Deprecated. The Google Developers Console [project ID or project 256 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 257 * field has been deprecated and replaced by the parent field. 258 * @param zone Deprecated. The name of the Google Compute Engine 259 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides, 260 * or "-" for all zones. This field has been deprecated and replaced by the parent field. 261 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 262 */ listClusters(String projectId, String zone)263 public final ListClustersResponse listClusters(String projectId, String zone) { 264 ListClustersRequest request = 265 ListClustersRequest.newBuilder().setProjectId(projectId).setZone(zone).build(); 266 return listClusters(request); 267 } 268 269 // AUTO-GENERATED DOCUMENTATION AND METHOD. 270 /** 271 * Lists all clusters owned by a project in either the specified zone or all zones. 272 * 273 * <p>Sample code: 274 * 275 * <pre>{@code 276 * // This snippet has been automatically generated and should be regarded as a code template only. 277 * // It will require modifications to work: 278 * // - It may require correct/in-range values for request initialization. 279 * // - It may require specifying regional endpoints when creating the service client as shown in 280 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 281 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 282 * ListClustersRequest request = 283 * ListClustersRequest.newBuilder() 284 * .setProjectId("projectId-894832108") 285 * .setZone("zone3744684") 286 * .setParent("parent-995424086") 287 * .build(); 288 * ListClustersResponse response = clusterManagerClient.listClusters(request); 289 * } 290 * }</pre> 291 * 292 * @param request The request object containing all of the parameters for the API call. 293 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 294 */ listClusters(ListClustersRequest request)295 public final ListClustersResponse listClusters(ListClustersRequest request) { 296 return listClustersCallable().call(request); 297 } 298 299 // AUTO-GENERATED DOCUMENTATION AND METHOD. 300 /** 301 * Lists all clusters owned by a project in either the specified zone or all zones. 302 * 303 * <p>Sample code: 304 * 305 * <pre>{@code 306 * // This snippet has been automatically generated and should be regarded as a code template only. 307 * // It will require modifications to work: 308 * // - It may require correct/in-range values for request initialization. 309 * // - It may require specifying regional endpoints when creating the service client as shown in 310 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 311 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 312 * ListClustersRequest request = 313 * ListClustersRequest.newBuilder() 314 * .setProjectId("projectId-894832108") 315 * .setZone("zone3744684") 316 * .setParent("parent-995424086") 317 * .build(); 318 * ApiFuture<ListClustersResponse> future = 319 * clusterManagerClient.listClustersCallable().futureCall(request); 320 * // Do something. 321 * ListClustersResponse response = future.get(); 322 * } 323 * }</pre> 324 */ listClustersCallable()325 public final UnaryCallable<ListClustersRequest, ListClustersResponse> listClustersCallable() { 326 return stub.listClustersCallable(); 327 } 328 329 // AUTO-GENERATED DOCUMENTATION AND METHOD. 330 /** 331 * Gets the details of a specific cluster. 332 * 333 * <p>Sample code: 334 * 335 * <pre>{@code 336 * // This snippet has been automatically generated and should be regarded as a code template only. 337 * // It will require modifications to work: 338 * // - It may require correct/in-range values for request initialization. 339 * // - It may require specifying regional endpoints when creating the service client as shown in 340 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 341 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 342 * String name = "name3373707"; 343 * Cluster response = clusterManagerClient.getCluster(name); 344 * } 345 * }</pre> 346 * 347 * @param name The name (project, location, cluster) of the cluster to retrieve. Specified in the 348 * format `projects/*/locations/*/clusters/*`. 349 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 350 */ getCluster(String name)351 public final Cluster getCluster(String name) { 352 GetClusterRequest request = GetClusterRequest.newBuilder().setName(name).build(); 353 return getCluster(request); 354 } 355 356 // AUTO-GENERATED DOCUMENTATION AND METHOD. 357 /** 358 * Gets the details of a specific cluster. 359 * 360 * <p>Sample code: 361 * 362 * <pre>{@code 363 * // This snippet has been automatically generated and should be regarded as a code template only. 364 * // It will require modifications to work: 365 * // - It may require correct/in-range values for request initialization. 366 * // - It may require specifying regional endpoints when creating the service client as shown in 367 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 368 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 369 * String projectId = "projectId-894832108"; 370 * String zone = "zone3744684"; 371 * String clusterId = "clusterId561939637"; 372 * Cluster response = clusterManagerClient.getCluster(projectId, zone, clusterId); 373 * } 374 * }</pre> 375 * 376 * @param projectId Deprecated. The Google Developers Console [project ID or project 377 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 378 * field has been deprecated and replaced by the name field. 379 * @param zone Deprecated. The name of the Google Compute Engine 380 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 381 * This field has been deprecated and replaced by the name field. 382 * @param clusterId Deprecated. The name of the cluster to retrieve. This field has been 383 * deprecated and replaced by the name field. 384 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 385 */ getCluster(String projectId, String zone, String clusterId)386 public final Cluster getCluster(String projectId, String zone, String clusterId) { 387 GetClusterRequest request = 388 GetClusterRequest.newBuilder() 389 .setProjectId(projectId) 390 .setZone(zone) 391 .setClusterId(clusterId) 392 .build(); 393 return getCluster(request); 394 } 395 396 // AUTO-GENERATED DOCUMENTATION AND METHOD. 397 /** 398 * Gets the details of a specific cluster. 399 * 400 * <p>Sample code: 401 * 402 * <pre>{@code 403 * // This snippet has been automatically generated and should be regarded as a code template only. 404 * // It will require modifications to work: 405 * // - It may require correct/in-range values for request initialization. 406 * // - It may require specifying regional endpoints when creating the service client as shown in 407 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 408 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 409 * GetClusterRequest request = 410 * GetClusterRequest.newBuilder() 411 * .setProjectId("projectId-894832108") 412 * .setZone("zone3744684") 413 * .setClusterId("clusterId561939637") 414 * .setName("name3373707") 415 * .build(); 416 * Cluster response = clusterManagerClient.getCluster(request); 417 * } 418 * }</pre> 419 * 420 * @param request The request object containing all of the parameters for the API call. 421 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 422 */ getCluster(GetClusterRequest request)423 public final Cluster getCluster(GetClusterRequest request) { 424 return getClusterCallable().call(request); 425 } 426 427 // AUTO-GENERATED DOCUMENTATION AND METHOD. 428 /** 429 * Gets the details of a specific cluster. 430 * 431 * <p>Sample code: 432 * 433 * <pre>{@code 434 * // This snippet has been automatically generated and should be regarded as a code template only. 435 * // It will require modifications to work: 436 * // - It may require correct/in-range values for request initialization. 437 * // - It may require specifying regional endpoints when creating the service client as shown in 438 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 439 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 440 * GetClusterRequest request = 441 * GetClusterRequest.newBuilder() 442 * .setProjectId("projectId-894832108") 443 * .setZone("zone3744684") 444 * .setClusterId("clusterId561939637") 445 * .setName("name3373707") 446 * .build(); 447 * ApiFuture<Cluster> future = clusterManagerClient.getClusterCallable().futureCall(request); 448 * // Do something. 449 * Cluster response = future.get(); 450 * } 451 * }</pre> 452 */ getClusterCallable()453 public final UnaryCallable<GetClusterRequest, Cluster> getClusterCallable() { 454 return stub.getClusterCallable(); 455 } 456 457 // AUTO-GENERATED DOCUMENTATION AND METHOD. 458 /** 459 * Creates a cluster, consisting of the specified number and type of Google Compute Engine 460 * instances. 461 * 462 * <p>By default, the cluster is created in the project's [default 463 * network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 464 * 465 * <p>One firewall is added for the cluster. After cluster creation, the Kubelet creates routes 466 * for each node to allow the containers on that node to communicate with all other instances in 467 * the cluster. 468 * 469 * <p>Finally, an entry is added to the project's global metadata indicating which CIDR range the 470 * cluster is using. 471 * 472 * <p>Sample code: 473 * 474 * <pre>{@code 475 * // This snippet has been automatically generated and should be regarded as a code template only. 476 * // It will require modifications to work: 477 * // - It may require correct/in-range values for request initialization. 478 * // - It may require specifying regional endpoints when creating the service client as shown in 479 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 480 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 481 * String parent = "parent-995424086"; 482 * Cluster cluster = Cluster.newBuilder().build(); 483 * Operation response = clusterManagerClient.createCluster(parent, cluster); 484 * } 485 * }</pre> 486 * 487 * @param parent The parent (project and location) where the cluster will be created. Specified in 488 * the format `projects/*/locations/*`. 489 * @param cluster Required. A [cluster 490 * resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) 491 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 492 */ createCluster(String parent, Cluster cluster)493 public final Operation createCluster(String parent, Cluster cluster) { 494 CreateClusterRequest request = 495 CreateClusterRequest.newBuilder().setParent(parent).setCluster(cluster).build(); 496 return createCluster(request); 497 } 498 499 // AUTO-GENERATED DOCUMENTATION AND METHOD. 500 /** 501 * Creates a cluster, consisting of the specified number and type of Google Compute Engine 502 * instances. 503 * 504 * <p>By default, the cluster is created in the project's [default 505 * network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 506 * 507 * <p>One firewall is added for the cluster. After cluster creation, the Kubelet creates routes 508 * for each node to allow the containers on that node to communicate with all other instances in 509 * the cluster. 510 * 511 * <p>Finally, an entry is added to the project's global metadata indicating which CIDR range the 512 * cluster is using. 513 * 514 * <p>Sample code: 515 * 516 * <pre>{@code 517 * // This snippet has been automatically generated and should be regarded as a code template only. 518 * // It will require modifications to work: 519 * // - It may require correct/in-range values for request initialization. 520 * // - It may require specifying regional endpoints when creating the service client as shown in 521 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 522 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 523 * String projectId = "projectId-894832108"; 524 * String zone = "zone3744684"; 525 * Cluster cluster = Cluster.newBuilder().build(); 526 * Operation response = clusterManagerClient.createCluster(projectId, zone, cluster); 527 * } 528 * }</pre> 529 * 530 * @param projectId Deprecated. The Google Developers Console [project ID or project 531 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 532 * field has been deprecated and replaced by the parent field. 533 * @param zone Deprecated. The name of the Google Compute Engine 534 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 535 * This field has been deprecated and replaced by the parent field. 536 * @param cluster Required. A [cluster 537 * resource](https://cloud.google.com/container-engine/reference/rest/v1/projects.locations.clusters) 538 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 539 */ createCluster(String projectId, String zone, Cluster cluster)540 public final Operation createCluster(String projectId, String zone, Cluster cluster) { 541 CreateClusterRequest request = 542 CreateClusterRequest.newBuilder() 543 .setProjectId(projectId) 544 .setZone(zone) 545 .setCluster(cluster) 546 .build(); 547 return createCluster(request); 548 } 549 550 // AUTO-GENERATED DOCUMENTATION AND METHOD. 551 /** 552 * Creates a cluster, consisting of the specified number and type of Google Compute Engine 553 * instances. 554 * 555 * <p>By default, the cluster is created in the project's [default 556 * network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 557 * 558 * <p>One firewall is added for the cluster. After cluster creation, the Kubelet creates routes 559 * for each node to allow the containers on that node to communicate with all other instances in 560 * the cluster. 561 * 562 * <p>Finally, an entry is added to the project's global metadata indicating which CIDR range the 563 * cluster is using. 564 * 565 * <p>Sample code: 566 * 567 * <pre>{@code 568 * // This snippet has been automatically generated and should be regarded as a code template only. 569 * // It will require modifications to work: 570 * // - It may require correct/in-range values for request initialization. 571 * // - It may require specifying regional endpoints when creating the service client as shown in 572 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 573 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 574 * CreateClusterRequest request = 575 * CreateClusterRequest.newBuilder() 576 * .setProjectId("projectId-894832108") 577 * .setZone("zone3744684") 578 * .setCluster(Cluster.newBuilder().build()) 579 * .setParent("parent-995424086") 580 * .build(); 581 * Operation response = clusterManagerClient.createCluster(request); 582 * } 583 * }</pre> 584 * 585 * @param request The request object containing all of the parameters for the API call. 586 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 587 */ createCluster(CreateClusterRequest request)588 public final Operation createCluster(CreateClusterRequest request) { 589 return createClusterCallable().call(request); 590 } 591 592 // AUTO-GENERATED DOCUMENTATION AND METHOD. 593 /** 594 * Creates a cluster, consisting of the specified number and type of Google Compute Engine 595 * instances. 596 * 597 * <p>By default, the cluster is created in the project's [default 598 * network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). 599 * 600 * <p>One firewall is added for the cluster. After cluster creation, the Kubelet creates routes 601 * for each node to allow the containers on that node to communicate with all other instances in 602 * the cluster. 603 * 604 * <p>Finally, an entry is added to the project's global metadata indicating which CIDR range the 605 * cluster is using. 606 * 607 * <p>Sample code: 608 * 609 * <pre>{@code 610 * // This snippet has been automatically generated and should be regarded as a code template only. 611 * // It will require modifications to work: 612 * // - It may require correct/in-range values for request initialization. 613 * // - It may require specifying regional endpoints when creating the service client as shown in 614 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 615 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 616 * CreateClusterRequest request = 617 * CreateClusterRequest.newBuilder() 618 * .setProjectId("projectId-894832108") 619 * .setZone("zone3744684") 620 * .setCluster(Cluster.newBuilder().build()) 621 * .setParent("parent-995424086") 622 * .build(); 623 * ApiFuture<Operation> future = 624 * clusterManagerClient.createClusterCallable().futureCall(request); 625 * // Do something. 626 * Operation response = future.get(); 627 * } 628 * }</pre> 629 */ createClusterCallable()630 public final UnaryCallable<CreateClusterRequest, Operation> createClusterCallable() { 631 return stub.createClusterCallable(); 632 } 633 634 // AUTO-GENERATED DOCUMENTATION AND METHOD. 635 /** 636 * Updates the settings of a specific cluster. 637 * 638 * <p>Sample code: 639 * 640 * <pre>{@code 641 * // This snippet has been automatically generated and should be regarded as a code template only. 642 * // It will require modifications to work: 643 * // - It may require correct/in-range values for request initialization. 644 * // - It may require specifying regional endpoints when creating the service client as shown in 645 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 646 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 647 * String name = "name3373707"; 648 * ClusterUpdate update = ClusterUpdate.newBuilder().build(); 649 * Operation response = clusterManagerClient.updateCluster(name, update); 650 * } 651 * }</pre> 652 * 653 * @param name The name (project, location, cluster) of the cluster to update. Specified in the 654 * format `projects/*/locations/*/clusters/*`. 655 * @param update Required. A description of the update. 656 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 657 */ updateCluster(String name, ClusterUpdate update)658 public final Operation updateCluster(String name, ClusterUpdate update) { 659 UpdateClusterRequest request = 660 UpdateClusterRequest.newBuilder().setName(name).setUpdate(update).build(); 661 return updateCluster(request); 662 } 663 664 // AUTO-GENERATED DOCUMENTATION AND METHOD. 665 /** 666 * Updates the settings of a specific cluster. 667 * 668 * <p>Sample code: 669 * 670 * <pre>{@code 671 * // This snippet has been automatically generated and should be regarded as a code template only. 672 * // It will require modifications to work: 673 * // - It may require correct/in-range values for request initialization. 674 * // - It may require specifying regional endpoints when creating the service client as shown in 675 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 676 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 677 * String projectId = "projectId-894832108"; 678 * String zone = "zone3744684"; 679 * String clusterId = "clusterId561939637"; 680 * ClusterUpdate update = ClusterUpdate.newBuilder().build(); 681 * Operation response = clusterManagerClient.updateCluster(projectId, zone, clusterId, update); 682 * } 683 * }</pre> 684 * 685 * @param projectId Deprecated. The Google Developers Console [project ID or project 686 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 687 * field has been deprecated and replaced by the name field. 688 * @param zone Deprecated. The name of the Google Compute Engine 689 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 690 * This field has been deprecated and replaced by the name field. 691 * @param clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated 692 * and replaced by the name field. 693 * @param update Required. A description of the update. 694 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 695 */ updateCluster( String projectId, String zone, String clusterId, ClusterUpdate update)696 public final Operation updateCluster( 697 String projectId, String zone, String clusterId, ClusterUpdate update) { 698 UpdateClusterRequest request = 699 UpdateClusterRequest.newBuilder() 700 .setProjectId(projectId) 701 .setZone(zone) 702 .setClusterId(clusterId) 703 .setUpdate(update) 704 .build(); 705 return updateCluster(request); 706 } 707 708 // AUTO-GENERATED DOCUMENTATION AND METHOD. 709 /** 710 * Updates the settings of a specific cluster. 711 * 712 * <p>Sample code: 713 * 714 * <pre>{@code 715 * // This snippet has been automatically generated and should be regarded as a code template only. 716 * // It will require modifications to work: 717 * // - It may require correct/in-range values for request initialization. 718 * // - It may require specifying regional endpoints when creating the service client as shown in 719 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 720 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 721 * UpdateClusterRequest request = 722 * UpdateClusterRequest.newBuilder() 723 * .setProjectId("projectId-894832108") 724 * .setZone("zone3744684") 725 * .setClusterId("clusterId561939637") 726 * .setUpdate(ClusterUpdate.newBuilder().build()) 727 * .setName("name3373707") 728 * .build(); 729 * Operation response = clusterManagerClient.updateCluster(request); 730 * } 731 * }</pre> 732 * 733 * @param request The request object containing all of the parameters for the API call. 734 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 735 */ updateCluster(UpdateClusterRequest request)736 public final Operation updateCluster(UpdateClusterRequest request) { 737 return updateClusterCallable().call(request); 738 } 739 740 // AUTO-GENERATED DOCUMENTATION AND METHOD. 741 /** 742 * Updates the settings of a specific cluster. 743 * 744 * <p>Sample code: 745 * 746 * <pre>{@code 747 * // This snippet has been automatically generated and should be regarded as a code template only. 748 * // It will require modifications to work: 749 * // - It may require correct/in-range values for request initialization. 750 * // - It may require specifying regional endpoints when creating the service client as shown in 751 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 752 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 753 * UpdateClusterRequest request = 754 * UpdateClusterRequest.newBuilder() 755 * .setProjectId("projectId-894832108") 756 * .setZone("zone3744684") 757 * .setClusterId("clusterId561939637") 758 * .setUpdate(ClusterUpdate.newBuilder().build()) 759 * .setName("name3373707") 760 * .build(); 761 * ApiFuture<Operation> future = 762 * clusterManagerClient.updateClusterCallable().futureCall(request); 763 * // Do something. 764 * Operation response = future.get(); 765 * } 766 * }</pre> 767 */ updateClusterCallable()768 public final UnaryCallable<UpdateClusterRequest, Operation> updateClusterCallable() { 769 return stub.updateClusterCallable(); 770 } 771 772 // AUTO-GENERATED DOCUMENTATION AND METHOD. 773 /** 774 * Updates the version and/or image type for the specified node pool. 775 * 776 * <p>Sample code: 777 * 778 * <pre>{@code 779 * // This snippet has been automatically generated and should be regarded as a code template only. 780 * // It will require modifications to work: 781 * // - It may require correct/in-range values for request initialization. 782 * // - It may require specifying regional endpoints when creating the service client as shown in 783 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 784 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 785 * UpdateNodePoolRequest request = 786 * UpdateNodePoolRequest.newBuilder() 787 * .setProjectId("projectId-894832108") 788 * .setZone("zone3744684") 789 * .setClusterId("clusterId561939637") 790 * .setNodePoolId("nodePoolId1121557241") 791 * .setNodeVersion("nodeVersion1155309686") 792 * .setImageType("imageType-878147787") 793 * .setName("name3373707") 794 * .addAllLocations(new ArrayList<String>()) 795 * .setWorkloadMetadataConfig(WorkloadMetadataConfig.newBuilder().build()) 796 * .setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build()) 797 * .setTags(NetworkTags.newBuilder().build()) 798 * .setTaints(NodeTaints.newBuilder().build()) 799 * .setLabels(NodeLabels.newBuilder().build()) 800 * .setLinuxNodeConfig(LinuxNodeConfig.newBuilder().build()) 801 * .setKubeletConfig(NodeKubeletConfig.newBuilder().build()) 802 * .setNodeNetworkConfig(NodeNetworkConfig.newBuilder().build()) 803 * .setGcfsConfig(GcfsConfig.newBuilder().build()) 804 * .setConfidentialNodes(ConfidentialNodes.newBuilder().build()) 805 * .setGvnic(VirtualNIC.newBuilder().build()) 806 * .setEtag("etag3123477") 807 * .setFastSocket(FastSocket.newBuilder().build()) 808 * .setLoggingConfig(NodePoolLoggingConfig.newBuilder().build()) 809 * .setResourceLabels(ResourceLabels.newBuilder().build()) 810 * .setWindowsNodeConfig(WindowsNodeConfig.newBuilder().build()) 811 * .build(); 812 * Operation response = clusterManagerClient.updateNodePool(request); 813 * } 814 * }</pre> 815 * 816 * @param request The request object containing all of the parameters for the API call. 817 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 818 */ updateNodePool(UpdateNodePoolRequest request)819 public final Operation updateNodePool(UpdateNodePoolRequest request) { 820 return updateNodePoolCallable().call(request); 821 } 822 823 // AUTO-GENERATED DOCUMENTATION AND METHOD. 824 /** 825 * Updates the version and/or image type for the specified node pool. 826 * 827 * <p>Sample code: 828 * 829 * <pre>{@code 830 * // This snippet has been automatically generated and should be regarded as a code template only. 831 * // It will require modifications to work: 832 * // - It may require correct/in-range values for request initialization. 833 * // - It may require specifying regional endpoints when creating the service client as shown in 834 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 835 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 836 * UpdateNodePoolRequest request = 837 * UpdateNodePoolRequest.newBuilder() 838 * .setProjectId("projectId-894832108") 839 * .setZone("zone3744684") 840 * .setClusterId("clusterId561939637") 841 * .setNodePoolId("nodePoolId1121557241") 842 * .setNodeVersion("nodeVersion1155309686") 843 * .setImageType("imageType-878147787") 844 * .setName("name3373707") 845 * .addAllLocations(new ArrayList<String>()) 846 * .setWorkloadMetadataConfig(WorkloadMetadataConfig.newBuilder().build()) 847 * .setUpgradeSettings(NodePool.UpgradeSettings.newBuilder().build()) 848 * .setTags(NetworkTags.newBuilder().build()) 849 * .setTaints(NodeTaints.newBuilder().build()) 850 * .setLabels(NodeLabels.newBuilder().build()) 851 * .setLinuxNodeConfig(LinuxNodeConfig.newBuilder().build()) 852 * .setKubeletConfig(NodeKubeletConfig.newBuilder().build()) 853 * .setNodeNetworkConfig(NodeNetworkConfig.newBuilder().build()) 854 * .setGcfsConfig(GcfsConfig.newBuilder().build()) 855 * .setConfidentialNodes(ConfidentialNodes.newBuilder().build()) 856 * .setGvnic(VirtualNIC.newBuilder().build()) 857 * .setEtag("etag3123477") 858 * .setFastSocket(FastSocket.newBuilder().build()) 859 * .setLoggingConfig(NodePoolLoggingConfig.newBuilder().build()) 860 * .setResourceLabels(ResourceLabels.newBuilder().build()) 861 * .setWindowsNodeConfig(WindowsNodeConfig.newBuilder().build()) 862 * .build(); 863 * ApiFuture<Operation> future = 864 * clusterManagerClient.updateNodePoolCallable().futureCall(request); 865 * // Do something. 866 * Operation response = future.get(); 867 * } 868 * }</pre> 869 */ updateNodePoolCallable()870 public final UnaryCallable<UpdateNodePoolRequest, Operation> updateNodePoolCallable() { 871 return stub.updateNodePoolCallable(); 872 } 873 874 // AUTO-GENERATED DOCUMENTATION AND METHOD. 875 /** 876 * Sets the autoscaling settings for the specified node pool. 877 * 878 * <p>Sample code: 879 * 880 * <pre>{@code 881 * // This snippet has been automatically generated and should be regarded as a code template only. 882 * // It will require modifications to work: 883 * // - It may require correct/in-range values for request initialization. 884 * // - It may require specifying regional endpoints when creating the service client as shown in 885 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 886 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 887 * SetNodePoolAutoscalingRequest request = 888 * SetNodePoolAutoscalingRequest.newBuilder() 889 * .setProjectId("projectId-894832108") 890 * .setZone("zone3744684") 891 * .setClusterId("clusterId561939637") 892 * .setNodePoolId("nodePoolId1121557241") 893 * .setAutoscaling(NodePoolAutoscaling.newBuilder().build()) 894 * .setName("name3373707") 895 * .build(); 896 * Operation response = clusterManagerClient.setNodePoolAutoscaling(request); 897 * } 898 * }</pre> 899 * 900 * @param request The request object containing all of the parameters for the API call. 901 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 902 */ setNodePoolAutoscaling(SetNodePoolAutoscalingRequest request)903 public final Operation setNodePoolAutoscaling(SetNodePoolAutoscalingRequest request) { 904 return setNodePoolAutoscalingCallable().call(request); 905 } 906 907 // AUTO-GENERATED DOCUMENTATION AND METHOD. 908 /** 909 * Sets the autoscaling settings for the specified node pool. 910 * 911 * <p>Sample code: 912 * 913 * <pre>{@code 914 * // This snippet has been automatically generated and should be regarded as a code template only. 915 * // It will require modifications to work: 916 * // - It may require correct/in-range values for request initialization. 917 * // - It may require specifying regional endpoints when creating the service client as shown in 918 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 919 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 920 * SetNodePoolAutoscalingRequest request = 921 * SetNodePoolAutoscalingRequest.newBuilder() 922 * .setProjectId("projectId-894832108") 923 * .setZone("zone3744684") 924 * .setClusterId("clusterId561939637") 925 * .setNodePoolId("nodePoolId1121557241") 926 * .setAutoscaling(NodePoolAutoscaling.newBuilder().build()) 927 * .setName("name3373707") 928 * .build(); 929 * ApiFuture<Operation> future = 930 * clusterManagerClient.setNodePoolAutoscalingCallable().futureCall(request); 931 * // Do something. 932 * Operation response = future.get(); 933 * } 934 * }</pre> 935 */ 936 public final UnaryCallable<SetNodePoolAutoscalingRequest, Operation> setNodePoolAutoscalingCallable()937 setNodePoolAutoscalingCallable() { 938 return stub.setNodePoolAutoscalingCallable(); 939 } 940 941 // AUTO-GENERATED DOCUMENTATION AND METHOD. 942 /** 943 * Sets the logging service for a specific cluster. 944 * 945 * <p>Sample code: 946 * 947 * <pre>{@code 948 * // This snippet has been automatically generated and should be regarded as a code template only. 949 * // It will require modifications to work: 950 * // - It may require correct/in-range values for request initialization. 951 * // - It may require specifying regional endpoints when creating the service client as shown in 952 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 953 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 954 * String name = "name3373707"; 955 * String loggingService = "loggingService1098570326"; 956 * Operation response = clusterManagerClient.setLoggingService(name, loggingService); 957 * } 958 * }</pre> 959 * 960 * @param name The name (project, location, cluster) of the cluster to set logging. Specified in 961 * the format `projects/*/locations/*/clusters/*`. 962 * @param loggingService Required. The logging service the cluster should use to write logs. 963 * Currently available options: 964 * <ul> 965 * <li>`logging.googleapis.com/kubernetes` - The Cloud Logging service with a 966 * Kubernetes-native resource model 967 * <li>`logging.googleapis.com` - The legacy Cloud Logging service (no longer available as 968 * of GKE 1.15). 969 * <li>`none` - no logs will be exported from the cluster. 970 * </ul> 971 * <p>If left as an empty string,`logging.googleapis.com/kubernetes` will be used for GKE 972 * 1.14+ or `logging.googleapis.com` for earlier versions. 973 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 974 */ setLoggingService(String name, String loggingService)975 public final Operation setLoggingService(String name, String loggingService) { 976 SetLoggingServiceRequest request = 977 SetLoggingServiceRequest.newBuilder() 978 .setName(name) 979 .setLoggingService(loggingService) 980 .build(); 981 return setLoggingService(request); 982 } 983 984 // AUTO-GENERATED DOCUMENTATION AND METHOD. 985 /** 986 * Sets the logging service for a specific cluster. 987 * 988 * <p>Sample code: 989 * 990 * <pre>{@code 991 * // This snippet has been automatically generated and should be regarded as a code template only. 992 * // It will require modifications to work: 993 * // - It may require correct/in-range values for request initialization. 994 * // - It may require specifying regional endpoints when creating the service client as shown in 995 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 996 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 997 * String projectId = "projectId-894832108"; 998 * String zone = "zone3744684"; 999 * String clusterId = "clusterId561939637"; 1000 * String loggingService = "loggingService1098570326"; 1001 * Operation response = 1002 * clusterManagerClient.setLoggingService(projectId, zone, clusterId, loggingService); 1003 * } 1004 * }</pre> 1005 * 1006 * @param projectId Deprecated. The Google Developers Console [project ID or project 1007 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 1008 * field has been deprecated and replaced by the name field. 1009 * @param zone Deprecated. The name of the Google Compute Engine 1010 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 1011 * This field has been deprecated and replaced by the name field. 1012 * @param clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated 1013 * and replaced by the name field. 1014 * @param loggingService Required. The logging service the cluster should use to write logs. 1015 * Currently available options: 1016 * <ul> 1017 * <li>`logging.googleapis.com/kubernetes` - The Cloud Logging service with a 1018 * Kubernetes-native resource model 1019 * <li>`logging.googleapis.com` - The legacy Cloud Logging service (no longer available as 1020 * of GKE 1.15). 1021 * <li>`none` - no logs will be exported from the cluster. 1022 * </ul> 1023 * <p>If left as an empty string,`logging.googleapis.com/kubernetes` will be used for GKE 1024 * 1.14+ or `logging.googleapis.com` for earlier versions. 1025 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1026 */ setLoggingService( String projectId, String zone, String clusterId, String loggingService)1027 public final Operation setLoggingService( 1028 String projectId, String zone, String clusterId, String loggingService) { 1029 SetLoggingServiceRequest request = 1030 SetLoggingServiceRequest.newBuilder() 1031 .setProjectId(projectId) 1032 .setZone(zone) 1033 .setClusterId(clusterId) 1034 .setLoggingService(loggingService) 1035 .build(); 1036 return setLoggingService(request); 1037 } 1038 1039 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1040 /** 1041 * Sets the logging service for a specific cluster. 1042 * 1043 * <p>Sample code: 1044 * 1045 * <pre>{@code 1046 * // This snippet has been automatically generated and should be regarded as a code template only. 1047 * // It will require modifications to work: 1048 * // - It may require correct/in-range values for request initialization. 1049 * // - It may require specifying regional endpoints when creating the service client as shown in 1050 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1051 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1052 * SetLoggingServiceRequest request = 1053 * SetLoggingServiceRequest.newBuilder() 1054 * .setProjectId("projectId-894832108") 1055 * .setZone("zone3744684") 1056 * .setClusterId("clusterId561939637") 1057 * .setLoggingService("loggingService1098570326") 1058 * .setName("name3373707") 1059 * .build(); 1060 * Operation response = clusterManagerClient.setLoggingService(request); 1061 * } 1062 * }</pre> 1063 * 1064 * @param request The request object containing all of the parameters for the API call. 1065 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1066 */ setLoggingService(SetLoggingServiceRequest request)1067 public final Operation setLoggingService(SetLoggingServiceRequest request) { 1068 return setLoggingServiceCallable().call(request); 1069 } 1070 1071 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1072 /** 1073 * Sets the logging service for a specific cluster. 1074 * 1075 * <p>Sample code: 1076 * 1077 * <pre>{@code 1078 * // This snippet has been automatically generated and should be regarded as a code template only. 1079 * // It will require modifications to work: 1080 * // - It may require correct/in-range values for request initialization. 1081 * // - It may require specifying regional endpoints when creating the service client as shown in 1082 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1083 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1084 * SetLoggingServiceRequest request = 1085 * SetLoggingServiceRequest.newBuilder() 1086 * .setProjectId("projectId-894832108") 1087 * .setZone("zone3744684") 1088 * .setClusterId("clusterId561939637") 1089 * .setLoggingService("loggingService1098570326") 1090 * .setName("name3373707") 1091 * .build(); 1092 * ApiFuture<Operation> future = 1093 * clusterManagerClient.setLoggingServiceCallable().futureCall(request); 1094 * // Do something. 1095 * Operation response = future.get(); 1096 * } 1097 * }</pre> 1098 */ setLoggingServiceCallable()1099 public final UnaryCallable<SetLoggingServiceRequest, Operation> setLoggingServiceCallable() { 1100 return stub.setLoggingServiceCallable(); 1101 } 1102 1103 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1104 /** 1105 * Sets the monitoring service for a specific cluster. 1106 * 1107 * <p>Sample code: 1108 * 1109 * <pre>{@code 1110 * // This snippet has been automatically generated and should be regarded as a code template only. 1111 * // It will require modifications to work: 1112 * // - It may require correct/in-range values for request initialization. 1113 * // - It may require specifying regional endpoints when creating the service client as shown in 1114 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1115 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1116 * String name = "name3373707"; 1117 * String monitoringService = "monitoringService-1431578291"; 1118 * Operation response = clusterManagerClient.setMonitoringService(name, monitoringService); 1119 * } 1120 * }</pre> 1121 * 1122 * @param name The name (project, location, cluster) of the cluster to set monitoring. Specified 1123 * in the format `projects/*/locations/*/clusters/*`. 1124 * @param monitoringService Required. The monitoring service the cluster should use to write 1125 * metrics. Currently available options: 1126 * <ul> 1127 * <li>"monitoring.googleapis.com/kubernetes" - The Cloud Monitoring service with a 1128 * Kubernetes-native resource model 1129 * <li>`monitoring.googleapis.com` - The legacy Cloud Monitoring service (no longer 1130 * available as of GKE 1.15). 1131 * <li>`none` - No metrics will be exported from the cluster. 1132 * </ul> 1133 * <p>If left as an empty string,`monitoring.googleapis.com/kubernetes` will be used for GKE 1134 * 1.14+ or `monitoring.googleapis.com` for earlier versions. 1135 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1136 */ setMonitoringService(String name, String monitoringService)1137 public final Operation setMonitoringService(String name, String monitoringService) { 1138 SetMonitoringServiceRequest request = 1139 SetMonitoringServiceRequest.newBuilder() 1140 .setName(name) 1141 .setMonitoringService(monitoringService) 1142 .build(); 1143 return setMonitoringService(request); 1144 } 1145 1146 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1147 /** 1148 * Sets the monitoring service for a specific cluster. 1149 * 1150 * <p>Sample code: 1151 * 1152 * <pre>{@code 1153 * // This snippet has been automatically generated and should be regarded as a code template only. 1154 * // It will require modifications to work: 1155 * // - It may require correct/in-range values for request initialization. 1156 * // - It may require specifying regional endpoints when creating the service client as shown in 1157 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1158 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1159 * String projectId = "projectId-894832108"; 1160 * String zone = "zone3744684"; 1161 * String clusterId = "clusterId561939637"; 1162 * String monitoringService = "monitoringService-1431578291"; 1163 * Operation response = 1164 * clusterManagerClient.setMonitoringService(projectId, zone, clusterId, monitoringService); 1165 * } 1166 * }</pre> 1167 * 1168 * @param projectId Deprecated. The Google Developers Console [project ID or project 1169 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 1170 * field has been deprecated and replaced by the name field. 1171 * @param zone Deprecated. The name of the Google Compute Engine 1172 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 1173 * This field has been deprecated and replaced by the name field. 1174 * @param clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated 1175 * and replaced by the name field. 1176 * @param monitoringService Required. The monitoring service the cluster should use to write 1177 * metrics. Currently available options: 1178 * <ul> 1179 * <li>"monitoring.googleapis.com/kubernetes" - The Cloud Monitoring service with a 1180 * Kubernetes-native resource model 1181 * <li>`monitoring.googleapis.com` - The legacy Cloud Monitoring service (no longer 1182 * available as of GKE 1.15). 1183 * <li>`none` - No metrics will be exported from the cluster. 1184 * </ul> 1185 * <p>If left as an empty string,`monitoring.googleapis.com/kubernetes` will be used for GKE 1186 * 1.14+ or `monitoring.googleapis.com` for earlier versions. 1187 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1188 */ setMonitoringService( String projectId, String zone, String clusterId, String monitoringService)1189 public final Operation setMonitoringService( 1190 String projectId, String zone, String clusterId, String monitoringService) { 1191 SetMonitoringServiceRequest request = 1192 SetMonitoringServiceRequest.newBuilder() 1193 .setProjectId(projectId) 1194 .setZone(zone) 1195 .setClusterId(clusterId) 1196 .setMonitoringService(monitoringService) 1197 .build(); 1198 return setMonitoringService(request); 1199 } 1200 1201 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1202 /** 1203 * Sets the monitoring service for a specific cluster. 1204 * 1205 * <p>Sample code: 1206 * 1207 * <pre>{@code 1208 * // This snippet has been automatically generated and should be regarded as a code template only. 1209 * // It will require modifications to work: 1210 * // - It may require correct/in-range values for request initialization. 1211 * // - It may require specifying regional endpoints when creating the service client as shown in 1212 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1213 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1214 * SetMonitoringServiceRequest request = 1215 * SetMonitoringServiceRequest.newBuilder() 1216 * .setProjectId("projectId-894832108") 1217 * .setZone("zone3744684") 1218 * .setClusterId("clusterId561939637") 1219 * .setMonitoringService("monitoringService-1431578291") 1220 * .setName("name3373707") 1221 * .build(); 1222 * Operation response = clusterManagerClient.setMonitoringService(request); 1223 * } 1224 * }</pre> 1225 * 1226 * @param request The request object containing all of the parameters for the API call. 1227 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1228 */ setMonitoringService(SetMonitoringServiceRequest request)1229 public final Operation setMonitoringService(SetMonitoringServiceRequest request) { 1230 return setMonitoringServiceCallable().call(request); 1231 } 1232 1233 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1234 /** 1235 * Sets the monitoring service for a specific cluster. 1236 * 1237 * <p>Sample code: 1238 * 1239 * <pre>{@code 1240 * // This snippet has been automatically generated and should be regarded as a code template only. 1241 * // It will require modifications to work: 1242 * // - It may require correct/in-range values for request initialization. 1243 * // - It may require specifying regional endpoints when creating the service client as shown in 1244 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1245 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1246 * SetMonitoringServiceRequest request = 1247 * SetMonitoringServiceRequest.newBuilder() 1248 * .setProjectId("projectId-894832108") 1249 * .setZone("zone3744684") 1250 * .setClusterId("clusterId561939637") 1251 * .setMonitoringService("monitoringService-1431578291") 1252 * .setName("name3373707") 1253 * .build(); 1254 * ApiFuture<Operation> future = 1255 * clusterManagerClient.setMonitoringServiceCallable().futureCall(request); 1256 * // Do something. 1257 * Operation response = future.get(); 1258 * } 1259 * }</pre> 1260 */ 1261 public final UnaryCallable<SetMonitoringServiceRequest, Operation> setMonitoringServiceCallable()1262 setMonitoringServiceCallable() { 1263 return stub.setMonitoringServiceCallable(); 1264 } 1265 1266 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1267 /** 1268 * Sets the addons for a specific cluster. 1269 * 1270 * <p>Sample code: 1271 * 1272 * <pre>{@code 1273 * // This snippet has been automatically generated and should be regarded as a code template only. 1274 * // It will require modifications to work: 1275 * // - It may require correct/in-range values for request initialization. 1276 * // - It may require specifying regional endpoints when creating the service client as shown in 1277 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1278 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1279 * String name = "name3373707"; 1280 * AddonsConfig addonsConfig = AddonsConfig.newBuilder().build(); 1281 * Operation response = clusterManagerClient.setAddonsConfig(name, addonsConfig); 1282 * } 1283 * }</pre> 1284 * 1285 * @param name The name (project, location, cluster) of the cluster to set addons. Specified in 1286 * the format `projects/*/locations/*/clusters/*`. 1287 * @param addonsConfig Required. The desired configurations for the various addons available to 1288 * run in the cluster. 1289 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1290 */ setAddonsConfig(String name, AddonsConfig addonsConfig)1291 public final Operation setAddonsConfig(String name, AddonsConfig addonsConfig) { 1292 SetAddonsConfigRequest request = 1293 SetAddonsConfigRequest.newBuilder().setName(name).setAddonsConfig(addonsConfig).build(); 1294 return setAddonsConfig(request); 1295 } 1296 1297 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1298 /** 1299 * Sets the addons for a specific cluster. 1300 * 1301 * <p>Sample code: 1302 * 1303 * <pre>{@code 1304 * // This snippet has been automatically generated and should be regarded as a code template only. 1305 * // It will require modifications to work: 1306 * // - It may require correct/in-range values for request initialization. 1307 * // - It may require specifying regional endpoints when creating the service client as shown in 1308 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1309 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1310 * String projectId = "projectId-894832108"; 1311 * String zone = "zone3744684"; 1312 * String clusterId = "clusterId561939637"; 1313 * AddonsConfig addonsConfig = AddonsConfig.newBuilder().build(); 1314 * Operation response = 1315 * clusterManagerClient.setAddonsConfig(projectId, zone, clusterId, addonsConfig); 1316 * } 1317 * }</pre> 1318 * 1319 * @param projectId Deprecated. The Google Developers Console [project ID or project 1320 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 1321 * field has been deprecated and replaced by the name field. 1322 * @param zone Deprecated. The name of the Google Compute Engine 1323 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 1324 * This field has been deprecated and replaced by the name field. 1325 * @param clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated 1326 * and replaced by the name field. 1327 * @param addonsConfig Required. The desired configurations for the various addons available to 1328 * run in the cluster. 1329 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1330 */ setAddonsConfig( String projectId, String zone, String clusterId, AddonsConfig addonsConfig)1331 public final Operation setAddonsConfig( 1332 String projectId, String zone, String clusterId, AddonsConfig addonsConfig) { 1333 SetAddonsConfigRequest request = 1334 SetAddonsConfigRequest.newBuilder() 1335 .setProjectId(projectId) 1336 .setZone(zone) 1337 .setClusterId(clusterId) 1338 .setAddonsConfig(addonsConfig) 1339 .build(); 1340 return setAddonsConfig(request); 1341 } 1342 1343 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1344 /** 1345 * Sets the addons for a specific cluster. 1346 * 1347 * <p>Sample code: 1348 * 1349 * <pre>{@code 1350 * // This snippet has been automatically generated and should be regarded as a code template only. 1351 * // It will require modifications to work: 1352 * // - It may require correct/in-range values for request initialization. 1353 * // - It may require specifying regional endpoints when creating the service client as shown in 1354 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1355 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1356 * SetAddonsConfigRequest request = 1357 * SetAddonsConfigRequest.newBuilder() 1358 * .setProjectId("projectId-894832108") 1359 * .setZone("zone3744684") 1360 * .setClusterId("clusterId561939637") 1361 * .setAddonsConfig(AddonsConfig.newBuilder().build()) 1362 * .setName("name3373707") 1363 * .build(); 1364 * Operation response = clusterManagerClient.setAddonsConfig(request); 1365 * } 1366 * }</pre> 1367 * 1368 * @param request The request object containing all of the parameters for the API call. 1369 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1370 */ setAddonsConfig(SetAddonsConfigRequest request)1371 public final Operation setAddonsConfig(SetAddonsConfigRequest request) { 1372 return setAddonsConfigCallable().call(request); 1373 } 1374 1375 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1376 /** 1377 * Sets the addons for a specific cluster. 1378 * 1379 * <p>Sample code: 1380 * 1381 * <pre>{@code 1382 * // This snippet has been automatically generated and should be regarded as a code template only. 1383 * // It will require modifications to work: 1384 * // - It may require correct/in-range values for request initialization. 1385 * // - It may require specifying regional endpoints when creating the service client as shown in 1386 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1387 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1388 * SetAddonsConfigRequest request = 1389 * SetAddonsConfigRequest.newBuilder() 1390 * .setProjectId("projectId-894832108") 1391 * .setZone("zone3744684") 1392 * .setClusterId("clusterId561939637") 1393 * .setAddonsConfig(AddonsConfig.newBuilder().build()) 1394 * .setName("name3373707") 1395 * .build(); 1396 * ApiFuture<Operation> future = 1397 * clusterManagerClient.setAddonsConfigCallable().futureCall(request); 1398 * // Do something. 1399 * Operation response = future.get(); 1400 * } 1401 * }</pre> 1402 */ setAddonsConfigCallable()1403 public final UnaryCallable<SetAddonsConfigRequest, Operation> setAddonsConfigCallable() { 1404 return stub.setAddonsConfigCallable(); 1405 } 1406 1407 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1408 /** 1409 * Sets the locations for a specific cluster. Deprecated. Use 1410 * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) 1411 * instead. 1412 * 1413 * <p>Sample code: 1414 * 1415 * <pre>{@code 1416 * // This snippet has been automatically generated and should be regarded as a code template only. 1417 * // It will require modifications to work: 1418 * // - It may require correct/in-range values for request initialization. 1419 * // - It may require specifying regional endpoints when creating the service client as shown in 1420 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1421 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1422 * String name = "name3373707"; 1423 * List<String> locations = new ArrayList<>(); 1424 * Operation response = clusterManagerClient.setLocations(name, locations); 1425 * } 1426 * }</pre> 1427 * 1428 * @param name The name (project, location, cluster) of the cluster to set locations. Specified in 1429 * the format `projects/*/locations/*/clusters/*`. 1430 * @param locations Required. The desired list of Google Compute Engine 1431 * [zones](https://cloud.google.com/compute/docs/zones#available) in which the cluster's nodes 1432 * should be located. Changing the locations a cluster is in will result in nodes being either 1433 * created or removed from the cluster, depending on whether locations are being added or 1434 * removed. 1435 * <p>This list must always include the cluster's primary zone. 1436 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1437 * @deprecated This method is deprecated and will be removed in the next major version update. 1438 */ 1439 @Deprecated setLocations(String name, List<String> locations)1440 public final Operation setLocations(String name, List<String> locations) { 1441 SetLocationsRequest request = 1442 SetLocationsRequest.newBuilder().setName(name).addAllLocations(locations).build(); 1443 return setLocations(request); 1444 } 1445 1446 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1447 /** 1448 * Sets the locations for a specific cluster. Deprecated. Use 1449 * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) 1450 * instead. 1451 * 1452 * <p>Sample code: 1453 * 1454 * <pre>{@code 1455 * // This snippet has been automatically generated and should be regarded as a code template only. 1456 * // It will require modifications to work: 1457 * // - It may require correct/in-range values for request initialization. 1458 * // - It may require specifying regional endpoints when creating the service client as shown in 1459 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1460 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1461 * String projectId = "projectId-894832108"; 1462 * String zone = "zone3744684"; 1463 * String clusterId = "clusterId561939637"; 1464 * List<String> locations = new ArrayList<>(); 1465 * Operation response = clusterManagerClient.setLocations(projectId, zone, clusterId, locations); 1466 * } 1467 * }</pre> 1468 * 1469 * @param projectId Deprecated. The Google Developers Console [project ID or project 1470 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 1471 * field has been deprecated and replaced by the name field. 1472 * @param zone Deprecated. The name of the Google Compute Engine 1473 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 1474 * This field has been deprecated and replaced by the name field. 1475 * @param clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated 1476 * and replaced by the name field. 1477 * @param locations Required. The desired list of Google Compute Engine 1478 * [zones](https://cloud.google.com/compute/docs/zones#available) in which the cluster's nodes 1479 * should be located. Changing the locations a cluster is in will result in nodes being either 1480 * created or removed from the cluster, depending on whether locations are being added or 1481 * removed. 1482 * <p>This list must always include the cluster's primary zone. 1483 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1484 * @deprecated This method is deprecated and will be removed in the next major version update. 1485 */ 1486 @Deprecated setLocations( String projectId, String zone, String clusterId, List<String> locations)1487 public final Operation setLocations( 1488 String projectId, String zone, String clusterId, List<String> locations) { 1489 SetLocationsRequest request = 1490 SetLocationsRequest.newBuilder() 1491 .setProjectId(projectId) 1492 .setZone(zone) 1493 .setClusterId(clusterId) 1494 .addAllLocations(locations) 1495 .build(); 1496 return setLocations(request); 1497 } 1498 1499 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1500 /** 1501 * Sets the locations for a specific cluster. Deprecated. Use 1502 * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) 1503 * instead. 1504 * 1505 * <p>Sample code: 1506 * 1507 * <pre>{@code 1508 * // This snippet has been automatically generated and should be regarded as a code template only. 1509 * // It will require modifications to work: 1510 * // - It may require correct/in-range values for request initialization. 1511 * // - It may require specifying regional endpoints when creating the service client as shown in 1512 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1513 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1514 * SetLocationsRequest request = 1515 * SetLocationsRequest.newBuilder() 1516 * .setProjectId("projectId-894832108") 1517 * .setZone("zone3744684") 1518 * .setClusterId("clusterId561939637") 1519 * .addAllLocations(new ArrayList<String>()) 1520 * .setName("name3373707") 1521 * .build(); 1522 * Operation response = clusterManagerClient.setLocations(request); 1523 * } 1524 * }</pre> 1525 * 1526 * @param request The request object containing all of the parameters for the API call. 1527 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1528 * @deprecated This method is deprecated and will be removed in the next major version update. 1529 */ 1530 @Deprecated setLocations(SetLocationsRequest request)1531 public final Operation setLocations(SetLocationsRequest request) { 1532 return setLocationsCallable().call(request); 1533 } 1534 1535 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1536 /** 1537 * Sets the locations for a specific cluster. Deprecated. Use 1538 * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update) 1539 * instead. 1540 * 1541 * <p>Sample code: 1542 * 1543 * <pre>{@code 1544 * // This snippet has been automatically generated and should be regarded as a code template only. 1545 * // It will require modifications to work: 1546 * // - It may require correct/in-range values for request initialization. 1547 * // - It may require specifying regional endpoints when creating the service client as shown in 1548 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1549 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1550 * SetLocationsRequest request = 1551 * SetLocationsRequest.newBuilder() 1552 * .setProjectId("projectId-894832108") 1553 * .setZone("zone3744684") 1554 * .setClusterId("clusterId561939637") 1555 * .addAllLocations(new ArrayList<String>()) 1556 * .setName("name3373707") 1557 * .build(); 1558 * ApiFuture<Operation> future = clusterManagerClient.setLocationsCallable().futureCall(request); 1559 * // Do something. 1560 * Operation response = future.get(); 1561 * } 1562 * }</pre> 1563 * 1564 * @deprecated This method is deprecated and will be removed in the next major version update. 1565 */ 1566 @Deprecated setLocationsCallable()1567 public final UnaryCallable<SetLocationsRequest, Operation> setLocationsCallable() { 1568 return stub.setLocationsCallable(); 1569 } 1570 1571 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1572 /** 1573 * Updates the master for a specific cluster. 1574 * 1575 * <p>Sample code: 1576 * 1577 * <pre>{@code 1578 * // This snippet has been automatically generated and should be regarded as a code template only. 1579 * // It will require modifications to work: 1580 * // - It may require correct/in-range values for request initialization. 1581 * // - It may require specifying regional endpoints when creating the service client as shown in 1582 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1583 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1584 * String name = "name3373707"; 1585 * String masterVersion = "masterVersion1167095830"; 1586 * Operation response = clusterManagerClient.updateMaster(name, masterVersion); 1587 * } 1588 * }</pre> 1589 * 1590 * @param name The name (project, location, cluster) of the cluster to update. Specified in the 1591 * format `projects/*/locations/*/clusters/*`. 1592 * @param masterVersion Required. The Kubernetes version to change the master to. 1593 * <p>Users may specify either explicit versions offered by Kubernetes Engine or version 1594 * aliases, which have the following behavior: 1595 * <p>- "latest": picks the highest valid Kubernetes version - "1.X": picks the highest valid 1596 * patch+gke.N patch in the 1.X version - "1.X.Y": picks the highest valid gke.N patch in the 1597 * 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": picks the 1598 * default Kubernetes version 1599 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1600 */ updateMaster(String name, String masterVersion)1601 public final Operation updateMaster(String name, String masterVersion) { 1602 UpdateMasterRequest request = 1603 UpdateMasterRequest.newBuilder().setName(name).setMasterVersion(masterVersion).build(); 1604 return updateMaster(request); 1605 } 1606 1607 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1608 /** 1609 * Updates the master for a specific cluster. 1610 * 1611 * <p>Sample code: 1612 * 1613 * <pre>{@code 1614 * // This snippet has been automatically generated and should be regarded as a code template only. 1615 * // It will require modifications to work: 1616 * // - It may require correct/in-range values for request initialization. 1617 * // - It may require specifying regional endpoints when creating the service client as shown in 1618 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1619 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1620 * String projectId = "projectId-894832108"; 1621 * String zone = "zone3744684"; 1622 * String clusterId = "clusterId561939637"; 1623 * String masterVersion = "masterVersion1167095830"; 1624 * Operation response = 1625 * clusterManagerClient.updateMaster(projectId, zone, clusterId, masterVersion); 1626 * } 1627 * }</pre> 1628 * 1629 * @param projectId Deprecated. The Google Developers Console [project ID or project 1630 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 1631 * field has been deprecated and replaced by the name field. 1632 * @param zone Deprecated. The name of the Google Compute Engine 1633 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 1634 * This field has been deprecated and replaced by the name field. 1635 * @param clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated 1636 * and replaced by the name field. 1637 * @param masterVersion Required. The Kubernetes version to change the master to. 1638 * <p>Users may specify either explicit versions offered by Kubernetes Engine or version 1639 * aliases, which have the following behavior: 1640 * <p>- "latest": picks the highest valid Kubernetes version - "1.X": picks the highest valid 1641 * patch+gke.N patch in the 1.X version - "1.X.Y": picks the highest valid gke.N patch in the 1642 * 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": picks the 1643 * default Kubernetes version 1644 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1645 */ updateMaster( String projectId, String zone, String clusterId, String masterVersion)1646 public final Operation updateMaster( 1647 String projectId, String zone, String clusterId, String masterVersion) { 1648 UpdateMasterRequest request = 1649 UpdateMasterRequest.newBuilder() 1650 .setProjectId(projectId) 1651 .setZone(zone) 1652 .setClusterId(clusterId) 1653 .setMasterVersion(masterVersion) 1654 .build(); 1655 return updateMaster(request); 1656 } 1657 1658 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1659 /** 1660 * Updates the master for a specific cluster. 1661 * 1662 * <p>Sample code: 1663 * 1664 * <pre>{@code 1665 * // This snippet has been automatically generated and should be regarded as a code template only. 1666 * // It will require modifications to work: 1667 * // - It may require correct/in-range values for request initialization. 1668 * // - It may require specifying regional endpoints when creating the service client as shown in 1669 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1670 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1671 * UpdateMasterRequest request = 1672 * UpdateMasterRequest.newBuilder() 1673 * .setProjectId("projectId-894832108") 1674 * .setZone("zone3744684") 1675 * .setClusterId("clusterId561939637") 1676 * .setMasterVersion("masterVersion1167095830") 1677 * .setName("name3373707") 1678 * .build(); 1679 * Operation response = clusterManagerClient.updateMaster(request); 1680 * } 1681 * }</pre> 1682 * 1683 * @param request The request object containing all of the parameters for the API call. 1684 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1685 */ updateMaster(UpdateMasterRequest request)1686 public final Operation updateMaster(UpdateMasterRequest request) { 1687 return updateMasterCallable().call(request); 1688 } 1689 1690 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1691 /** 1692 * Updates the master for a specific cluster. 1693 * 1694 * <p>Sample code: 1695 * 1696 * <pre>{@code 1697 * // This snippet has been automatically generated and should be regarded as a code template only. 1698 * // It will require modifications to work: 1699 * // - It may require correct/in-range values for request initialization. 1700 * // - It may require specifying regional endpoints when creating the service client as shown in 1701 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1702 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1703 * UpdateMasterRequest request = 1704 * UpdateMasterRequest.newBuilder() 1705 * .setProjectId("projectId-894832108") 1706 * .setZone("zone3744684") 1707 * .setClusterId("clusterId561939637") 1708 * .setMasterVersion("masterVersion1167095830") 1709 * .setName("name3373707") 1710 * .build(); 1711 * ApiFuture<Operation> future = clusterManagerClient.updateMasterCallable().futureCall(request); 1712 * // Do something. 1713 * Operation response = future.get(); 1714 * } 1715 * }</pre> 1716 */ updateMasterCallable()1717 public final UnaryCallable<UpdateMasterRequest, Operation> updateMasterCallable() { 1718 return stub.updateMasterCallable(); 1719 } 1720 1721 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1722 /** 1723 * Sets master auth materials. Currently supports changing the admin password or a specific 1724 * cluster, either via password generation or explicitly setting the password. 1725 * 1726 * <p>Sample code: 1727 * 1728 * <pre>{@code 1729 * // This snippet has been automatically generated and should be regarded as a code template only. 1730 * // It will require modifications to work: 1731 * // - It may require correct/in-range values for request initialization. 1732 * // - It may require specifying regional endpoints when creating the service client as shown in 1733 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1734 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1735 * SetMasterAuthRequest request = 1736 * SetMasterAuthRequest.newBuilder() 1737 * .setProjectId("projectId-894832108") 1738 * .setZone("zone3744684") 1739 * .setClusterId("clusterId561939637") 1740 * .setUpdate(MasterAuth.newBuilder().build()) 1741 * .setName("name3373707") 1742 * .build(); 1743 * Operation response = clusterManagerClient.setMasterAuth(request); 1744 * } 1745 * }</pre> 1746 * 1747 * @param request The request object containing all of the parameters for the API call. 1748 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1749 */ setMasterAuth(SetMasterAuthRequest request)1750 public final Operation setMasterAuth(SetMasterAuthRequest request) { 1751 return setMasterAuthCallable().call(request); 1752 } 1753 1754 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1755 /** 1756 * Sets master auth materials. Currently supports changing the admin password or a specific 1757 * cluster, either via password generation or explicitly setting the password. 1758 * 1759 * <p>Sample code: 1760 * 1761 * <pre>{@code 1762 * // This snippet has been automatically generated and should be regarded as a code template only. 1763 * // It will require modifications to work: 1764 * // - It may require correct/in-range values for request initialization. 1765 * // - It may require specifying regional endpoints when creating the service client as shown in 1766 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1767 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1768 * SetMasterAuthRequest request = 1769 * SetMasterAuthRequest.newBuilder() 1770 * .setProjectId("projectId-894832108") 1771 * .setZone("zone3744684") 1772 * .setClusterId("clusterId561939637") 1773 * .setUpdate(MasterAuth.newBuilder().build()) 1774 * .setName("name3373707") 1775 * .build(); 1776 * ApiFuture<Operation> future = 1777 * clusterManagerClient.setMasterAuthCallable().futureCall(request); 1778 * // Do something. 1779 * Operation response = future.get(); 1780 * } 1781 * }</pre> 1782 */ setMasterAuthCallable()1783 public final UnaryCallable<SetMasterAuthRequest, Operation> setMasterAuthCallable() { 1784 return stub.setMasterAuthCallable(); 1785 } 1786 1787 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1788 /** 1789 * Deletes the cluster, including the Kubernetes endpoint and all worker nodes. 1790 * 1791 * <p>Firewalls and routes that were configured during cluster creation are also deleted. 1792 * 1793 * <p>Other Google Compute Engine resources that might be in use by the cluster, such as load 1794 * balancer resources, are not deleted if they weren't present when the cluster was initially 1795 * created. 1796 * 1797 * <p>Sample code: 1798 * 1799 * <pre>{@code 1800 * // This snippet has been automatically generated and should be regarded as a code template only. 1801 * // It will require modifications to work: 1802 * // - It may require correct/in-range values for request initialization. 1803 * // - It may require specifying regional endpoints when creating the service client as shown in 1804 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1805 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1806 * String name = "name3373707"; 1807 * Operation response = clusterManagerClient.deleteCluster(name); 1808 * } 1809 * }</pre> 1810 * 1811 * @param name The name (project, location, cluster) of the cluster to delete. Specified in the 1812 * format `projects/*/locations/*/clusters/*`. 1813 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1814 */ deleteCluster(String name)1815 public final Operation deleteCluster(String name) { 1816 DeleteClusterRequest request = DeleteClusterRequest.newBuilder().setName(name).build(); 1817 return deleteCluster(request); 1818 } 1819 1820 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1821 /** 1822 * Deletes the cluster, including the Kubernetes endpoint and all worker nodes. 1823 * 1824 * <p>Firewalls and routes that were configured during cluster creation are also deleted. 1825 * 1826 * <p>Other Google Compute Engine resources that might be in use by the cluster, such as load 1827 * balancer resources, are not deleted if they weren't present when the cluster was initially 1828 * created. 1829 * 1830 * <p>Sample code: 1831 * 1832 * <pre>{@code 1833 * // This snippet has been automatically generated and should be regarded as a code template only. 1834 * // It will require modifications to work: 1835 * // - It may require correct/in-range values for request initialization. 1836 * // - It may require specifying regional endpoints when creating the service client as shown in 1837 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1838 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1839 * String projectId = "projectId-894832108"; 1840 * String zone = "zone3744684"; 1841 * String clusterId = "clusterId561939637"; 1842 * Operation response = clusterManagerClient.deleteCluster(projectId, zone, clusterId); 1843 * } 1844 * }</pre> 1845 * 1846 * @param projectId Deprecated. The Google Developers Console [project ID or project 1847 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 1848 * field has been deprecated and replaced by the name field. 1849 * @param zone Deprecated. The name of the Google Compute Engine 1850 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 1851 * This field has been deprecated and replaced by the name field. 1852 * @param clusterId Deprecated. The name of the cluster to delete. This field has been deprecated 1853 * and replaced by the name field. 1854 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1855 */ deleteCluster(String projectId, String zone, String clusterId)1856 public final Operation deleteCluster(String projectId, String zone, String clusterId) { 1857 DeleteClusterRequest request = 1858 DeleteClusterRequest.newBuilder() 1859 .setProjectId(projectId) 1860 .setZone(zone) 1861 .setClusterId(clusterId) 1862 .build(); 1863 return deleteCluster(request); 1864 } 1865 1866 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1867 /** 1868 * Deletes the cluster, including the Kubernetes endpoint and all worker nodes. 1869 * 1870 * <p>Firewalls and routes that were configured during cluster creation are also deleted. 1871 * 1872 * <p>Other Google Compute Engine resources that might be in use by the cluster, such as load 1873 * balancer resources, are not deleted if they weren't present when the cluster was initially 1874 * created. 1875 * 1876 * <p>Sample code: 1877 * 1878 * <pre>{@code 1879 * // This snippet has been automatically generated and should be regarded as a code template only. 1880 * // It will require modifications to work: 1881 * // - It may require correct/in-range values for request initialization. 1882 * // - It may require specifying regional endpoints when creating the service client as shown in 1883 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1884 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1885 * DeleteClusterRequest request = 1886 * DeleteClusterRequest.newBuilder() 1887 * .setProjectId("projectId-894832108") 1888 * .setZone("zone3744684") 1889 * .setClusterId("clusterId561939637") 1890 * .setName("name3373707") 1891 * .build(); 1892 * Operation response = clusterManagerClient.deleteCluster(request); 1893 * } 1894 * }</pre> 1895 * 1896 * @param request The request object containing all of the parameters for the API call. 1897 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1898 */ deleteCluster(DeleteClusterRequest request)1899 public final Operation deleteCluster(DeleteClusterRequest request) { 1900 return deleteClusterCallable().call(request); 1901 } 1902 1903 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1904 /** 1905 * Deletes the cluster, including the Kubernetes endpoint and all worker nodes. 1906 * 1907 * <p>Firewalls and routes that were configured during cluster creation are also deleted. 1908 * 1909 * <p>Other Google Compute Engine resources that might be in use by the cluster, such as load 1910 * balancer resources, are not deleted if they weren't present when the cluster was initially 1911 * created. 1912 * 1913 * <p>Sample code: 1914 * 1915 * <pre>{@code 1916 * // This snippet has been automatically generated and should be regarded as a code template only. 1917 * // It will require modifications to work: 1918 * // - It may require correct/in-range values for request initialization. 1919 * // - It may require specifying regional endpoints when creating the service client as shown in 1920 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1921 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1922 * DeleteClusterRequest request = 1923 * DeleteClusterRequest.newBuilder() 1924 * .setProjectId("projectId-894832108") 1925 * .setZone("zone3744684") 1926 * .setClusterId("clusterId561939637") 1927 * .setName("name3373707") 1928 * .build(); 1929 * ApiFuture<Operation> future = 1930 * clusterManagerClient.deleteClusterCallable().futureCall(request); 1931 * // Do something. 1932 * Operation response = future.get(); 1933 * } 1934 * }</pre> 1935 */ deleteClusterCallable()1936 public final UnaryCallable<DeleteClusterRequest, Operation> deleteClusterCallable() { 1937 return stub.deleteClusterCallable(); 1938 } 1939 1940 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1941 /** 1942 * Lists all operations in a project in a specific zone or all zones. 1943 * 1944 * <p>Sample code: 1945 * 1946 * <pre>{@code 1947 * // This snippet has been automatically generated and should be regarded as a code template only. 1948 * // It will require modifications to work: 1949 * // - It may require correct/in-range values for request initialization. 1950 * // - It may require specifying regional endpoints when creating the service client as shown in 1951 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1952 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1953 * String projectId = "projectId-894832108"; 1954 * String zone = "zone3744684"; 1955 * ListOperationsResponse response = clusterManagerClient.listOperations(projectId, zone); 1956 * } 1957 * }</pre> 1958 * 1959 * @param projectId Deprecated. The Google Developers Console [project ID or project 1960 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 1961 * field has been deprecated and replaced by the parent field. 1962 * @param zone Deprecated. The name of the Google Compute Engine 1963 * [zone](https://cloud.google.com/compute/docs/zones#available) to return operations for, or 1964 * `-` for all zones. This field has been deprecated and replaced by the parent field. 1965 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1966 */ listOperations(String projectId, String zone)1967 public final ListOperationsResponse listOperations(String projectId, String zone) { 1968 ListOperationsRequest request = 1969 ListOperationsRequest.newBuilder().setProjectId(projectId).setZone(zone).build(); 1970 return listOperations(request); 1971 } 1972 1973 // AUTO-GENERATED DOCUMENTATION AND METHOD. 1974 /** 1975 * Lists all operations in a project in a specific zone or all zones. 1976 * 1977 * <p>Sample code: 1978 * 1979 * <pre>{@code 1980 * // This snippet has been automatically generated and should be regarded as a code template only. 1981 * // It will require modifications to work: 1982 * // - It may require correct/in-range values for request initialization. 1983 * // - It may require specifying regional endpoints when creating the service client as shown in 1984 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 1985 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 1986 * ListOperationsRequest request = 1987 * ListOperationsRequest.newBuilder() 1988 * .setProjectId("projectId-894832108") 1989 * .setZone("zone3744684") 1990 * .setParent("parent-995424086") 1991 * .build(); 1992 * ListOperationsResponse response = clusterManagerClient.listOperations(request); 1993 * } 1994 * }</pre> 1995 * 1996 * @param request The request object containing all of the parameters for the API call. 1997 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 1998 */ listOperations(ListOperationsRequest request)1999 public final ListOperationsResponse listOperations(ListOperationsRequest request) { 2000 return listOperationsCallable().call(request); 2001 } 2002 2003 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2004 /** 2005 * Lists all operations in a project in a specific zone or all zones. 2006 * 2007 * <p>Sample code: 2008 * 2009 * <pre>{@code 2010 * // This snippet has been automatically generated and should be regarded as a code template only. 2011 * // It will require modifications to work: 2012 * // - It may require correct/in-range values for request initialization. 2013 * // - It may require specifying regional endpoints when creating the service client as shown in 2014 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2015 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2016 * ListOperationsRequest request = 2017 * ListOperationsRequest.newBuilder() 2018 * .setProjectId("projectId-894832108") 2019 * .setZone("zone3744684") 2020 * .setParent("parent-995424086") 2021 * .build(); 2022 * ApiFuture<ListOperationsResponse> future = 2023 * clusterManagerClient.listOperationsCallable().futureCall(request); 2024 * // Do something. 2025 * ListOperationsResponse response = future.get(); 2026 * } 2027 * }</pre> 2028 */ 2029 public final UnaryCallable<ListOperationsRequest, ListOperationsResponse> listOperationsCallable()2030 listOperationsCallable() { 2031 return stub.listOperationsCallable(); 2032 } 2033 2034 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2035 /** 2036 * Gets the specified operation. 2037 * 2038 * <p>Sample code: 2039 * 2040 * <pre>{@code 2041 * // This snippet has been automatically generated and should be regarded as a code template only. 2042 * // It will require modifications to work: 2043 * // - It may require correct/in-range values for request initialization. 2044 * // - It may require specifying regional endpoints when creating the service client as shown in 2045 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2046 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2047 * String name = "name3373707"; 2048 * Operation response = clusterManagerClient.getOperation(name); 2049 * } 2050 * }</pre> 2051 * 2052 * @param name The name (project, location, operation id) of the operation to get. Specified in 2053 * the format `projects/*/locations/*/operations/*`. 2054 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2055 */ getOperation(String name)2056 public final Operation getOperation(String name) { 2057 GetOperationRequest request = GetOperationRequest.newBuilder().setName(name).build(); 2058 return getOperation(request); 2059 } 2060 2061 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2062 /** 2063 * Gets the specified operation. 2064 * 2065 * <p>Sample code: 2066 * 2067 * <pre>{@code 2068 * // This snippet has been automatically generated and should be regarded as a code template only. 2069 * // It will require modifications to work: 2070 * // - It may require correct/in-range values for request initialization. 2071 * // - It may require specifying regional endpoints when creating the service client as shown in 2072 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2073 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2074 * String projectId = "projectId-894832108"; 2075 * String zone = "zone3744684"; 2076 * String operationId = "operationId129704162"; 2077 * Operation response = clusterManagerClient.getOperation(projectId, zone, operationId); 2078 * } 2079 * }</pre> 2080 * 2081 * @param projectId Deprecated. The Google Developers Console [project ID or project 2082 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 2083 * field has been deprecated and replaced by the name field. 2084 * @param zone Deprecated. The name of the Google Compute Engine 2085 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 2086 * This field has been deprecated and replaced by the name field. 2087 * @param operationId Deprecated. The server-assigned `name` of the operation. This field has been 2088 * deprecated and replaced by the name field. 2089 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2090 */ getOperation(String projectId, String zone, String operationId)2091 public final Operation getOperation(String projectId, String zone, String operationId) { 2092 GetOperationRequest request = 2093 GetOperationRequest.newBuilder() 2094 .setProjectId(projectId) 2095 .setZone(zone) 2096 .setOperationId(operationId) 2097 .build(); 2098 return getOperation(request); 2099 } 2100 2101 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2102 /** 2103 * Gets the specified operation. 2104 * 2105 * <p>Sample code: 2106 * 2107 * <pre>{@code 2108 * // This snippet has been automatically generated and should be regarded as a code template only. 2109 * // It will require modifications to work: 2110 * // - It may require correct/in-range values for request initialization. 2111 * // - It may require specifying regional endpoints when creating the service client as shown in 2112 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2113 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2114 * GetOperationRequest request = 2115 * GetOperationRequest.newBuilder() 2116 * .setProjectId("projectId-894832108") 2117 * .setZone("zone3744684") 2118 * .setOperationId("operationId129704162") 2119 * .setName("name3373707") 2120 * .build(); 2121 * Operation response = clusterManagerClient.getOperation(request); 2122 * } 2123 * }</pre> 2124 * 2125 * @param request The request object containing all of the parameters for the API call. 2126 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2127 */ getOperation(GetOperationRequest request)2128 public final Operation getOperation(GetOperationRequest request) { 2129 return getOperationCallable().call(request); 2130 } 2131 2132 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2133 /** 2134 * Gets the specified operation. 2135 * 2136 * <p>Sample code: 2137 * 2138 * <pre>{@code 2139 * // This snippet has been automatically generated and should be regarded as a code template only. 2140 * // It will require modifications to work: 2141 * // - It may require correct/in-range values for request initialization. 2142 * // - It may require specifying regional endpoints when creating the service client as shown in 2143 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2144 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2145 * GetOperationRequest request = 2146 * GetOperationRequest.newBuilder() 2147 * .setProjectId("projectId-894832108") 2148 * .setZone("zone3744684") 2149 * .setOperationId("operationId129704162") 2150 * .setName("name3373707") 2151 * .build(); 2152 * ApiFuture<Operation> future = clusterManagerClient.getOperationCallable().futureCall(request); 2153 * // Do something. 2154 * Operation response = future.get(); 2155 * } 2156 * }</pre> 2157 */ getOperationCallable()2158 public final UnaryCallable<GetOperationRequest, Operation> getOperationCallable() { 2159 return stub.getOperationCallable(); 2160 } 2161 2162 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2163 /** 2164 * Cancels the specified operation. 2165 * 2166 * <p>Sample code: 2167 * 2168 * <pre>{@code 2169 * // This snippet has been automatically generated and should be regarded as a code template only. 2170 * // It will require modifications to work: 2171 * // - It may require correct/in-range values for request initialization. 2172 * // - It may require specifying regional endpoints when creating the service client as shown in 2173 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2174 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2175 * String name = "name3373707"; 2176 * clusterManagerClient.cancelOperation(name); 2177 * } 2178 * }</pre> 2179 * 2180 * @param name The name (project, location, operation id) of the operation to cancel. Specified in 2181 * the format `projects/*/locations/*/operations/*`. 2182 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2183 */ cancelOperation(String name)2184 public final void cancelOperation(String name) { 2185 CancelOperationRequest request = CancelOperationRequest.newBuilder().setName(name).build(); 2186 cancelOperation(request); 2187 } 2188 2189 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2190 /** 2191 * Cancels the specified operation. 2192 * 2193 * <p>Sample code: 2194 * 2195 * <pre>{@code 2196 * // This snippet has been automatically generated and should be regarded as a code template only. 2197 * // It will require modifications to work: 2198 * // - It may require correct/in-range values for request initialization. 2199 * // - It may require specifying regional endpoints when creating the service client as shown in 2200 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2201 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2202 * String projectId = "projectId-894832108"; 2203 * String zone = "zone3744684"; 2204 * String operationId = "operationId129704162"; 2205 * clusterManagerClient.cancelOperation(projectId, zone, operationId); 2206 * } 2207 * }</pre> 2208 * 2209 * @param projectId Deprecated. The Google Developers Console [project ID or project 2210 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 2211 * field has been deprecated and replaced by the name field. 2212 * @param zone Deprecated. The name of the Google Compute Engine 2213 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation 2214 * resides. This field has been deprecated and replaced by the name field. 2215 * @param operationId Deprecated. The server-assigned `name` of the operation. This field has been 2216 * deprecated and replaced by the name field. 2217 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2218 */ cancelOperation(String projectId, String zone, String operationId)2219 public final void cancelOperation(String projectId, String zone, String operationId) { 2220 CancelOperationRequest request = 2221 CancelOperationRequest.newBuilder() 2222 .setProjectId(projectId) 2223 .setZone(zone) 2224 .setOperationId(operationId) 2225 .build(); 2226 cancelOperation(request); 2227 } 2228 2229 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2230 /** 2231 * Cancels the specified operation. 2232 * 2233 * <p>Sample code: 2234 * 2235 * <pre>{@code 2236 * // This snippet has been automatically generated and should be regarded as a code template only. 2237 * // It will require modifications to work: 2238 * // - It may require correct/in-range values for request initialization. 2239 * // - It may require specifying regional endpoints when creating the service client as shown in 2240 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2241 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2242 * CancelOperationRequest request = 2243 * CancelOperationRequest.newBuilder() 2244 * .setProjectId("projectId-894832108") 2245 * .setZone("zone3744684") 2246 * .setOperationId("operationId129704162") 2247 * .setName("name3373707") 2248 * .build(); 2249 * clusterManagerClient.cancelOperation(request); 2250 * } 2251 * }</pre> 2252 * 2253 * @param request The request object containing all of the parameters for the API call. 2254 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2255 */ cancelOperation(CancelOperationRequest request)2256 public final void cancelOperation(CancelOperationRequest request) { 2257 cancelOperationCallable().call(request); 2258 } 2259 2260 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2261 /** 2262 * Cancels the specified operation. 2263 * 2264 * <p>Sample code: 2265 * 2266 * <pre>{@code 2267 * // This snippet has been automatically generated and should be regarded as a code template only. 2268 * // It will require modifications to work: 2269 * // - It may require correct/in-range values for request initialization. 2270 * // - It may require specifying regional endpoints when creating the service client as shown in 2271 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2272 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2273 * CancelOperationRequest request = 2274 * CancelOperationRequest.newBuilder() 2275 * .setProjectId("projectId-894832108") 2276 * .setZone("zone3744684") 2277 * .setOperationId("operationId129704162") 2278 * .setName("name3373707") 2279 * .build(); 2280 * ApiFuture<Empty> future = clusterManagerClient.cancelOperationCallable().futureCall(request); 2281 * // Do something. 2282 * future.get(); 2283 * } 2284 * }</pre> 2285 */ cancelOperationCallable()2286 public final UnaryCallable<CancelOperationRequest, Empty> cancelOperationCallable() { 2287 return stub.cancelOperationCallable(); 2288 } 2289 2290 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2291 /** 2292 * Returns configuration info about the Google Kubernetes Engine service. 2293 * 2294 * <p>Sample code: 2295 * 2296 * <pre>{@code 2297 * // This snippet has been automatically generated and should be regarded as a code template only. 2298 * // It will require modifications to work: 2299 * // - It may require correct/in-range values for request initialization. 2300 * // - It may require specifying regional endpoints when creating the service client as shown in 2301 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2302 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2303 * String name = "name3373707"; 2304 * ServerConfig response = clusterManagerClient.getServerConfig(name); 2305 * } 2306 * }</pre> 2307 * 2308 * @param name The name (project and location) of the server config to get, specified in the 2309 * format `projects/*/locations/*`. 2310 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2311 */ getServerConfig(String name)2312 public final ServerConfig getServerConfig(String name) { 2313 GetServerConfigRequest request = GetServerConfigRequest.newBuilder().setName(name).build(); 2314 return getServerConfig(request); 2315 } 2316 2317 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2318 /** 2319 * Returns configuration info about the Google Kubernetes Engine service. 2320 * 2321 * <p>Sample code: 2322 * 2323 * <pre>{@code 2324 * // This snippet has been automatically generated and should be regarded as a code template only. 2325 * // It will require modifications to work: 2326 * // - It may require correct/in-range values for request initialization. 2327 * // - It may require specifying regional endpoints when creating the service client as shown in 2328 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2329 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2330 * String projectId = "projectId-894832108"; 2331 * String zone = "zone3744684"; 2332 * ServerConfig response = clusterManagerClient.getServerConfig(projectId, zone); 2333 * } 2334 * }</pre> 2335 * 2336 * @param projectId Deprecated. The Google Developers Console [project ID or project 2337 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 2338 * field has been deprecated and replaced by the name field. 2339 * @param zone Deprecated. The name of the Google Compute Engine 2340 * [zone](https://cloud.google.com/compute/docs/zones#available) to return operations for. 2341 * This field has been deprecated and replaced by the name field. 2342 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2343 */ getServerConfig(String projectId, String zone)2344 public final ServerConfig getServerConfig(String projectId, String zone) { 2345 GetServerConfigRequest request = 2346 GetServerConfigRequest.newBuilder().setProjectId(projectId).setZone(zone).build(); 2347 return getServerConfig(request); 2348 } 2349 2350 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2351 /** 2352 * Returns configuration info about the Google Kubernetes Engine service. 2353 * 2354 * <p>Sample code: 2355 * 2356 * <pre>{@code 2357 * // This snippet has been automatically generated and should be regarded as a code template only. 2358 * // It will require modifications to work: 2359 * // - It may require correct/in-range values for request initialization. 2360 * // - It may require specifying regional endpoints when creating the service client as shown in 2361 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2362 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2363 * GetServerConfigRequest request = 2364 * GetServerConfigRequest.newBuilder() 2365 * .setProjectId("projectId-894832108") 2366 * .setZone("zone3744684") 2367 * .setName("name3373707") 2368 * .build(); 2369 * ServerConfig response = clusterManagerClient.getServerConfig(request); 2370 * } 2371 * }</pre> 2372 * 2373 * @param request The request object containing all of the parameters for the API call. 2374 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2375 */ getServerConfig(GetServerConfigRequest request)2376 public final ServerConfig getServerConfig(GetServerConfigRequest request) { 2377 return getServerConfigCallable().call(request); 2378 } 2379 2380 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2381 /** 2382 * Returns configuration info about the Google Kubernetes Engine service. 2383 * 2384 * <p>Sample code: 2385 * 2386 * <pre>{@code 2387 * // This snippet has been automatically generated and should be regarded as a code template only. 2388 * // It will require modifications to work: 2389 * // - It may require correct/in-range values for request initialization. 2390 * // - It may require specifying regional endpoints when creating the service client as shown in 2391 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2392 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2393 * GetServerConfigRequest request = 2394 * GetServerConfigRequest.newBuilder() 2395 * .setProjectId("projectId-894832108") 2396 * .setZone("zone3744684") 2397 * .setName("name3373707") 2398 * .build(); 2399 * ApiFuture<ServerConfig> future = 2400 * clusterManagerClient.getServerConfigCallable().futureCall(request); 2401 * // Do something. 2402 * ServerConfig response = future.get(); 2403 * } 2404 * }</pre> 2405 */ getServerConfigCallable()2406 public final UnaryCallable<GetServerConfigRequest, ServerConfig> getServerConfigCallable() { 2407 return stub.getServerConfigCallable(); 2408 } 2409 2410 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2411 /** 2412 * Gets the public component of the cluster signing keys in JSON Web Key format. This API is not 2413 * yet intended for general use, and is not available for all clusters. 2414 * 2415 * <p>Sample code: 2416 * 2417 * <pre>{@code 2418 * // This snippet has been automatically generated and should be regarded as a code template only. 2419 * // It will require modifications to work: 2420 * // - It may require correct/in-range values for request initialization. 2421 * // - It may require specifying regional endpoints when creating the service client as shown in 2422 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2423 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2424 * GetJSONWebKeysRequest request = 2425 * GetJSONWebKeysRequest.newBuilder().setParent("parent-995424086").build(); 2426 * GetJSONWebKeysResponse response = clusterManagerClient.getJSONWebKeys(request); 2427 * } 2428 * }</pre> 2429 * 2430 * @param request The request object containing all of the parameters for the API call. 2431 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2432 */ getJSONWebKeys(GetJSONWebKeysRequest request)2433 public final GetJSONWebKeysResponse getJSONWebKeys(GetJSONWebKeysRequest request) { 2434 return getJSONWebKeysCallable().call(request); 2435 } 2436 2437 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2438 /** 2439 * Gets the public component of the cluster signing keys in JSON Web Key format. This API is not 2440 * yet intended for general use, and is not available for all clusters. 2441 * 2442 * <p>Sample code: 2443 * 2444 * <pre>{@code 2445 * // This snippet has been automatically generated and should be regarded as a code template only. 2446 * // It will require modifications to work: 2447 * // - It may require correct/in-range values for request initialization. 2448 * // - It may require specifying regional endpoints when creating the service client as shown in 2449 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2450 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2451 * GetJSONWebKeysRequest request = 2452 * GetJSONWebKeysRequest.newBuilder().setParent("parent-995424086").build(); 2453 * ApiFuture<GetJSONWebKeysResponse> future = 2454 * clusterManagerClient.getJSONWebKeysCallable().futureCall(request); 2455 * // Do something. 2456 * GetJSONWebKeysResponse response = future.get(); 2457 * } 2458 * }</pre> 2459 */ 2460 public final UnaryCallable<GetJSONWebKeysRequest, GetJSONWebKeysResponse> getJSONWebKeysCallable()2461 getJSONWebKeysCallable() { 2462 return stub.getJSONWebKeysCallable(); 2463 } 2464 2465 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2466 /** 2467 * Lists the node pools for a cluster. 2468 * 2469 * <p>Sample code: 2470 * 2471 * <pre>{@code 2472 * // This snippet has been automatically generated and should be regarded as a code template only. 2473 * // It will require modifications to work: 2474 * // - It may require correct/in-range values for request initialization. 2475 * // - It may require specifying regional endpoints when creating the service client as shown in 2476 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2477 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2478 * String parent = "parent-995424086"; 2479 * ListNodePoolsResponse response = clusterManagerClient.listNodePools(parent); 2480 * } 2481 * }</pre> 2482 * 2483 * @param parent The parent (project, location, cluster name) where the node pools will be listed. 2484 * Specified in the format `projects/*/locations/*/clusters/*`. 2485 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2486 */ listNodePools(String parent)2487 public final ListNodePoolsResponse listNodePools(String parent) { 2488 ListNodePoolsRequest request = ListNodePoolsRequest.newBuilder().setParent(parent).build(); 2489 return listNodePools(request); 2490 } 2491 2492 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2493 /** 2494 * Lists the node pools for a cluster. 2495 * 2496 * <p>Sample code: 2497 * 2498 * <pre>{@code 2499 * // This snippet has been automatically generated and should be regarded as a code template only. 2500 * // It will require modifications to work: 2501 * // - It may require correct/in-range values for request initialization. 2502 * // - It may require specifying regional endpoints when creating the service client as shown in 2503 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2504 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2505 * String projectId = "projectId-894832108"; 2506 * String zone = "zone3744684"; 2507 * String clusterId = "clusterId561939637"; 2508 * ListNodePoolsResponse response = 2509 * clusterManagerClient.listNodePools(projectId, zone, clusterId); 2510 * } 2511 * }</pre> 2512 * 2513 * @param projectId Deprecated. The Google Developers Console [project ID or project 2514 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 2515 * field has been deprecated and replaced by the parent field. 2516 * @param zone Deprecated. The name of the Google Compute Engine 2517 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 2518 * This field has been deprecated and replaced by the parent field. 2519 * @param clusterId Deprecated. The name of the cluster. This field has been deprecated and 2520 * replaced by the parent field. 2521 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2522 */ listNodePools( String projectId, String zone, String clusterId)2523 public final ListNodePoolsResponse listNodePools( 2524 String projectId, String zone, String clusterId) { 2525 ListNodePoolsRequest request = 2526 ListNodePoolsRequest.newBuilder() 2527 .setProjectId(projectId) 2528 .setZone(zone) 2529 .setClusterId(clusterId) 2530 .build(); 2531 return listNodePools(request); 2532 } 2533 2534 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2535 /** 2536 * Lists the node pools for a cluster. 2537 * 2538 * <p>Sample code: 2539 * 2540 * <pre>{@code 2541 * // This snippet has been automatically generated and should be regarded as a code template only. 2542 * // It will require modifications to work: 2543 * // - It may require correct/in-range values for request initialization. 2544 * // - It may require specifying regional endpoints when creating the service client as shown in 2545 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2546 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2547 * ListNodePoolsRequest request = 2548 * ListNodePoolsRequest.newBuilder() 2549 * .setProjectId("projectId-894832108") 2550 * .setZone("zone3744684") 2551 * .setClusterId("clusterId561939637") 2552 * .setParent("parent-995424086") 2553 * .build(); 2554 * ListNodePoolsResponse response = clusterManagerClient.listNodePools(request); 2555 * } 2556 * }</pre> 2557 * 2558 * @param request The request object containing all of the parameters for the API call. 2559 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2560 */ listNodePools(ListNodePoolsRequest request)2561 public final ListNodePoolsResponse listNodePools(ListNodePoolsRequest request) { 2562 return listNodePoolsCallable().call(request); 2563 } 2564 2565 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2566 /** 2567 * Lists the node pools for a cluster. 2568 * 2569 * <p>Sample code: 2570 * 2571 * <pre>{@code 2572 * // This snippet has been automatically generated and should be regarded as a code template only. 2573 * // It will require modifications to work: 2574 * // - It may require correct/in-range values for request initialization. 2575 * // - It may require specifying regional endpoints when creating the service client as shown in 2576 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2577 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2578 * ListNodePoolsRequest request = 2579 * ListNodePoolsRequest.newBuilder() 2580 * .setProjectId("projectId-894832108") 2581 * .setZone("zone3744684") 2582 * .setClusterId("clusterId561939637") 2583 * .setParent("parent-995424086") 2584 * .build(); 2585 * ApiFuture<ListNodePoolsResponse> future = 2586 * clusterManagerClient.listNodePoolsCallable().futureCall(request); 2587 * // Do something. 2588 * ListNodePoolsResponse response = future.get(); 2589 * } 2590 * }</pre> 2591 */ listNodePoolsCallable()2592 public final UnaryCallable<ListNodePoolsRequest, ListNodePoolsResponse> listNodePoolsCallable() { 2593 return stub.listNodePoolsCallable(); 2594 } 2595 2596 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2597 /** 2598 * Retrieves the requested node pool. 2599 * 2600 * <p>Sample code: 2601 * 2602 * <pre>{@code 2603 * // This snippet has been automatically generated and should be regarded as a code template only. 2604 * // It will require modifications to work: 2605 * // - It may require correct/in-range values for request initialization. 2606 * // - It may require specifying regional endpoints when creating the service client as shown in 2607 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2608 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2609 * String name = "name3373707"; 2610 * NodePool response = clusterManagerClient.getNodePool(name); 2611 * } 2612 * }</pre> 2613 * 2614 * @param name The name (project, location, cluster, node pool id) of the node pool to get. 2615 * Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. 2616 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2617 */ getNodePool(String name)2618 public final NodePool getNodePool(String name) { 2619 GetNodePoolRequest request = GetNodePoolRequest.newBuilder().setName(name).build(); 2620 return getNodePool(request); 2621 } 2622 2623 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2624 /** 2625 * Retrieves the requested node pool. 2626 * 2627 * <p>Sample code: 2628 * 2629 * <pre>{@code 2630 * // This snippet has been automatically generated and should be regarded as a code template only. 2631 * // It will require modifications to work: 2632 * // - It may require correct/in-range values for request initialization. 2633 * // - It may require specifying regional endpoints when creating the service client as shown in 2634 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2635 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2636 * String projectId = "projectId-894832108"; 2637 * String zone = "zone3744684"; 2638 * String clusterId = "clusterId561939637"; 2639 * String nodePoolId = "nodePoolId1121557241"; 2640 * NodePool response = clusterManagerClient.getNodePool(projectId, zone, clusterId, nodePoolId); 2641 * } 2642 * }</pre> 2643 * 2644 * @param projectId Deprecated. The Google Developers Console [project ID or project 2645 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 2646 * field has been deprecated and replaced by the name field. 2647 * @param zone Deprecated. The name of the Google Compute Engine 2648 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 2649 * This field has been deprecated and replaced by the name field. 2650 * @param clusterId Deprecated. The name of the cluster. This field has been deprecated and 2651 * replaced by the name field. 2652 * @param nodePoolId Deprecated. The name of the node pool. This field has been deprecated and 2653 * replaced by the name field. 2654 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2655 */ getNodePool( String projectId, String zone, String clusterId, String nodePoolId)2656 public final NodePool getNodePool( 2657 String projectId, String zone, String clusterId, String nodePoolId) { 2658 GetNodePoolRequest request = 2659 GetNodePoolRequest.newBuilder() 2660 .setProjectId(projectId) 2661 .setZone(zone) 2662 .setClusterId(clusterId) 2663 .setNodePoolId(nodePoolId) 2664 .build(); 2665 return getNodePool(request); 2666 } 2667 2668 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2669 /** 2670 * Retrieves the requested node pool. 2671 * 2672 * <p>Sample code: 2673 * 2674 * <pre>{@code 2675 * // This snippet has been automatically generated and should be regarded as a code template only. 2676 * // It will require modifications to work: 2677 * // - It may require correct/in-range values for request initialization. 2678 * // - It may require specifying regional endpoints when creating the service client as shown in 2679 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2680 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2681 * GetNodePoolRequest request = 2682 * GetNodePoolRequest.newBuilder() 2683 * .setProjectId("projectId-894832108") 2684 * .setZone("zone3744684") 2685 * .setClusterId("clusterId561939637") 2686 * .setNodePoolId("nodePoolId1121557241") 2687 * .setName("name3373707") 2688 * .build(); 2689 * NodePool response = clusterManagerClient.getNodePool(request); 2690 * } 2691 * }</pre> 2692 * 2693 * @param request The request object containing all of the parameters for the API call. 2694 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2695 */ getNodePool(GetNodePoolRequest request)2696 public final NodePool getNodePool(GetNodePoolRequest request) { 2697 return getNodePoolCallable().call(request); 2698 } 2699 2700 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2701 /** 2702 * Retrieves the requested node pool. 2703 * 2704 * <p>Sample code: 2705 * 2706 * <pre>{@code 2707 * // This snippet has been automatically generated and should be regarded as a code template only. 2708 * // It will require modifications to work: 2709 * // - It may require correct/in-range values for request initialization. 2710 * // - It may require specifying regional endpoints when creating the service client as shown in 2711 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2712 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2713 * GetNodePoolRequest request = 2714 * GetNodePoolRequest.newBuilder() 2715 * .setProjectId("projectId-894832108") 2716 * .setZone("zone3744684") 2717 * .setClusterId("clusterId561939637") 2718 * .setNodePoolId("nodePoolId1121557241") 2719 * .setName("name3373707") 2720 * .build(); 2721 * ApiFuture<NodePool> future = clusterManagerClient.getNodePoolCallable().futureCall(request); 2722 * // Do something. 2723 * NodePool response = future.get(); 2724 * } 2725 * }</pre> 2726 */ getNodePoolCallable()2727 public final UnaryCallable<GetNodePoolRequest, NodePool> getNodePoolCallable() { 2728 return stub.getNodePoolCallable(); 2729 } 2730 2731 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2732 /** 2733 * Creates a node pool for a cluster. 2734 * 2735 * <p>Sample code: 2736 * 2737 * <pre>{@code 2738 * // This snippet has been automatically generated and should be regarded as a code template only. 2739 * // It will require modifications to work: 2740 * // - It may require correct/in-range values for request initialization. 2741 * // - It may require specifying regional endpoints when creating the service client as shown in 2742 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2743 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2744 * String parent = "parent-995424086"; 2745 * NodePool nodePool = NodePool.newBuilder().build(); 2746 * Operation response = clusterManagerClient.createNodePool(parent, nodePool); 2747 * } 2748 * }</pre> 2749 * 2750 * @param parent The parent (project, location, cluster name) where the node pool will be created. 2751 * Specified in the format `projects/*/locations/*/clusters/*`. 2752 * @param nodePool Required. The node pool to create. 2753 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2754 */ createNodePool(String parent, NodePool nodePool)2755 public final Operation createNodePool(String parent, NodePool nodePool) { 2756 CreateNodePoolRequest request = 2757 CreateNodePoolRequest.newBuilder().setParent(parent).setNodePool(nodePool).build(); 2758 return createNodePool(request); 2759 } 2760 2761 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2762 /** 2763 * Creates a node pool for a cluster. 2764 * 2765 * <p>Sample code: 2766 * 2767 * <pre>{@code 2768 * // This snippet has been automatically generated and should be regarded as a code template only. 2769 * // It will require modifications to work: 2770 * // - It may require correct/in-range values for request initialization. 2771 * // - It may require specifying regional endpoints when creating the service client as shown in 2772 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2773 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2774 * String projectId = "projectId-894832108"; 2775 * String zone = "zone3744684"; 2776 * String clusterId = "clusterId561939637"; 2777 * NodePool nodePool = NodePool.newBuilder().build(); 2778 * Operation response = 2779 * clusterManagerClient.createNodePool(projectId, zone, clusterId, nodePool); 2780 * } 2781 * }</pre> 2782 * 2783 * @param projectId Deprecated. The Google Developers Console [project ID or project 2784 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 2785 * field has been deprecated and replaced by the parent field. 2786 * @param zone Deprecated. The name of the Google Compute Engine 2787 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 2788 * This field has been deprecated and replaced by the parent field. 2789 * @param clusterId Deprecated. The name of the cluster. This field has been deprecated and 2790 * replaced by the parent field. 2791 * @param nodePool Required. The node pool to create. 2792 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2793 */ createNodePool( String projectId, String zone, String clusterId, NodePool nodePool)2794 public final Operation createNodePool( 2795 String projectId, String zone, String clusterId, NodePool nodePool) { 2796 CreateNodePoolRequest request = 2797 CreateNodePoolRequest.newBuilder() 2798 .setProjectId(projectId) 2799 .setZone(zone) 2800 .setClusterId(clusterId) 2801 .setNodePool(nodePool) 2802 .build(); 2803 return createNodePool(request); 2804 } 2805 2806 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2807 /** 2808 * Creates a node pool for a cluster. 2809 * 2810 * <p>Sample code: 2811 * 2812 * <pre>{@code 2813 * // This snippet has been automatically generated and should be regarded as a code template only. 2814 * // It will require modifications to work: 2815 * // - It may require correct/in-range values for request initialization. 2816 * // - It may require specifying regional endpoints when creating the service client as shown in 2817 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2818 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2819 * CreateNodePoolRequest request = 2820 * CreateNodePoolRequest.newBuilder() 2821 * .setProjectId("projectId-894832108") 2822 * .setZone("zone3744684") 2823 * .setClusterId("clusterId561939637") 2824 * .setNodePool(NodePool.newBuilder().build()) 2825 * .setParent("parent-995424086") 2826 * .build(); 2827 * Operation response = clusterManagerClient.createNodePool(request); 2828 * } 2829 * }</pre> 2830 * 2831 * @param request The request object containing all of the parameters for the API call. 2832 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2833 */ createNodePool(CreateNodePoolRequest request)2834 public final Operation createNodePool(CreateNodePoolRequest request) { 2835 return createNodePoolCallable().call(request); 2836 } 2837 2838 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2839 /** 2840 * Creates a node pool for a cluster. 2841 * 2842 * <p>Sample code: 2843 * 2844 * <pre>{@code 2845 * // This snippet has been automatically generated and should be regarded as a code template only. 2846 * // It will require modifications to work: 2847 * // - It may require correct/in-range values for request initialization. 2848 * // - It may require specifying regional endpoints when creating the service client as shown in 2849 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2850 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2851 * CreateNodePoolRequest request = 2852 * CreateNodePoolRequest.newBuilder() 2853 * .setProjectId("projectId-894832108") 2854 * .setZone("zone3744684") 2855 * .setClusterId("clusterId561939637") 2856 * .setNodePool(NodePool.newBuilder().build()) 2857 * .setParent("parent-995424086") 2858 * .build(); 2859 * ApiFuture<Operation> future = 2860 * clusterManagerClient.createNodePoolCallable().futureCall(request); 2861 * // Do something. 2862 * Operation response = future.get(); 2863 * } 2864 * }</pre> 2865 */ createNodePoolCallable()2866 public final UnaryCallable<CreateNodePoolRequest, Operation> createNodePoolCallable() { 2867 return stub.createNodePoolCallable(); 2868 } 2869 2870 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2871 /** 2872 * Deletes a node pool from a cluster. 2873 * 2874 * <p>Sample code: 2875 * 2876 * <pre>{@code 2877 * // This snippet has been automatically generated and should be regarded as a code template only. 2878 * // It will require modifications to work: 2879 * // - It may require correct/in-range values for request initialization. 2880 * // - It may require specifying regional endpoints when creating the service client as shown in 2881 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2882 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2883 * String name = "name3373707"; 2884 * Operation response = clusterManagerClient.deleteNodePool(name); 2885 * } 2886 * }</pre> 2887 * 2888 * @param name The name (project, location, cluster, node pool id) of the node pool to delete. 2889 * Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`. 2890 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2891 */ deleteNodePool(String name)2892 public final Operation deleteNodePool(String name) { 2893 DeleteNodePoolRequest request = DeleteNodePoolRequest.newBuilder().setName(name).build(); 2894 return deleteNodePool(request); 2895 } 2896 2897 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2898 /** 2899 * Deletes a node pool from a cluster. 2900 * 2901 * <p>Sample code: 2902 * 2903 * <pre>{@code 2904 * // This snippet has been automatically generated and should be regarded as a code template only. 2905 * // It will require modifications to work: 2906 * // - It may require correct/in-range values for request initialization. 2907 * // - It may require specifying regional endpoints when creating the service client as shown in 2908 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2909 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2910 * String projectId = "projectId-894832108"; 2911 * String zone = "zone3744684"; 2912 * String clusterId = "clusterId561939637"; 2913 * String nodePoolId = "nodePoolId1121557241"; 2914 * Operation response = 2915 * clusterManagerClient.deleteNodePool(projectId, zone, clusterId, nodePoolId); 2916 * } 2917 * }</pre> 2918 * 2919 * @param projectId Deprecated. The Google Developers Console [project ID or project 2920 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 2921 * field has been deprecated and replaced by the name field. 2922 * @param zone Deprecated. The name of the Google Compute Engine 2923 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 2924 * This field has been deprecated and replaced by the name field. 2925 * @param clusterId Deprecated. The name of the cluster. This field has been deprecated and 2926 * replaced by the name field. 2927 * @param nodePoolId Deprecated. The name of the node pool to delete. This field has been 2928 * deprecated and replaced by the name field. 2929 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2930 */ deleteNodePool( String projectId, String zone, String clusterId, String nodePoolId)2931 public final Operation deleteNodePool( 2932 String projectId, String zone, String clusterId, String nodePoolId) { 2933 DeleteNodePoolRequest request = 2934 DeleteNodePoolRequest.newBuilder() 2935 .setProjectId(projectId) 2936 .setZone(zone) 2937 .setClusterId(clusterId) 2938 .setNodePoolId(nodePoolId) 2939 .build(); 2940 return deleteNodePool(request); 2941 } 2942 2943 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2944 /** 2945 * Deletes a node pool from a cluster. 2946 * 2947 * <p>Sample code: 2948 * 2949 * <pre>{@code 2950 * // This snippet has been automatically generated and should be regarded as a code template only. 2951 * // It will require modifications to work: 2952 * // - It may require correct/in-range values for request initialization. 2953 * // - It may require specifying regional endpoints when creating the service client as shown in 2954 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2955 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2956 * DeleteNodePoolRequest request = 2957 * DeleteNodePoolRequest.newBuilder() 2958 * .setProjectId("projectId-894832108") 2959 * .setZone("zone3744684") 2960 * .setClusterId("clusterId561939637") 2961 * .setNodePoolId("nodePoolId1121557241") 2962 * .setName("name3373707") 2963 * .build(); 2964 * Operation response = clusterManagerClient.deleteNodePool(request); 2965 * } 2966 * }</pre> 2967 * 2968 * @param request The request object containing all of the parameters for the API call. 2969 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 2970 */ deleteNodePool(DeleteNodePoolRequest request)2971 public final Operation deleteNodePool(DeleteNodePoolRequest request) { 2972 return deleteNodePoolCallable().call(request); 2973 } 2974 2975 // AUTO-GENERATED DOCUMENTATION AND METHOD. 2976 /** 2977 * Deletes a node pool from a cluster. 2978 * 2979 * <p>Sample code: 2980 * 2981 * <pre>{@code 2982 * // This snippet has been automatically generated and should be regarded as a code template only. 2983 * // It will require modifications to work: 2984 * // - It may require correct/in-range values for request initialization. 2985 * // - It may require specifying regional endpoints when creating the service client as shown in 2986 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 2987 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 2988 * DeleteNodePoolRequest request = 2989 * DeleteNodePoolRequest.newBuilder() 2990 * .setProjectId("projectId-894832108") 2991 * .setZone("zone3744684") 2992 * .setClusterId("clusterId561939637") 2993 * .setNodePoolId("nodePoolId1121557241") 2994 * .setName("name3373707") 2995 * .build(); 2996 * ApiFuture<Operation> future = 2997 * clusterManagerClient.deleteNodePoolCallable().futureCall(request); 2998 * // Do something. 2999 * Operation response = future.get(); 3000 * } 3001 * }</pre> 3002 */ deleteNodePoolCallable()3003 public final UnaryCallable<DeleteNodePoolRequest, Operation> deleteNodePoolCallable() { 3004 return stub.deleteNodePoolCallable(); 3005 } 3006 3007 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3008 /** 3009 * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete. 3010 * 3011 * <p>Sample code: 3012 * 3013 * <pre>{@code 3014 * // This snippet has been automatically generated and should be regarded as a code template only. 3015 * // It will require modifications to work: 3016 * // - It may require correct/in-range values for request initialization. 3017 * // - It may require specifying regional endpoints when creating the service client as shown in 3018 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3019 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3020 * CompleteNodePoolUpgradeRequest request = 3021 * CompleteNodePoolUpgradeRequest.newBuilder().setName("name3373707").build(); 3022 * clusterManagerClient.completeNodePoolUpgrade(request); 3023 * } 3024 * }</pre> 3025 * 3026 * @param request The request object containing all of the parameters for the API call. 3027 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3028 */ completeNodePoolUpgrade(CompleteNodePoolUpgradeRequest request)3029 public final void completeNodePoolUpgrade(CompleteNodePoolUpgradeRequest request) { 3030 completeNodePoolUpgradeCallable().call(request); 3031 } 3032 3033 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3034 /** 3035 * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete. 3036 * 3037 * <p>Sample code: 3038 * 3039 * <pre>{@code 3040 * // This snippet has been automatically generated and should be regarded as a code template only. 3041 * // It will require modifications to work: 3042 * // - It may require correct/in-range values for request initialization. 3043 * // - It may require specifying regional endpoints when creating the service client as shown in 3044 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3045 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3046 * CompleteNodePoolUpgradeRequest request = 3047 * CompleteNodePoolUpgradeRequest.newBuilder().setName("name3373707").build(); 3048 * ApiFuture<Empty> future = 3049 * clusterManagerClient.completeNodePoolUpgradeCallable().futureCall(request); 3050 * // Do something. 3051 * future.get(); 3052 * } 3053 * }</pre> 3054 */ 3055 public final UnaryCallable<CompleteNodePoolUpgradeRequest, Empty> completeNodePoolUpgradeCallable()3056 completeNodePoolUpgradeCallable() { 3057 return stub.completeNodePoolUpgradeCallable(); 3058 } 3059 3060 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3061 /** 3062 * Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last 3063 * upgrade successfully completed. 3064 * 3065 * <p>Sample code: 3066 * 3067 * <pre>{@code 3068 * // This snippet has been automatically generated and should be regarded as a code template only. 3069 * // It will require modifications to work: 3070 * // - It may require correct/in-range values for request initialization. 3071 * // - It may require specifying regional endpoints when creating the service client as shown in 3072 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3073 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3074 * String name = "name3373707"; 3075 * Operation response = clusterManagerClient.rollbackNodePoolUpgrade(name); 3076 * } 3077 * }</pre> 3078 * 3079 * @param name The name (project, location, cluster, node pool id) of the node poll to rollback 3080 * upgrade. Specified in the format 3081 * `projects/*/locations/*/clusters/*/nodePools/*`. 3082 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3083 */ rollbackNodePoolUpgrade(String name)3084 public final Operation rollbackNodePoolUpgrade(String name) { 3085 RollbackNodePoolUpgradeRequest request = 3086 RollbackNodePoolUpgradeRequest.newBuilder().setName(name).build(); 3087 return rollbackNodePoolUpgrade(request); 3088 } 3089 3090 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3091 /** 3092 * Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last 3093 * upgrade successfully completed. 3094 * 3095 * <p>Sample code: 3096 * 3097 * <pre>{@code 3098 * // This snippet has been automatically generated and should be regarded as a code template only. 3099 * // It will require modifications to work: 3100 * // - It may require correct/in-range values for request initialization. 3101 * // - It may require specifying regional endpoints when creating the service client as shown in 3102 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3103 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3104 * String projectId = "projectId-894832108"; 3105 * String zone = "zone3744684"; 3106 * String clusterId = "clusterId561939637"; 3107 * String nodePoolId = "nodePoolId1121557241"; 3108 * Operation response = 3109 * clusterManagerClient.rollbackNodePoolUpgrade(projectId, zone, clusterId, nodePoolId); 3110 * } 3111 * }</pre> 3112 * 3113 * @param projectId Deprecated. The Google Developers Console [project ID or project 3114 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 3115 * field has been deprecated and replaced by the name field. 3116 * @param zone Deprecated. The name of the Google Compute Engine 3117 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 3118 * This field has been deprecated and replaced by the name field. 3119 * @param clusterId Deprecated. The name of the cluster to rollback. This field has been 3120 * deprecated and replaced by the name field. 3121 * @param nodePoolId Deprecated. The name of the node pool to rollback. This field has been 3122 * deprecated and replaced by the name field. 3123 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3124 */ rollbackNodePoolUpgrade( String projectId, String zone, String clusterId, String nodePoolId)3125 public final Operation rollbackNodePoolUpgrade( 3126 String projectId, String zone, String clusterId, String nodePoolId) { 3127 RollbackNodePoolUpgradeRequest request = 3128 RollbackNodePoolUpgradeRequest.newBuilder() 3129 .setProjectId(projectId) 3130 .setZone(zone) 3131 .setClusterId(clusterId) 3132 .setNodePoolId(nodePoolId) 3133 .build(); 3134 return rollbackNodePoolUpgrade(request); 3135 } 3136 3137 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3138 /** 3139 * Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last 3140 * upgrade successfully completed. 3141 * 3142 * <p>Sample code: 3143 * 3144 * <pre>{@code 3145 * // This snippet has been automatically generated and should be regarded as a code template only. 3146 * // It will require modifications to work: 3147 * // - It may require correct/in-range values for request initialization. 3148 * // - It may require specifying regional endpoints when creating the service client as shown in 3149 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3150 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3151 * RollbackNodePoolUpgradeRequest request = 3152 * RollbackNodePoolUpgradeRequest.newBuilder() 3153 * .setProjectId("projectId-894832108") 3154 * .setZone("zone3744684") 3155 * .setClusterId("clusterId561939637") 3156 * .setNodePoolId("nodePoolId1121557241") 3157 * .setName("name3373707") 3158 * .setRespectPdb(true) 3159 * .build(); 3160 * Operation response = clusterManagerClient.rollbackNodePoolUpgrade(request); 3161 * } 3162 * }</pre> 3163 * 3164 * @param request The request object containing all of the parameters for the API call. 3165 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3166 */ rollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest request)3167 public final Operation rollbackNodePoolUpgrade(RollbackNodePoolUpgradeRequest request) { 3168 return rollbackNodePoolUpgradeCallable().call(request); 3169 } 3170 3171 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3172 /** 3173 * Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last 3174 * upgrade successfully completed. 3175 * 3176 * <p>Sample code: 3177 * 3178 * <pre>{@code 3179 * // This snippet has been automatically generated and should be regarded as a code template only. 3180 * // It will require modifications to work: 3181 * // - It may require correct/in-range values for request initialization. 3182 * // - It may require specifying regional endpoints when creating the service client as shown in 3183 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3184 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3185 * RollbackNodePoolUpgradeRequest request = 3186 * RollbackNodePoolUpgradeRequest.newBuilder() 3187 * .setProjectId("projectId-894832108") 3188 * .setZone("zone3744684") 3189 * .setClusterId("clusterId561939637") 3190 * .setNodePoolId("nodePoolId1121557241") 3191 * .setName("name3373707") 3192 * .setRespectPdb(true) 3193 * .build(); 3194 * ApiFuture<Operation> future = 3195 * clusterManagerClient.rollbackNodePoolUpgradeCallable().futureCall(request); 3196 * // Do something. 3197 * Operation response = future.get(); 3198 * } 3199 * }</pre> 3200 */ 3201 public final UnaryCallable<RollbackNodePoolUpgradeRequest, Operation> rollbackNodePoolUpgradeCallable()3202 rollbackNodePoolUpgradeCallable() { 3203 return stub.rollbackNodePoolUpgradeCallable(); 3204 } 3205 3206 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3207 /** 3208 * Sets the NodeManagement options for a node pool. 3209 * 3210 * <p>Sample code: 3211 * 3212 * <pre>{@code 3213 * // This snippet has been automatically generated and should be regarded as a code template only. 3214 * // It will require modifications to work: 3215 * // - It may require correct/in-range values for request initialization. 3216 * // - It may require specifying regional endpoints when creating the service client as shown in 3217 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3218 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3219 * SetNodePoolManagementRequest request = 3220 * SetNodePoolManagementRequest.newBuilder() 3221 * .setProjectId("projectId-894832108") 3222 * .setZone("zone3744684") 3223 * .setClusterId("clusterId561939637") 3224 * .setNodePoolId("nodePoolId1121557241") 3225 * .setManagement(NodeManagement.newBuilder().build()) 3226 * .setName("name3373707") 3227 * .build(); 3228 * Operation response = clusterManagerClient.setNodePoolManagement(request); 3229 * } 3230 * }</pre> 3231 * 3232 * @param request The request object containing all of the parameters for the API call. 3233 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3234 */ setNodePoolManagement(SetNodePoolManagementRequest request)3235 public final Operation setNodePoolManagement(SetNodePoolManagementRequest request) { 3236 return setNodePoolManagementCallable().call(request); 3237 } 3238 3239 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3240 /** 3241 * Sets the NodeManagement options for a node pool. 3242 * 3243 * <p>Sample code: 3244 * 3245 * <pre>{@code 3246 * // This snippet has been automatically generated and should be regarded as a code template only. 3247 * // It will require modifications to work: 3248 * // - It may require correct/in-range values for request initialization. 3249 * // - It may require specifying regional endpoints when creating the service client as shown in 3250 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3251 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3252 * SetNodePoolManagementRequest request = 3253 * SetNodePoolManagementRequest.newBuilder() 3254 * .setProjectId("projectId-894832108") 3255 * .setZone("zone3744684") 3256 * .setClusterId("clusterId561939637") 3257 * .setNodePoolId("nodePoolId1121557241") 3258 * .setManagement(NodeManagement.newBuilder().build()) 3259 * .setName("name3373707") 3260 * .build(); 3261 * ApiFuture<Operation> future = 3262 * clusterManagerClient.setNodePoolManagementCallable().futureCall(request); 3263 * // Do something. 3264 * Operation response = future.get(); 3265 * } 3266 * }</pre> 3267 */ 3268 public final UnaryCallable<SetNodePoolManagementRequest, Operation> setNodePoolManagementCallable()3269 setNodePoolManagementCallable() { 3270 return stub.setNodePoolManagementCallable(); 3271 } 3272 3273 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3274 /** 3275 * Sets labels on a cluster. 3276 * 3277 * <p>Sample code: 3278 * 3279 * <pre>{@code 3280 * // This snippet has been automatically generated and should be regarded as a code template only. 3281 * // It will require modifications to work: 3282 * // - It may require correct/in-range values for request initialization. 3283 * // - It may require specifying regional endpoints when creating the service client as shown in 3284 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3285 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3286 * SetLabelsRequest request = 3287 * SetLabelsRequest.newBuilder() 3288 * .setProjectId("projectId-894832108") 3289 * .setZone("zone3744684") 3290 * .setClusterId("clusterId561939637") 3291 * .putAllResourceLabels(new HashMap<String, String>()) 3292 * .setLabelFingerprint("labelFingerprint379449680") 3293 * .setName("name3373707") 3294 * .build(); 3295 * Operation response = clusterManagerClient.setLabels(request); 3296 * } 3297 * }</pre> 3298 * 3299 * @param request The request object containing all of the parameters for the API call. 3300 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3301 */ setLabels(SetLabelsRequest request)3302 public final Operation setLabels(SetLabelsRequest request) { 3303 return setLabelsCallable().call(request); 3304 } 3305 3306 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3307 /** 3308 * Sets labels on a cluster. 3309 * 3310 * <p>Sample code: 3311 * 3312 * <pre>{@code 3313 * // This snippet has been automatically generated and should be regarded as a code template only. 3314 * // It will require modifications to work: 3315 * // - It may require correct/in-range values for request initialization. 3316 * // - It may require specifying regional endpoints when creating the service client as shown in 3317 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3318 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3319 * SetLabelsRequest request = 3320 * SetLabelsRequest.newBuilder() 3321 * .setProjectId("projectId-894832108") 3322 * .setZone("zone3744684") 3323 * .setClusterId("clusterId561939637") 3324 * .putAllResourceLabels(new HashMap<String, String>()) 3325 * .setLabelFingerprint("labelFingerprint379449680") 3326 * .setName("name3373707") 3327 * .build(); 3328 * ApiFuture<Operation> future = clusterManagerClient.setLabelsCallable().futureCall(request); 3329 * // Do something. 3330 * Operation response = future.get(); 3331 * } 3332 * }</pre> 3333 */ setLabelsCallable()3334 public final UnaryCallable<SetLabelsRequest, Operation> setLabelsCallable() { 3335 return stub.setLabelsCallable(); 3336 } 3337 3338 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3339 /** 3340 * Enables or disables the ABAC authorization mechanism on a cluster. 3341 * 3342 * <p>Sample code: 3343 * 3344 * <pre>{@code 3345 * // This snippet has been automatically generated and should be regarded as a code template only. 3346 * // It will require modifications to work: 3347 * // - It may require correct/in-range values for request initialization. 3348 * // - It may require specifying regional endpoints when creating the service client as shown in 3349 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3350 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3351 * String name = "name3373707"; 3352 * boolean enabled = true; 3353 * Operation response = clusterManagerClient.setLegacyAbac(name, enabled); 3354 * } 3355 * }</pre> 3356 * 3357 * @param name The name (project, location, cluster name) of the cluster to set legacy abac. 3358 * Specified in the format `projects/*/locations/*/clusters/*`. 3359 * @param enabled Required. Whether ABAC authorization will be enabled in the cluster. 3360 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3361 */ setLegacyAbac(String name, boolean enabled)3362 public final Operation setLegacyAbac(String name, boolean enabled) { 3363 SetLegacyAbacRequest request = 3364 SetLegacyAbacRequest.newBuilder().setName(name).setEnabled(enabled).build(); 3365 return setLegacyAbac(request); 3366 } 3367 3368 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3369 /** 3370 * Enables or disables the ABAC authorization mechanism on a cluster. 3371 * 3372 * <p>Sample code: 3373 * 3374 * <pre>{@code 3375 * // This snippet has been automatically generated and should be regarded as a code template only. 3376 * // It will require modifications to work: 3377 * // - It may require correct/in-range values for request initialization. 3378 * // - It may require specifying regional endpoints when creating the service client as shown in 3379 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3380 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3381 * String projectId = "projectId-894832108"; 3382 * String zone = "zone3744684"; 3383 * String clusterId = "clusterId561939637"; 3384 * boolean enabled = true; 3385 * Operation response = clusterManagerClient.setLegacyAbac(projectId, zone, clusterId, enabled); 3386 * } 3387 * }</pre> 3388 * 3389 * @param projectId Deprecated. The Google Developers Console [project ID or project 3390 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 3391 * field has been deprecated and replaced by the name field. 3392 * @param zone Deprecated. The name of the Google Compute Engine 3393 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 3394 * This field has been deprecated and replaced by the name field. 3395 * @param clusterId Deprecated. The name of the cluster to update. This field has been deprecated 3396 * and replaced by the name field. 3397 * @param enabled Required. Whether ABAC authorization will be enabled in the cluster. 3398 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3399 */ setLegacyAbac( String projectId, String zone, String clusterId, boolean enabled)3400 public final Operation setLegacyAbac( 3401 String projectId, String zone, String clusterId, boolean enabled) { 3402 SetLegacyAbacRequest request = 3403 SetLegacyAbacRequest.newBuilder() 3404 .setProjectId(projectId) 3405 .setZone(zone) 3406 .setClusterId(clusterId) 3407 .setEnabled(enabled) 3408 .build(); 3409 return setLegacyAbac(request); 3410 } 3411 3412 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3413 /** 3414 * Enables or disables the ABAC authorization mechanism on a cluster. 3415 * 3416 * <p>Sample code: 3417 * 3418 * <pre>{@code 3419 * // This snippet has been automatically generated and should be regarded as a code template only. 3420 * // It will require modifications to work: 3421 * // - It may require correct/in-range values for request initialization. 3422 * // - It may require specifying regional endpoints when creating the service client as shown in 3423 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3424 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3425 * SetLegacyAbacRequest request = 3426 * SetLegacyAbacRequest.newBuilder() 3427 * .setProjectId("projectId-894832108") 3428 * .setZone("zone3744684") 3429 * .setClusterId("clusterId561939637") 3430 * .setEnabled(true) 3431 * .setName("name3373707") 3432 * .build(); 3433 * Operation response = clusterManagerClient.setLegacyAbac(request); 3434 * } 3435 * }</pre> 3436 * 3437 * @param request The request object containing all of the parameters for the API call. 3438 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3439 */ setLegacyAbac(SetLegacyAbacRequest request)3440 public final Operation setLegacyAbac(SetLegacyAbacRequest request) { 3441 return setLegacyAbacCallable().call(request); 3442 } 3443 3444 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3445 /** 3446 * Enables or disables the ABAC authorization mechanism on a cluster. 3447 * 3448 * <p>Sample code: 3449 * 3450 * <pre>{@code 3451 * // This snippet has been automatically generated and should be regarded as a code template only. 3452 * // It will require modifications to work: 3453 * // - It may require correct/in-range values for request initialization. 3454 * // - It may require specifying regional endpoints when creating the service client as shown in 3455 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3456 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3457 * SetLegacyAbacRequest request = 3458 * SetLegacyAbacRequest.newBuilder() 3459 * .setProjectId("projectId-894832108") 3460 * .setZone("zone3744684") 3461 * .setClusterId("clusterId561939637") 3462 * .setEnabled(true) 3463 * .setName("name3373707") 3464 * .build(); 3465 * ApiFuture<Operation> future = 3466 * clusterManagerClient.setLegacyAbacCallable().futureCall(request); 3467 * // Do something. 3468 * Operation response = future.get(); 3469 * } 3470 * }</pre> 3471 */ setLegacyAbacCallable()3472 public final UnaryCallable<SetLegacyAbacRequest, Operation> setLegacyAbacCallable() { 3473 return stub.setLegacyAbacCallable(); 3474 } 3475 3476 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3477 /** 3478 * Starts master IP rotation. 3479 * 3480 * <p>Sample code: 3481 * 3482 * <pre>{@code 3483 * // This snippet has been automatically generated and should be regarded as a code template only. 3484 * // It will require modifications to work: 3485 * // - It may require correct/in-range values for request initialization. 3486 * // - It may require specifying regional endpoints when creating the service client as shown in 3487 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3488 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3489 * String name = "name3373707"; 3490 * Operation response = clusterManagerClient.startIPRotation(name); 3491 * } 3492 * }</pre> 3493 * 3494 * @param name The name (project, location, cluster name) of the cluster to start IP rotation. 3495 * Specified in the format `projects/*/locations/*/clusters/*`. 3496 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3497 */ startIPRotation(String name)3498 public final Operation startIPRotation(String name) { 3499 StartIPRotationRequest request = StartIPRotationRequest.newBuilder().setName(name).build(); 3500 return startIPRotation(request); 3501 } 3502 3503 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3504 /** 3505 * Starts master IP rotation. 3506 * 3507 * <p>Sample code: 3508 * 3509 * <pre>{@code 3510 * // This snippet has been automatically generated and should be regarded as a code template only. 3511 * // It will require modifications to work: 3512 * // - It may require correct/in-range values for request initialization. 3513 * // - It may require specifying regional endpoints when creating the service client as shown in 3514 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3515 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3516 * String projectId = "projectId-894832108"; 3517 * String zone = "zone3744684"; 3518 * String clusterId = "clusterId561939637"; 3519 * Operation response = clusterManagerClient.startIPRotation(projectId, zone, clusterId); 3520 * } 3521 * }</pre> 3522 * 3523 * @param projectId Deprecated. The Google Developers Console [project ID or project 3524 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 3525 * field has been deprecated and replaced by the name field. 3526 * @param zone Deprecated. The name of the Google Compute Engine 3527 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 3528 * This field has been deprecated and replaced by the name field. 3529 * @param clusterId Deprecated. The name of the cluster. This field has been deprecated and 3530 * replaced by the name field. 3531 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3532 */ startIPRotation(String projectId, String zone, String clusterId)3533 public final Operation startIPRotation(String projectId, String zone, String clusterId) { 3534 StartIPRotationRequest request = 3535 StartIPRotationRequest.newBuilder() 3536 .setProjectId(projectId) 3537 .setZone(zone) 3538 .setClusterId(clusterId) 3539 .build(); 3540 return startIPRotation(request); 3541 } 3542 3543 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3544 /** 3545 * Starts master IP rotation. 3546 * 3547 * <p>Sample code: 3548 * 3549 * <pre>{@code 3550 * // This snippet has been automatically generated and should be regarded as a code template only. 3551 * // It will require modifications to work: 3552 * // - It may require correct/in-range values for request initialization. 3553 * // - It may require specifying regional endpoints when creating the service client as shown in 3554 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3555 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3556 * StartIPRotationRequest request = 3557 * StartIPRotationRequest.newBuilder() 3558 * .setProjectId("projectId-894832108") 3559 * .setZone("zone3744684") 3560 * .setClusterId("clusterId561939637") 3561 * .setName("name3373707") 3562 * .setRotateCredentials(true) 3563 * .build(); 3564 * Operation response = clusterManagerClient.startIPRotation(request); 3565 * } 3566 * }</pre> 3567 * 3568 * @param request The request object containing all of the parameters for the API call. 3569 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3570 */ startIPRotation(StartIPRotationRequest request)3571 public final Operation startIPRotation(StartIPRotationRequest request) { 3572 return startIPRotationCallable().call(request); 3573 } 3574 3575 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3576 /** 3577 * Starts master IP rotation. 3578 * 3579 * <p>Sample code: 3580 * 3581 * <pre>{@code 3582 * // This snippet has been automatically generated and should be regarded as a code template only. 3583 * // It will require modifications to work: 3584 * // - It may require correct/in-range values for request initialization. 3585 * // - It may require specifying regional endpoints when creating the service client as shown in 3586 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3587 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3588 * StartIPRotationRequest request = 3589 * StartIPRotationRequest.newBuilder() 3590 * .setProjectId("projectId-894832108") 3591 * .setZone("zone3744684") 3592 * .setClusterId("clusterId561939637") 3593 * .setName("name3373707") 3594 * .setRotateCredentials(true) 3595 * .build(); 3596 * ApiFuture<Operation> future = 3597 * clusterManagerClient.startIPRotationCallable().futureCall(request); 3598 * // Do something. 3599 * Operation response = future.get(); 3600 * } 3601 * }</pre> 3602 */ startIPRotationCallable()3603 public final UnaryCallable<StartIPRotationRequest, Operation> startIPRotationCallable() { 3604 return stub.startIPRotationCallable(); 3605 } 3606 3607 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3608 /** 3609 * Completes master IP rotation. 3610 * 3611 * <p>Sample code: 3612 * 3613 * <pre>{@code 3614 * // This snippet has been automatically generated and should be regarded as a code template only. 3615 * // It will require modifications to work: 3616 * // - It may require correct/in-range values for request initialization. 3617 * // - It may require specifying regional endpoints when creating the service client as shown in 3618 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3619 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3620 * String name = "name3373707"; 3621 * Operation response = clusterManagerClient.completeIPRotation(name); 3622 * } 3623 * }</pre> 3624 * 3625 * @param name The name (project, location, cluster name) of the cluster to complete IP rotation. 3626 * Specified in the format `projects/*/locations/*/clusters/*`. 3627 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3628 */ completeIPRotation(String name)3629 public final Operation completeIPRotation(String name) { 3630 CompleteIPRotationRequest request = 3631 CompleteIPRotationRequest.newBuilder().setName(name).build(); 3632 return completeIPRotation(request); 3633 } 3634 3635 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3636 /** 3637 * Completes master IP rotation. 3638 * 3639 * <p>Sample code: 3640 * 3641 * <pre>{@code 3642 * // This snippet has been automatically generated and should be regarded as a code template only. 3643 * // It will require modifications to work: 3644 * // - It may require correct/in-range values for request initialization. 3645 * // - It may require specifying regional endpoints when creating the service client as shown in 3646 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3647 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3648 * String projectId = "projectId-894832108"; 3649 * String zone = "zone3744684"; 3650 * String clusterId = "clusterId561939637"; 3651 * Operation response = clusterManagerClient.completeIPRotation(projectId, zone, clusterId); 3652 * } 3653 * }</pre> 3654 * 3655 * @param projectId Deprecated. The Google Developers Console [project ID or project 3656 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 3657 * field has been deprecated and replaced by the name field. 3658 * @param zone Deprecated. The name of the Google Compute Engine 3659 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 3660 * This field has been deprecated and replaced by the name field. 3661 * @param clusterId Deprecated. The name of the cluster. This field has been deprecated and 3662 * replaced by the name field. 3663 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3664 */ completeIPRotation(String projectId, String zone, String clusterId)3665 public final Operation completeIPRotation(String projectId, String zone, String clusterId) { 3666 CompleteIPRotationRequest request = 3667 CompleteIPRotationRequest.newBuilder() 3668 .setProjectId(projectId) 3669 .setZone(zone) 3670 .setClusterId(clusterId) 3671 .build(); 3672 return completeIPRotation(request); 3673 } 3674 3675 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3676 /** 3677 * Completes master IP rotation. 3678 * 3679 * <p>Sample code: 3680 * 3681 * <pre>{@code 3682 * // This snippet has been automatically generated and should be regarded as a code template only. 3683 * // It will require modifications to work: 3684 * // - It may require correct/in-range values for request initialization. 3685 * // - It may require specifying regional endpoints when creating the service client as shown in 3686 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3687 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3688 * CompleteIPRotationRequest request = 3689 * CompleteIPRotationRequest.newBuilder() 3690 * .setProjectId("projectId-894832108") 3691 * .setZone("zone3744684") 3692 * .setClusterId("clusterId561939637") 3693 * .setName("name3373707") 3694 * .build(); 3695 * Operation response = clusterManagerClient.completeIPRotation(request); 3696 * } 3697 * }</pre> 3698 * 3699 * @param request The request object containing all of the parameters for the API call. 3700 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3701 */ completeIPRotation(CompleteIPRotationRequest request)3702 public final Operation completeIPRotation(CompleteIPRotationRequest request) { 3703 return completeIPRotationCallable().call(request); 3704 } 3705 3706 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3707 /** 3708 * Completes master IP rotation. 3709 * 3710 * <p>Sample code: 3711 * 3712 * <pre>{@code 3713 * // This snippet has been automatically generated and should be regarded as a code template only. 3714 * // It will require modifications to work: 3715 * // - It may require correct/in-range values for request initialization. 3716 * // - It may require specifying regional endpoints when creating the service client as shown in 3717 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3718 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3719 * CompleteIPRotationRequest request = 3720 * CompleteIPRotationRequest.newBuilder() 3721 * .setProjectId("projectId-894832108") 3722 * .setZone("zone3744684") 3723 * .setClusterId("clusterId561939637") 3724 * .setName("name3373707") 3725 * .build(); 3726 * ApiFuture<Operation> future = 3727 * clusterManagerClient.completeIPRotationCallable().futureCall(request); 3728 * // Do something. 3729 * Operation response = future.get(); 3730 * } 3731 * }</pre> 3732 */ completeIPRotationCallable()3733 public final UnaryCallable<CompleteIPRotationRequest, Operation> completeIPRotationCallable() { 3734 return stub.completeIPRotationCallable(); 3735 } 3736 3737 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3738 /** 3739 * Sets the size for a specific node pool. The new size will be used for all replicas, including 3740 * future replicas created by modifying 3741 * [NodePool.locations][google.container.v1.NodePool.locations]. 3742 * 3743 * <p>Sample code: 3744 * 3745 * <pre>{@code 3746 * // This snippet has been automatically generated and should be regarded as a code template only. 3747 * // It will require modifications to work: 3748 * // - It may require correct/in-range values for request initialization. 3749 * // - It may require specifying regional endpoints when creating the service client as shown in 3750 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3751 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3752 * SetNodePoolSizeRequest request = 3753 * SetNodePoolSizeRequest.newBuilder() 3754 * .setProjectId("projectId-894832108") 3755 * .setZone("zone3744684") 3756 * .setClusterId("clusterId561939637") 3757 * .setNodePoolId("nodePoolId1121557241") 3758 * .setNodeCount(1539922066) 3759 * .setName("name3373707") 3760 * .build(); 3761 * Operation response = clusterManagerClient.setNodePoolSize(request); 3762 * } 3763 * }</pre> 3764 * 3765 * @param request The request object containing all of the parameters for the API call. 3766 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3767 */ setNodePoolSize(SetNodePoolSizeRequest request)3768 public final Operation setNodePoolSize(SetNodePoolSizeRequest request) { 3769 return setNodePoolSizeCallable().call(request); 3770 } 3771 3772 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3773 /** 3774 * Sets the size for a specific node pool. The new size will be used for all replicas, including 3775 * future replicas created by modifying 3776 * [NodePool.locations][google.container.v1.NodePool.locations]. 3777 * 3778 * <p>Sample code: 3779 * 3780 * <pre>{@code 3781 * // This snippet has been automatically generated and should be regarded as a code template only. 3782 * // It will require modifications to work: 3783 * // - It may require correct/in-range values for request initialization. 3784 * // - It may require specifying regional endpoints when creating the service client as shown in 3785 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3786 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3787 * SetNodePoolSizeRequest request = 3788 * SetNodePoolSizeRequest.newBuilder() 3789 * .setProjectId("projectId-894832108") 3790 * .setZone("zone3744684") 3791 * .setClusterId("clusterId561939637") 3792 * .setNodePoolId("nodePoolId1121557241") 3793 * .setNodeCount(1539922066) 3794 * .setName("name3373707") 3795 * .build(); 3796 * ApiFuture<Operation> future = 3797 * clusterManagerClient.setNodePoolSizeCallable().futureCall(request); 3798 * // Do something. 3799 * Operation response = future.get(); 3800 * } 3801 * }</pre> 3802 */ setNodePoolSizeCallable()3803 public final UnaryCallable<SetNodePoolSizeRequest, Operation> setNodePoolSizeCallable() { 3804 return stub.setNodePoolSizeCallable(); 3805 } 3806 3807 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3808 /** 3809 * Enables or disables Network Policy for a cluster. 3810 * 3811 * <p>Sample code: 3812 * 3813 * <pre>{@code 3814 * // This snippet has been automatically generated and should be regarded as a code template only. 3815 * // It will require modifications to work: 3816 * // - It may require correct/in-range values for request initialization. 3817 * // - It may require specifying regional endpoints when creating the service client as shown in 3818 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3819 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3820 * String name = "name3373707"; 3821 * NetworkPolicy networkPolicy = NetworkPolicy.newBuilder().build(); 3822 * Operation response = clusterManagerClient.setNetworkPolicy(name, networkPolicy); 3823 * } 3824 * }</pre> 3825 * 3826 * @param name The name (project, location, cluster name) of the cluster to set networking policy. 3827 * Specified in the format `projects/*/locations/*/clusters/*`. 3828 * @param networkPolicy Required. Configuration options for the NetworkPolicy feature. 3829 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3830 */ setNetworkPolicy(String name, NetworkPolicy networkPolicy)3831 public final Operation setNetworkPolicy(String name, NetworkPolicy networkPolicy) { 3832 SetNetworkPolicyRequest request = 3833 SetNetworkPolicyRequest.newBuilder().setName(name).setNetworkPolicy(networkPolicy).build(); 3834 return setNetworkPolicy(request); 3835 } 3836 3837 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3838 /** 3839 * Enables or disables Network Policy for a cluster. 3840 * 3841 * <p>Sample code: 3842 * 3843 * <pre>{@code 3844 * // This snippet has been automatically generated and should be regarded as a code template only. 3845 * // It will require modifications to work: 3846 * // - It may require correct/in-range values for request initialization. 3847 * // - It may require specifying regional endpoints when creating the service client as shown in 3848 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3849 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3850 * String projectId = "projectId-894832108"; 3851 * String zone = "zone3744684"; 3852 * String clusterId = "clusterId561939637"; 3853 * NetworkPolicy networkPolicy = NetworkPolicy.newBuilder().build(); 3854 * Operation response = 3855 * clusterManagerClient.setNetworkPolicy(projectId, zone, clusterId, networkPolicy); 3856 * } 3857 * }</pre> 3858 * 3859 * @param projectId Deprecated. The Google Developers Console [project ID or project 3860 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). This 3861 * field has been deprecated and replaced by the name field. 3862 * @param zone Deprecated. The name of the Google Compute Engine 3863 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 3864 * This field has been deprecated and replaced by the name field. 3865 * @param clusterId Deprecated. The name of the cluster. This field has been deprecated and 3866 * replaced by the name field. 3867 * @param networkPolicy Required. Configuration options for the NetworkPolicy feature. 3868 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3869 */ setNetworkPolicy( String projectId, String zone, String clusterId, NetworkPolicy networkPolicy)3870 public final Operation setNetworkPolicy( 3871 String projectId, String zone, String clusterId, NetworkPolicy networkPolicy) { 3872 SetNetworkPolicyRequest request = 3873 SetNetworkPolicyRequest.newBuilder() 3874 .setProjectId(projectId) 3875 .setZone(zone) 3876 .setClusterId(clusterId) 3877 .setNetworkPolicy(networkPolicy) 3878 .build(); 3879 return setNetworkPolicy(request); 3880 } 3881 3882 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3883 /** 3884 * Enables or disables Network Policy for a cluster. 3885 * 3886 * <p>Sample code: 3887 * 3888 * <pre>{@code 3889 * // This snippet has been automatically generated and should be regarded as a code template only. 3890 * // It will require modifications to work: 3891 * // - It may require correct/in-range values for request initialization. 3892 * // - It may require specifying regional endpoints when creating the service client as shown in 3893 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3894 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3895 * SetNetworkPolicyRequest request = 3896 * SetNetworkPolicyRequest.newBuilder() 3897 * .setProjectId("projectId-894832108") 3898 * .setZone("zone3744684") 3899 * .setClusterId("clusterId561939637") 3900 * .setNetworkPolicy(NetworkPolicy.newBuilder().build()) 3901 * .setName("name3373707") 3902 * .build(); 3903 * Operation response = clusterManagerClient.setNetworkPolicy(request); 3904 * } 3905 * }</pre> 3906 * 3907 * @param request The request object containing all of the parameters for the API call. 3908 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3909 */ setNetworkPolicy(SetNetworkPolicyRequest request)3910 public final Operation setNetworkPolicy(SetNetworkPolicyRequest request) { 3911 return setNetworkPolicyCallable().call(request); 3912 } 3913 3914 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3915 /** 3916 * Enables or disables Network Policy for a cluster. 3917 * 3918 * <p>Sample code: 3919 * 3920 * <pre>{@code 3921 * // This snippet has been automatically generated and should be regarded as a code template only. 3922 * // It will require modifications to work: 3923 * // - It may require correct/in-range values for request initialization. 3924 * // - It may require specifying regional endpoints when creating the service client as shown in 3925 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3926 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3927 * SetNetworkPolicyRequest request = 3928 * SetNetworkPolicyRequest.newBuilder() 3929 * .setProjectId("projectId-894832108") 3930 * .setZone("zone3744684") 3931 * .setClusterId("clusterId561939637") 3932 * .setNetworkPolicy(NetworkPolicy.newBuilder().build()) 3933 * .setName("name3373707") 3934 * .build(); 3935 * ApiFuture<Operation> future = 3936 * clusterManagerClient.setNetworkPolicyCallable().futureCall(request); 3937 * // Do something. 3938 * Operation response = future.get(); 3939 * } 3940 * }</pre> 3941 */ setNetworkPolicyCallable()3942 public final UnaryCallable<SetNetworkPolicyRequest, Operation> setNetworkPolicyCallable() { 3943 return stub.setNetworkPolicyCallable(); 3944 } 3945 3946 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3947 /** 3948 * Sets the maintenance policy for a cluster. 3949 * 3950 * <p>Sample code: 3951 * 3952 * <pre>{@code 3953 * // This snippet has been automatically generated and should be regarded as a code template only. 3954 * // It will require modifications to work: 3955 * // - It may require correct/in-range values for request initialization. 3956 * // - It may require specifying regional endpoints when creating the service client as shown in 3957 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3958 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3959 * String name = "name3373707"; 3960 * MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build(); 3961 * Operation response = clusterManagerClient.setMaintenancePolicy(name, maintenancePolicy); 3962 * } 3963 * }</pre> 3964 * 3965 * @param name The name (project, location, cluster name) of the cluster to set maintenance 3966 * policy. Specified in the format `projects/*/locations/*/clusters/*`. 3967 * @param maintenancePolicy Required. The maintenance policy to be set for the cluster. An empty 3968 * field clears the existing maintenance policy. 3969 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 3970 */ setMaintenancePolicy(String name, MaintenancePolicy maintenancePolicy)3971 public final Operation setMaintenancePolicy(String name, MaintenancePolicy maintenancePolicy) { 3972 SetMaintenancePolicyRequest request = 3973 SetMaintenancePolicyRequest.newBuilder() 3974 .setName(name) 3975 .setMaintenancePolicy(maintenancePolicy) 3976 .build(); 3977 return setMaintenancePolicy(request); 3978 } 3979 3980 // AUTO-GENERATED DOCUMENTATION AND METHOD. 3981 /** 3982 * Sets the maintenance policy for a cluster. 3983 * 3984 * <p>Sample code: 3985 * 3986 * <pre>{@code 3987 * // This snippet has been automatically generated and should be regarded as a code template only. 3988 * // It will require modifications to work: 3989 * // - It may require correct/in-range values for request initialization. 3990 * // - It may require specifying regional endpoints when creating the service client as shown in 3991 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 3992 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 3993 * String projectId = "projectId-894832108"; 3994 * String zone = "zone3744684"; 3995 * String clusterId = "clusterId561939637"; 3996 * MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build(); 3997 * Operation response = 3998 * clusterManagerClient.setMaintenancePolicy(projectId, zone, clusterId, maintenancePolicy); 3999 * } 4000 * }</pre> 4001 * 4002 * @param projectId Required. The Google Developers Console [project ID or project 4003 * number](https://cloud.google.com/resource-manager/docs/creating-managing-projects). 4004 * @param zone Required. The name of the Google Compute Engine 4005 * [zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster resides. 4006 * @param clusterId Required. The name of the cluster to update. 4007 * @param maintenancePolicy Required. The maintenance policy to be set for the cluster. An empty 4008 * field clears the existing maintenance policy. 4009 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4010 */ setMaintenancePolicy( String projectId, String zone, String clusterId, MaintenancePolicy maintenancePolicy)4011 public final Operation setMaintenancePolicy( 4012 String projectId, String zone, String clusterId, MaintenancePolicy maintenancePolicy) { 4013 SetMaintenancePolicyRequest request = 4014 SetMaintenancePolicyRequest.newBuilder() 4015 .setProjectId(projectId) 4016 .setZone(zone) 4017 .setClusterId(clusterId) 4018 .setMaintenancePolicy(maintenancePolicy) 4019 .build(); 4020 return setMaintenancePolicy(request); 4021 } 4022 4023 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4024 /** 4025 * Sets the maintenance policy for a cluster. 4026 * 4027 * <p>Sample code: 4028 * 4029 * <pre>{@code 4030 * // This snippet has been automatically generated and should be regarded as a code template only. 4031 * // It will require modifications to work: 4032 * // - It may require correct/in-range values for request initialization. 4033 * // - It may require specifying regional endpoints when creating the service client as shown in 4034 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4035 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 4036 * SetMaintenancePolicyRequest request = 4037 * SetMaintenancePolicyRequest.newBuilder() 4038 * .setProjectId("projectId-894832108") 4039 * .setZone("zone3744684") 4040 * .setClusterId("clusterId561939637") 4041 * .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) 4042 * .setName("name3373707") 4043 * .build(); 4044 * Operation response = clusterManagerClient.setMaintenancePolicy(request); 4045 * } 4046 * }</pre> 4047 * 4048 * @param request The request object containing all of the parameters for the API call. 4049 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4050 */ setMaintenancePolicy(SetMaintenancePolicyRequest request)4051 public final Operation setMaintenancePolicy(SetMaintenancePolicyRequest request) { 4052 return setMaintenancePolicyCallable().call(request); 4053 } 4054 4055 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4056 /** 4057 * Sets the maintenance policy for a cluster. 4058 * 4059 * <p>Sample code: 4060 * 4061 * <pre>{@code 4062 * // This snippet has been automatically generated and should be regarded as a code template only. 4063 * // It will require modifications to work: 4064 * // - It may require correct/in-range values for request initialization. 4065 * // - It may require specifying regional endpoints when creating the service client as shown in 4066 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4067 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 4068 * SetMaintenancePolicyRequest request = 4069 * SetMaintenancePolicyRequest.newBuilder() 4070 * .setProjectId("projectId-894832108") 4071 * .setZone("zone3744684") 4072 * .setClusterId("clusterId561939637") 4073 * .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) 4074 * .setName("name3373707") 4075 * .build(); 4076 * ApiFuture<Operation> future = 4077 * clusterManagerClient.setMaintenancePolicyCallable().futureCall(request); 4078 * // Do something. 4079 * Operation response = future.get(); 4080 * } 4081 * }</pre> 4082 */ 4083 public final UnaryCallable<SetMaintenancePolicyRequest, Operation> setMaintenancePolicyCallable()4084 setMaintenancePolicyCallable() { 4085 return stub.setMaintenancePolicyCallable(); 4086 } 4087 4088 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4089 /** 4090 * Lists subnetworks that are usable for creating clusters in a project. 4091 * 4092 * <p>Sample code: 4093 * 4094 * <pre>{@code 4095 * // This snippet has been automatically generated and should be regarded as a code template only. 4096 * // It will require modifications to work: 4097 * // - It may require correct/in-range values for request initialization. 4098 * // - It may require specifying regional endpoints when creating the service client as shown in 4099 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4100 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 4101 * ListUsableSubnetworksRequest request = 4102 * ListUsableSubnetworksRequest.newBuilder() 4103 * .setParent("parent-995424086") 4104 * .setFilter("filter-1274492040") 4105 * .setPageSize(883849137) 4106 * .setPageToken("pageToken873572522") 4107 * .build(); 4108 * for (UsableSubnetwork element : 4109 * clusterManagerClient.listUsableSubnetworks(request).iterateAll()) { 4110 * // doThingsWith(element); 4111 * } 4112 * } 4113 * }</pre> 4114 * 4115 * @param request The request object containing all of the parameters for the API call. 4116 * @throws com.google.api.gax.rpc.ApiException if the remote call fails 4117 */ listUsableSubnetworks( ListUsableSubnetworksRequest request)4118 public final ListUsableSubnetworksPagedResponse listUsableSubnetworks( 4119 ListUsableSubnetworksRequest request) { 4120 return listUsableSubnetworksPagedCallable().call(request); 4121 } 4122 4123 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4124 /** 4125 * Lists subnetworks that are usable for creating clusters in a project. 4126 * 4127 * <p>Sample code: 4128 * 4129 * <pre>{@code 4130 * // This snippet has been automatically generated and should be regarded as a code template only. 4131 * // It will require modifications to work: 4132 * // - It may require correct/in-range values for request initialization. 4133 * // - It may require specifying regional endpoints when creating the service client as shown in 4134 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4135 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 4136 * ListUsableSubnetworksRequest request = 4137 * ListUsableSubnetworksRequest.newBuilder() 4138 * .setParent("parent-995424086") 4139 * .setFilter("filter-1274492040") 4140 * .setPageSize(883849137) 4141 * .setPageToken("pageToken873572522") 4142 * .build(); 4143 * ApiFuture<UsableSubnetwork> future = 4144 * clusterManagerClient.listUsableSubnetworksPagedCallable().futureCall(request); 4145 * // Do something. 4146 * for (UsableSubnetwork element : future.get().iterateAll()) { 4147 * // doThingsWith(element); 4148 * } 4149 * } 4150 * }</pre> 4151 */ 4152 public final UnaryCallable<ListUsableSubnetworksRequest, ListUsableSubnetworksPagedResponse> listUsableSubnetworksPagedCallable()4153 listUsableSubnetworksPagedCallable() { 4154 return stub.listUsableSubnetworksPagedCallable(); 4155 } 4156 4157 // AUTO-GENERATED DOCUMENTATION AND METHOD. 4158 /** 4159 * Lists subnetworks that are usable for creating clusters in a project. 4160 * 4161 * <p>Sample code: 4162 * 4163 * <pre>{@code 4164 * // This snippet has been automatically generated and should be regarded as a code template only. 4165 * // It will require modifications to work: 4166 * // - It may require correct/in-range values for request initialization. 4167 * // - It may require specifying regional endpoints when creating the service client as shown in 4168 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 4169 * try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { 4170 * ListUsableSubnetworksRequest request = 4171 * ListUsableSubnetworksRequest.newBuilder() 4172 * .setParent("parent-995424086") 4173 * .setFilter("filter-1274492040") 4174 * .setPageSize(883849137) 4175 * .setPageToken("pageToken873572522") 4176 * .build(); 4177 * while (true) { 4178 * ListUsableSubnetworksResponse response = 4179 * clusterManagerClient.listUsableSubnetworksCallable().call(request); 4180 * for (UsableSubnetwork element : response.getSubnetworksList()) { 4181 * // doThingsWith(element); 4182 * } 4183 * String nextPageToken = response.getNextPageToken(); 4184 * if (!Strings.isNullOrEmpty(nextPageToken)) { 4185 * request = request.toBuilder().setPageToken(nextPageToken).build(); 4186 * } else { 4187 * break; 4188 * } 4189 * } 4190 * } 4191 * }</pre> 4192 */ 4193 public final UnaryCallable<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse> listUsableSubnetworksCallable()4194 listUsableSubnetworksCallable() { 4195 return stub.listUsableSubnetworksCallable(); 4196 } 4197 4198 @Override close()4199 public final void close() { 4200 stub.close(); 4201 } 4202 4203 @Override shutdown()4204 public void shutdown() { 4205 stub.shutdown(); 4206 } 4207 4208 @Override isShutdown()4209 public boolean isShutdown() { 4210 return stub.isShutdown(); 4211 } 4212 4213 @Override isTerminated()4214 public boolean isTerminated() { 4215 return stub.isTerminated(); 4216 } 4217 4218 @Override shutdownNow()4219 public void shutdownNow() { 4220 stub.shutdownNow(); 4221 } 4222 4223 @Override awaitTermination(long duration, TimeUnit unit)4224 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 4225 return stub.awaitTermination(duration, unit); 4226 } 4227 4228 public static class ListUsableSubnetworksPagedResponse 4229 extends AbstractPagedListResponse< 4230 ListUsableSubnetworksRequest, 4231 ListUsableSubnetworksResponse, 4232 UsableSubnetwork, 4233 ListUsableSubnetworksPage, 4234 ListUsableSubnetworksFixedSizeCollection> { 4235 createAsync( PageContext<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork> context, ApiFuture<ListUsableSubnetworksResponse> futureResponse)4236 public static ApiFuture<ListUsableSubnetworksPagedResponse> createAsync( 4237 PageContext<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork> 4238 context, 4239 ApiFuture<ListUsableSubnetworksResponse> futureResponse) { 4240 ApiFuture<ListUsableSubnetworksPage> futurePage = 4241 ListUsableSubnetworksPage.createEmptyPage().createPageAsync(context, futureResponse); 4242 return ApiFutures.transform( 4243 futurePage, 4244 input -> new ListUsableSubnetworksPagedResponse(input), 4245 MoreExecutors.directExecutor()); 4246 } 4247 ListUsableSubnetworksPagedResponse(ListUsableSubnetworksPage page)4248 private ListUsableSubnetworksPagedResponse(ListUsableSubnetworksPage page) { 4249 super(page, ListUsableSubnetworksFixedSizeCollection.createEmptyCollection()); 4250 } 4251 } 4252 4253 public static class ListUsableSubnetworksPage 4254 extends AbstractPage< 4255 ListUsableSubnetworksRequest, 4256 ListUsableSubnetworksResponse, 4257 UsableSubnetwork, 4258 ListUsableSubnetworksPage> { 4259 ListUsableSubnetworksPage( PageContext<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork> context, ListUsableSubnetworksResponse response)4260 private ListUsableSubnetworksPage( 4261 PageContext<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork> 4262 context, 4263 ListUsableSubnetworksResponse response) { 4264 super(context, response); 4265 } 4266 createEmptyPage()4267 private static ListUsableSubnetworksPage createEmptyPage() { 4268 return new ListUsableSubnetworksPage(null, null); 4269 } 4270 4271 @Override createPage( PageContext<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork> context, ListUsableSubnetworksResponse response)4272 protected ListUsableSubnetworksPage createPage( 4273 PageContext<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork> 4274 context, 4275 ListUsableSubnetworksResponse response) { 4276 return new ListUsableSubnetworksPage(context, response); 4277 } 4278 4279 @Override createPageAsync( PageContext<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork> context, ApiFuture<ListUsableSubnetworksResponse> futureResponse)4280 public ApiFuture<ListUsableSubnetworksPage> createPageAsync( 4281 PageContext<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork> 4282 context, 4283 ApiFuture<ListUsableSubnetworksResponse> futureResponse) { 4284 return super.createPageAsync(context, futureResponse); 4285 } 4286 } 4287 4288 public static class ListUsableSubnetworksFixedSizeCollection 4289 extends AbstractFixedSizeCollection< 4290 ListUsableSubnetworksRequest, 4291 ListUsableSubnetworksResponse, 4292 UsableSubnetwork, 4293 ListUsableSubnetworksPage, 4294 ListUsableSubnetworksFixedSizeCollection> { 4295 ListUsableSubnetworksFixedSizeCollection( List<ListUsableSubnetworksPage> pages, int collectionSize)4296 private ListUsableSubnetworksFixedSizeCollection( 4297 List<ListUsableSubnetworksPage> pages, int collectionSize) { 4298 super(pages, collectionSize); 4299 } 4300 createEmptyCollection()4301 private static ListUsableSubnetworksFixedSizeCollection createEmptyCollection() { 4302 return new ListUsableSubnetworksFixedSizeCollection(null, 0); 4303 } 4304 4305 @Override createCollection( List<ListUsableSubnetworksPage> pages, int collectionSize)4306 protected ListUsableSubnetworksFixedSizeCollection createCollection( 4307 List<ListUsableSubnetworksPage> pages, int collectionSize) { 4308 return new ListUsableSubnetworksFixedSizeCollection(pages, collectionSize); 4309 } 4310 } 4311 } 4312