@Generated(value="by gapic-generator-java") public class InstanceGroupManagerResizeRequestsClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instanceGroupManager = "instanceGroupManager-388242077";
String resizeRequest = "resizeRequest-1656358085";
InstanceGroupManagerResizeRequest response =
instanceGroupManagerResizeRequestsClient.get(
project, zone, instanceGroupManager, resizeRequest);
}
Note: close() needs to be called on the InstanceGroupManagerResizeRequestsClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
Cancel |
Cancels the specified resize request and removes it from the queue. Cancelled resize request does no longer wait for the resources to be provisioned. Cancel is only possible for requests that are accepted in the queue. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Delete |
Deletes the specified, inactive resize request. Requests that are still active cannot be deleted. Deleting request does not delete instances that were provisioned previously. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Get |
Returns all of the details about the specified resize request. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Insert |
Creates a new resize request that starts provisioning VMs immediately or queues VM creation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
List |
Retrieves a list of resize requests that are contained in the managed instance group. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of InstanceGroupManagerResizeRequestsSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
InstanceGroupManagerResizeRequestsSettings instanceGroupManagerResizeRequestsSettings =
InstanceGroupManagerResizeRequestsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create(instanceGroupManagerResizeRequestsSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
InstanceGroupManagerResizeRequestsSettings instanceGroupManagerResizeRequestsSettings =
InstanceGroupManagerResizeRequestsSettings.newBuilder().setEndpoint(myEndpoint).build();
InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create(instanceGroupManagerResizeRequestsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
InstanceGroupManagerResizeRequestsClient.ListFixedSizeCollection |
static class |
InstanceGroupManagerResizeRequestsClient.ListPage |
static class |
InstanceGroupManagerResizeRequestsClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
InstanceGroupManagerResizeRequestsClient(InstanceGroupManagerResizeRequestsSettings settings)
Constructs an instance of InstanceGroupManagerResizeRequestsClient, using the given settings.
|
protected |
InstanceGroupManagerResizeRequestsClient(InstanceGroupManagerResizeRequestsStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
cancelAsync(CancelInstanceGroupManagerResizeRequestRequest request)
Cancels the specified resize request and removes it from the queue.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
cancelAsync(String project,
String zone,
String instanceGroupManager,
String resizeRequest)
Cancels the specified resize request and removes it from the queue.
|
com.google.api.gax.rpc.UnaryCallable<CancelInstanceGroupManagerResizeRequestRequest,Operation> |
cancelCallable()
Cancels the specified resize request and removes it from the queue.
|
com.google.api.gax.rpc.OperationCallable<CancelInstanceGroupManagerResizeRequestRequest,Operation,Operation> |
cancelOperationCallable()
Cancels the specified resize request and removes it from the queue.
|
void |
close() |
static InstanceGroupManagerResizeRequestsClient |
create()
Constructs an instance of InstanceGroupManagerResizeRequestsClient with default settings.
|
static InstanceGroupManagerResizeRequestsClient |
create(InstanceGroupManagerResizeRequestsSettings settings)
Constructs an instance of InstanceGroupManagerResizeRequestsClient, using the given settings.
|
static InstanceGroupManagerResizeRequestsClient |
create(InstanceGroupManagerResizeRequestsStub stub)
Constructs an instance of InstanceGroupManagerResizeRequestsClient, using the given stub for
making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteInstanceGroupManagerResizeRequestRequest request)
Deletes the specified, inactive resize request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String project,
String zone,
String instanceGroupManager,
String resizeRequest)
Deletes the specified, inactive resize request.
|
com.google.api.gax.rpc.UnaryCallable<DeleteInstanceGroupManagerResizeRequestRequest,Operation> |
deleteCallable()
Deletes the specified, inactive resize request.
|
com.google.api.gax.rpc.OperationCallable<DeleteInstanceGroupManagerResizeRequestRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified, inactive resize request.
|
InstanceGroupManagerResizeRequest |
get(GetInstanceGroupManagerResizeRequestRequest request)
Returns all of the details about the specified resize request.
|
InstanceGroupManagerResizeRequest |
get(String project,
String zone,
String instanceGroupManager,
String resizeRequest)
Returns all of the details about the specified resize request.
|
com.google.api.gax.rpc.UnaryCallable<GetInstanceGroupManagerResizeRequestRequest,InstanceGroupManagerResizeRequest> |
getCallable()
Returns all of the details about the specified resize request.
|
InstanceGroupManagerResizeRequestsSettings |
getSettings() |
InstanceGroupManagerResizeRequestsStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertInstanceGroupManagerResizeRequestRequest request)
Creates a new resize request that starts provisioning VMs immediately or queues VM creation.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(String project,
String zone,
String instanceGroupManager,
InstanceGroupManagerResizeRequest instanceGroupManagerResizeRequestResource)
Creates a new resize request that starts provisioning VMs immediately or queues VM creation.
|
com.google.api.gax.rpc.UnaryCallable<InsertInstanceGroupManagerResizeRequestRequest,Operation> |
insertCallable()
Creates a new resize request that starts provisioning VMs immediately or queues VM creation.
|
com.google.api.gax.rpc.OperationCallable<InsertInstanceGroupManagerResizeRequestRequest,Operation,Operation> |
insertOperationCallable()
Creates a new resize request that starts provisioning VMs immediately or queues VM creation.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
InstanceGroupManagerResizeRequestsClient.ListPagedResponse |
list(ListInstanceGroupManagerResizeRequestsRequest request)
Retrieves a list of resize requests that are contained in the managed instance group.
|
InstanceGroupManagerResizeRequestsClient.ListPagedResponse |
list(String project,
String zone,
String instanceGroupManager)
Retrieves a list of resize requests that are contained in the managed instance group.
|
com.google.api.gax.rpc.UnaryCallable<ListInstanceGroupManagerResizeRequestsRequest,InstanceGroupManagerResizeRequestsListResponse> |
listCallable()
Retrieves a list of resize requests that are contained in the managed instance group.
|
com.google.api.gax.rpc.UnaryCallable<ListInstanceGroupManagerResizeRequestsRequest,InstanceGroupManagerResizeRequestsClient.ListPagedResponse> |
listPagedCallable()
Retrieves a list of resize requests that are contained in the managed instance group.
|
void |
shutdown() |
void |
shutdownNow() |
protected InstanceGroupManagerResizeRequestsClient(InstanceGroupManagerResizeRequestsSettings settings) throws IOException
IOExceptionprotected InstanceGroupManagerResizeRequestsClient(InstanceGroupManagerResizeRequestsStub stub)
public static final InstanceGroupManagerResizeRequestsClient create() throws IOException
IOExceptionpublic static final InstanceGroupManagerResizeRequestsClient create(InstanceGroupManagerResizeRequestsSettings settings) throws IOException
IOExceptionpublic static final InstanceGroupManagerResizeRequestsClient create(InstanceGroupManagerResizeRequestsStub stub)
public final InstanceGroupManagerResizeRequestsSettings getSettings()
public InstanceGroupManagerResizeRequestsStub getStub()
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> cancelAsync(String project, String zone, String instanceGroupManager, String resizeRequest)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instanceGroupManager = "instanceGroupManager-388242077";
String resizeRequest = "resizeRequest-1656358085";
Operation response =
instanceGroupManagerResizeRequestsClient
.cancelAsync(project, zone, instanceGroupManager, resizeRequest)
.get();
}
project - Project ID for this request.zone - The name of the zone where the managed instance group is located. The name should
conform to RFC1035.instanceGroupManager - The name of the managed instance group. The name should conform to
RFC1035 or be a resource ID.resizeRequest - The name of the resize request to cancel. The name should conform to
RFC1035 or be a resource ID.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> cancelAsync(CancelInstanceGroupManagerResizeRequestRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
CancelInstanceGroupManagerResizeRequestRequest request =
CancelInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setResizeRequest("resizeRequest-1656358085")
.setZone("zone3744684")
.build();
Operation response = instanceGroupManagerResizeRequestsClient.cancelAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CancelInstanceGroupManagerResizeRequestRequest,Operation,Operation> cancelOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
CancelInstanceGroupManagerResizeRequestRequest request =
CancelInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setResizeRequest("resizeRequest-1656358085")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instanceGroupManagerResizeRequestsClient.cancelOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CancelInstanceGroupManagerResizeRequestRequest,Operation> cancelCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
CancelInstanceGroupManagerResizeRequestRequest request =
CancelInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setResizeRequest("resizeRequest-1656358085")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instanceGroupManagerResizeRequestsClient.cancelCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String project, String zone, String instanceGroupManager, String resizeRequest)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instanceGroupManager = "instanceGroupManager-388242077";
String resizeRequest = "resizeRequest-1656358085";
Operation response =
instanceGroupManagerResizeRequestsClient
.deleteAsync(project, zone, instanceGroupManager, resizeRequest)
.get();
}
project - Project ID for this request.zone - The name of the zone where the managed instance group is located. The name should
conform to RFC1035.instanceGroupManager - The name of the managed instance group. The name should conform to
RFC1035 or be a resource ID.resizeRequest - The name of the resize request to delete. The name should conform to
RFC1035 or be a resource ID.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteInstanceGroupManagerResizeRequestRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
DeleteInstanceGroupManagerResizeRequestRequest request =
DeleteInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setResizeRequest("resizeRequest-1656358085")
.setZone("zone3744684")
.build();
Operation response = instanceGroupManagerResizeRequestsClient.deleteAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteInstanceGroupManagerResizeRequestRequest,Operation,Operation> deleteOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
DeleteInstanceGroupManagerResizeRequestRequest request =
DeleteInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setResizeRequest("resizeRequest-1656358085")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instanceGroupManagerResizeRequestsClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteInstanceGroupManagerResizeRequestRequest,Operation> deleteCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
DeleteInstanceGroupManagerResizeRequestRequest request =
DeleteInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setResizeRequest("resizeRequest-1656358085")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instanceGroupManagerResizeRequestsClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final InstanceGroupManagerResizeRequest get(String project, String zone, String instanceGroupManager, String resizeRequest)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instanceGroupManager = "instanceGroupManager-388242077";
String resizeRequest = "resizeRequest-1656358085";
InstanceGroupManagerResizeRequest response =
instanceGroupManagerResizeRequestsClient.get(
project, zone, instanceGroupManager, resizeRequest);
}
project - Project ID for this request.zone - Name of the href="/compute/docs/regions-zones/#available">zone scoping this
request. Name should conform to RFC1035.instanceGroupManager - The name of the managed instance group. Name should conform to
RFC1035 or be a resource ID.resizeRequest - The name of the resize request. Name should conform to RFC1035 or be a
resource ID.com.google.api.gax.rpc.ApiException - if the remote call failspublic final InstanceGroupManagerResizeRequest get(GetInstanceGroupManagerResizeRequestRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
GetInstanceGroupManagerResizeRequestRequest request =
GetInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setProject("project-309310695")
.setResizeRequest("resizeRequest-1656358085")
.setZone("zone3744684")
.build();
InstanceGroupManagerResizeRequest response =
instanceGroupManagerResizeRequestsClient.get(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetInstanceGroupManagerResizeRequestRequest,InstanceGroupManagerResizeRequest> getCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
GetInstanceGroupManagerResizeRequestRequest request =
GetInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setProject("project-309310695")
.setResizeRequest("resizeRequest-1656358085")
.setZone("zone3744684")
.build();
ApiFuture<InstanceGroupManagerResizeRequest> future =
instanceGroupManagerResizeRequestsClient.getCallable().futureCall(request);
// Do something.
InstanceGroupManagerResizeRequest response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String project, String zone, String instanceGroupManager, InstanceGroupManagerResizeRequest instanceGroupManagerResizeRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instanceGroupManager = "instanceGroupManager-388242077";
InstanceGroupManagerResizeRequest instanceGroupManagerResizeRequestResource =
InstanceGroupManagerResizeRequest.newBuilder().build();
Operation response =
instanceGroupManagerResizeRequestsClient
.insertAsync(
project, zone, instanceGroupManager, instanceGroupManagerResizeRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone where the managed instance group is located and where the
resize request will be created. Name should conform to RFC1035.instanceGroupManager - The name of the managed instance group to which the resize request
will be added. Name should conform to RFC1035 or be a resource ID.instanceGroupManagerResizeRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertInstanceGroupManagerResizeRequestRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
InsertInstanceGroupManagerResizeRequestRequest request =
InsertInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setInstanceGroupManagerResizeRequestResource(
InstanceGroupManagerResizeRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instanceGroupManagerResizeRequestsClient.insertAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<InsertInstanceGroupManagerResizeRequestRequest,Operation,Operation> insertOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
InsertInstanceGroupManagerResizeRequestRequest request =
InsertInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setInstanceGroupManagerResizeRequestResource(
InstanceGroupManagerResizeRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instanceGroupManagerResizeRequestsClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertInstanceGroupManagerResizeRequestRequest,Operation> insertCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
InsertInstanceGroupManagerResizeRequestRequest request =
InsertInstanceGroupManagerResizeRequestRequest.newBuilder()
.setInstanceGroupManager("instanceGroupManager-388242077")
.setInstanceGroupManagerResizeRequestResource(
InstanceGroupManagerResizeRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instanceGroupManagerResizeRequestsClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final InstanceGroupManagerResizeRequestsClient.ListPagedResponse list(String project, String zone, String instanceGroupManager)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instanceGroupManager = "instanceGroupManager-388242077";
for (InstanceGroupManagerResizeRequest element :
instanceGroupManagerResizeRequestsClient
.list(project, zone, instanceGroupManager)
.iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.zone - The name of the zone where the managed instance group is located. The name should
conform to RFC1035.instanceGroupManager - The name of the managed instance group. The name should conform to
RFC1035.com.google.api.gax.rpc.ApiException - if the remote call failspublic final InstanceGroupManagerResizeRequestsClient.ListPagedResponse list(ListInstanceGroupManagerResizeRequestsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
ListInstanceGroupManagerResizeRequestsRequest request =
ListInstanceGroupManagerResizeRequestsRequest.newBuilder()
.setFilter("filter-1274492040")
.setInstanceGroupManager("instanceGroupManager-388242077")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
for (InstanceGroupManagerResizeRequest element :
instanceGroupManagerResizeRequestsClient.list(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListInstanceGroupManagerResizeRequestsRequest,InstanceGroupManagerResizeRequestsClient.ListPagedResponse> listPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
ListInstanceGroupManagerResizeRequestsRequest request =
ListInstanceGroupManagerResizeRequestsRequest.newBuilder()
.setFilter("filter-1274492040")
.setInstanceGroupManager("instanceGroupManager-388242077")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
ApiFuture<InstanceGroupManagerResizeRequest> future =
instanceGroupManagerResizeRequestsClient.listPagedCallable().futureCall(request);
// Do something.
for (InstanceGroupManagerResizeRequest element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListInstanceGroupManagerResizeRequestsRequest,InstanceGroupManagerResizeRequestsListResponse> listCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (InstanceGroupManagerResizeRequestsClient instanceGroupManagerResizeRequestsClient =
InstanceGroupManagerResizeRequestsClient.create()) {
ListInstanceGroupManagerResizeRequestsRequest request =
ListInstanceGroupManagerResizeRequestsRequest.newBuilder()
.setFilter("filter-1274492040")
.setInstanceGroupManager("instanceGroupManager-388242077")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
while (true) {
InstanceGroupManagerResizeRequestsListResponse response =
instanceGroupManagerResizeRequestsClient.listCallable().call(request);
for (InstanceGroupManagerResizeRequest element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.