@Generated(value="by gapic-generator") @BetaApi public class RegionInstanceGroupManagerClient extends Object implements BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
}
Note: close() needs to be called on the regionInstanceGroupManagerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of RegionInstanceGroupManagerSettings to create(). For example:
To customize credentials:
RegionInstanceGroupManagerSettings regionInstanceGroupManagerSettings =
RegionInstanceGroupManagerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RegionInstanceGroupManagerClient regionInstanceGroupManagerClient =
RegionInstanceGroupManagerClient.create(regionInstanceGroupManagerSettings);
To customize the endpoint:
RegionInstanceGroupManagerSettings regionInstanceGroupManagerSettings =
RegionInstanceGroupManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
RegionInstanceGroupManagerClient regionInstanceGroupManagerClient =
RegionInstanceGroupManagerClient.create(regionInstanceGroupManagerSettings);
Modifier and Type | Class and Description |
---|---|
static class |
RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersFixedSizeCollection |
static class |
RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPage |
static class |
RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
RegionInstanceGroupManagerClient(RegionInstanceGroupManagerSettings settings)
Constructs an instance of RegionInstanceGroupManagerClient, using the given settings.
|
protected |
RegionInstanceGroupManagerClient(RegionInstanceGroupManagerStub stub) |
Modifier and Type | Method and Description |
---|---|
Operation |
abandonInstancesRegionInstanceGroupManager(AbandonInstancesRegionInstanceGroupManagerHttpRequest request)
Flags the specified instances to be immediately removed from the managed instance group.
|
Operation |
abandonInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager,
RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource)
Flags the specified instances to be immediately removed from the managed instance group.
|
Operation |
abandonInstancesRegionInstanceGroupManager(String instanceGroupManager,
RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource)
Flags the specified instances to be immediately removed from the managed instance group.
|
UnaryCallable<AbandonInstancesRegionInstanceGroupManagerHttpRequest,Operation> |
abandonInstancesRegionInstanceGroupManagerCallable()
Flags the specified instances to be immediately removed from the managed instance group.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static RegionInstanceGroupManagerClient |
create()
Constructs an instance of RegionInstanceGroupManagerClient with default settings.
|
static RegionInstanceGroupManagerClient |
create(RegionInstanceGroupManagerSettings settings)
Constructs an instance of RegionInstanceGroupManagerClient, using the given settings.
|
static RegionInstanceGroupManagerClient |
create(RegionInstanceGroupManagerStub stub)
Constructs an instance of RegionInstanceGroupManagerClient, using the given stub for making
calls.
|
Operation |
deleteInstancesRegionInstanceGroupManager(DeleteInstancesRegionInstanceGroupManagerHttpRequest request)
Flags the specified instances in the managed instance group to be immediately deleted.
|
Operation |
deleteInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager,
RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource)
Flags the specified instances in the managed instance group to be immediately deleted.
|
Operation |
deleteInstancesRegionInstanceGroupManager(String instanceGroupManager,
RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource)
Flags the specified instances in the managed instance group to be immediately deleted.
|
UnaryCallable<DeleteInstancesRegionInstanceGroupManagerHttpRequest,Operation> |
deleteInstancesRegionInstanceGroupManagerCallable()
Flags the specified instances in the managed instance group to be immediately deleted.
|
Operation |
deleteRegionInstanceGroupManager(DeleteRegionInstanceGroupManagerHttpRequest request)
Deletes the specified managed instance group and all of the instances in that group.
|
Operation |
deleteRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager)
Deletes the specified managed instance group and all of the instances in that group.
|
Operation |
deleteRegionInstanceGroupManager(String instanceGroupManager)
Deletes the specified managed instance group and all of the instances in that group.
|
UnaryCallable<DeleteRegionInstanceGroupManagerHttpRequest,Operation> |
deleteRegionInstanceGroupManagerCallable()
Deletes the specified managed instance group and all of the instances in that group.
|
InstanceGroupManager |
getRegionInstanceGroupManager(GetRegionInstanceGroupManagerHttpRequest request)
Returns all of the details about the specified managed instance group.
|
InstanceGroupManager |
getRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager)
Returns all of the details about the specified managed instance group.
|
InstanceGroupManager |
getRegionInstanceGroupManager(String instanceGroupManager)
Returns all of the details about the specified managed instance group.
|
UnaryCallable<GetRegionInstanceGroupManagerHttpRequest,InstanceGroupManager> |
getRegionInstanceGroupManagerCallable()
Returns all of the details about the specified managed instance group.
|
RegionInstanceGroupManagerSettings |
getSettings() |
RegionInstanceGroupManagerStub |
getStub() |
Operation |
insertRegionInstanceGroupManager(InsertRegionInstanceGroupManagerHttpRequest request)
Creates a managed instance group using the information that you specify in the request.
|
Operation |
insertRegionInstanceGroupManager(ProjectRegionName region,
InstanceGroupManager instanceGroupManagerResource)
Creates a managed instance group using the information that you specify in the request.
|
Operation |
insertRegionInstanceGroupManager(String region,
InstanceGroupManager instanceGroupManagerResource)
Creates a managed instance group using the information that you specify in the request.
|
UnaryCallable<InsertRegionInstanceGroupManagerHttpRequest,Operation> |
insertRegionInstanceGroupManagerCallable()
Creates a managed instance group using the information that you specify in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
RegionInstanceGroupManagersListInstancesResponse |
listManagedInstancesRegionInstanceGroupManagers(ListManagedInstancesRegionInstanceGroupManagersHttpRequest request)
Lists the instances in the managed instance group and instances that are scheduled to be
created.
|
RegionInstanceGroupManagersListInstancesResponse |
listManagedInstancesRegionInstanceGroupManagers(ProjectRegionInstanceGroupManagerName instanceGroupManager)
Lists the instances in the managed instance group and instances that are scheduled to be
created.
|
RegionInstanceGroupManagersListInstancesResponse |
listManagedInstancesRegionInstanceGroupManagers(String instanceGroupManager)
Lists the instances in the managed instance group and instances that are scheduled to be
created.
|
UnaryCallable<ListManagedInstancesRegionInstanceGroupManagersHttpRequest,RegionInstanceGroupManagersListInstancesResponse> |
listManagedInstancesRegionInstanceGroupManagersCallable()
Lists the instances in the managed instance group and instances that are scheduled to be
created.
|
RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse |
listRegionInstanceGroupManagers(ListRegionInstanceGroupManagersHttpRequest request)
Retrieves the list of managed instance groups that are contained within the specified region.
|
RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse |
listRegionInstanceGroupManagers(ProjectRegionName region)
Retrieves the list of managed instance groups that are contained within the specified region.
|
RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse |
listRegionInstanceGroupManagers(String region)
Retrieves the list of managed instance groups that are contained within the specified region.
|
UnaryCallable<ListRegionInstanceGroupManagersHttpRequest,RegionInstanceGroupManagerList> |
listRegionInstanceGroupManagersCallable()
Retrieves the list of managed instance groups that are contained within the specified region.
|
UnaryCallable<ListRegionInstanceGroupManagersHttpRequest,RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse> |
listRegionInstanceGroupManagersPagedCallable()
Retrieves the list of managed instance groups that are contained within the specified region.
|
Operation |
patchRegionInstanceGroupManager(PatchRegionInstanceGroupManagerHttpRequest request)
Updates a managed instance group using the information that you specify in the request.
|
Operation |
patchRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager,
InstanceGroupManager instanceGroupManagerResource,
List<String> fieldMask)
Updates a managed instance group using the information that you specify in the request.
|
Operation |
patchRegionInstanceGroupManager(String instanceGroupManager,
InstanceGroupManager instanceGroupManagerResource,
List<String> fieldMask)
Updates a managed instance group using the information that you specify in the request.
|
UnaryCallable<PatchRegionInstanceGroupManagerHttpRequest,Operation> |
patchRegionInstanceGroupManagerCallable()
Updates a managed instance group using the information that you specify in the request.
|
Operation |
recreateInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager,
RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource)
Flags the specified instances in the managed instance group to be immediately recreated.
|
Operation |
recreateInstancesRegionInstanceGroupManager(RecreateInstancesRegionInstanceGroupManagerHttpRequest request)
Flags the specified instances in the managed instance group to be immediately recreated.
|
Operation |
recreateInstancesRegionInstanceGroupManager(String instanceGroupManager,
RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource)
Flags the specified instances in the managed instance group to be immediately recreated.
|
UnaryCallable<RecreateInstancesRegionInstanceGroupManagerHttpRequest,Operation> |
recreateInstancesRegionInstanceGroupManagerCallable()
Flags the specified instances in the managed instance group to be immediately recreated.
|
Operation |
resizeRegionInstanceGroupManager(Integer size,
ProjectRegionInstanceGroupManagerName instanceGroupManager)
Changes the intended size of the managed instance group.
|
Operation |
resizeRegionInstanceGroupManager(Integer size,
String instanceGroupManager)
Changes the intended size of the managed instance group.
|
Operation |
resizeRegionInstanceGroupManager(ResizeRegionInstanceGroupManagerHttpRequest request)
Changes the intended size of the managed instance group.
|
UnaryCallable<ResizeRegionInstanceGroupManagerHttpRequest,Operation> |
resizeRegionInstanceGroupManagerCallable()
Changes the intended size of the managed instance group.
|
Operation |
setInstanceTemplateRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager,
RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource)
Sets the instance template to use when creating new instances or recreating instances in this
group.
|
Operation |
setInstanceTemplateRegionInstanceGroupManager(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request)
Sets the instance template to use when creating new instances or recreating instances in this
group.
|
Operation |
setInstanceTemplateRegionInstanceGroupManager(String instanceGroupManager,
RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource)
Sets the instance template to use when creating new instances or recreating instances in this
group.
|
UnaryCallable<SetInstanceTemplateRegionInstanceGroupManagerHttpRequest,Operation> |
setInstanceTemplateRegionInstanceGroupManagerCallable()
Sets the instance template to use when creating new instances or recreating instances in this
group.
|
Operation |
setTargetPoolsRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager,
RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource)
Modifies the target pools to which all new instances in this group are assigned.
|
Operation |
setTargetPoolsRegionInstanceGroupManager(SetTargetPoolsRegionInstanceGroupManagerHttpRequest request)
Modifies the target pools to which all new instances in this group are assigned.
|
Operation |
setTargetPoolsRegionInstanceGroupManager(String instanceGroupManager,
RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource)
Modifies the target pools to which all new instances in this group are assigned.
|
UnaryCallable<SetTargetPoolsRegionInstanceGroupManagerHttpRequest,Operation> |
setTargetPoolsRegionInstanceGroupManagerCallable()
Modifies the target pools to which all new instances in this group are assigned.
|
void |
shutdown() |
void |
shutdownNow() |
protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected RegionInstanceGroupManagerClient(RegionInstanceGroupManagerStub stub)
public static final RegionInstanceGroupManagerClient create() throws IOException
IOException
public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final RegionInstanceGroupManagerClient create(RegionInstanceGroupManagerStub stub)
public final RegionInstanceGroupManagerSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public RegionInstanceGroupManagerStub getStub()
@BetaApi public final Operation abandonInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource)
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersAbandonInstancesRequestResource);
}
instanceGroupManager
- Name of the managed instance group.regionInstanceGroupManagersAbandonInstancesRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation abandonInstancesRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource)
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersAbandonInstancesRequestResource);
}
instanceGroupManager
- Name of the managed instance group.regionInstanceGroupManagersAbandonInstancesRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation abandonInstancesRegionInstanceGroupManager(AbandonInstancesRegionInstanceGroupManagerHttpRequest request)
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
.build();
Operation response = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<AbandonInstancesRegionInstanceGroupManagerHttpRequest,Operation> abandonInstancesRegionInstanceGroupManagerCallable()
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersAbandonInstancesRequest regionInstanceGroupManagersAbandonInstancesRequestResource = RegionInstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
AbandonInstancesRegionInstanceGroupManagerHttpRequest request = AbandonInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersAbandonInstancesRequestResource(regionInstanceGroupManagersAbandonInstancesRequestResource)
.build();
ApiFuture<Operation> future = regionInstanceGroupManagerClient.abandonInstancesRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation deleteRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(instanceGroupManager);
}
instanceGroupManager
- Name of the managed instance group to delete.ApiException
- if the remote call fails@BetaApi public final Operation deleteRegionInstanceGroupManager(String instanceGroupManager)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(instanceGroupManager.toString());
}
instanceGroupManager
- Name of the managed instance group to delete.ApiException
- if the remote call fails@BetaApi public final Operation deleteRegionInstanceGroupManager(DeleteRegionInstanceGroupManagerHttpRequest request)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.build();
Operation response = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<DeleteRegionInstanceGroupManagerHttpRequest,Operation> deleteRegionInstanceGroupManagerCallable()
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.build();
ApiFuture<Operation> future = regionInstanceGroupManagerClient.deleteRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation deleteInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource)
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersDeleteInstancesRequestResource);
}
instanceGroupManager
- Name of the managed instance group.regionInstanceGroupManagersDeleteInstancesRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation deleteInstancesRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource)
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersDeleteInstancesRequestResource);
}
instanceGroupManager
- Name of the managed instance group.regionInstanceGroupManagersDeleteInstancesRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation deleteInstancesRegionInstanceGroupManager(DeleteInstancesRegionInstanceGroupManagerHttpRequest request)
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource)
.build();
Operation response = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<DeleteInstancesRegionInstanceGroupManagerHttpRequest,Operation> deleteInstancesRegionInstanceGroupManagerCallable()
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersDeleteInstancesRequest regionInstanceGroupManagersDeleteInstancesRequestResource = RegionInstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
DeleteInstancesRegionInstanceGroupManagerHttpRequest request = DeleteInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersDeleteInstancesRequestResource(regionInstanceGroupManagersDeleteInstancesRequestResource)
.build();
ApiFuture<Operation> future = regionInstanceGroupManagerClient.deleteInstancesRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final InstanceGroupManager getRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
InstanceGroupManager response = regionInstanceGroupManagerClient.getRegionInstanceGroupManager(instanceGroupManager);
}
instanceGroupManager
- Name of the managed instance group to return.ApiException
- if the remote call fails@BetaApi public final InstanceGroupManager getRegionInstanceGroupManager(String instanceGroupManager)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
InstanceGroupManager response = regionInstanceGroupManagerClient.getRegionInstanceGroupManager(instanceGroupManager.toString());
}
instanceGroupManager
- Name of the managed instance group to return.ApiException
- if the remote call fails@BetaApi public final InstanceGroupManager getRegionInstanceGroupManager(GetRegionInstanceGroupManagerHttpRequest request)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
GetRegionInstanceGroupManagerHttpRequest request = GetRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.build();
InstanceGroupManager response = regionInstanceGroupManagerClient.getRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<GetRegionInstanceGroupManagerHttpRequest,InstanceGroupManager> getRegionInstanceGroupManagerCallable()
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
GetRegionInstanceGroupManagerHttpRequest request = GetRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.build();
ApiFuture<InstanceGroupManager> future = regionInstanceGroupManagerClient.getRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
InstanceGroupManager response = future.get();
}
@BetaApi public final Operation insertRegionInstanceGroupManager(ProjectRegionName region, InstanceGroupManager instanceGroupManagerResource)
A regional managed instance group can contain up to 2000 instances.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(region, instanceGroupManagerResource);
}
region
- Name of the region scoping this request.instanceGroupManagerResource
- An Instance Group Manager resource. (== resource_for
beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (==
resource_for beta.regionInstanceGroupManagers ==) (== resource_for
v1.regionInstanceGroupManagers ==)ApiException
- if the remote call fails@BetaApi public final Operation insertRegionInstanceGroupManager(String region, InstanceGroupManager instanceGroupManagerResource)
A regional managed instance group can contain up to 2000 instances.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(region.toString(), instanceGroupManagerResource);
}
region
- Name of the region scoping this request.instanceGroupManagerResource
- An Instance Group Manager resource. (== resource_for
beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (==
resource_for beta.regionInstanceGroupManagers ==) (== resource_for
v1.regionInstanceGroupManagers ==)ApiException
- if the remote call fails@BetaApi public final Operation insertRegionInstanceGroupManager(InsertRegionInstanceGroupManagerHttpRequest request)
A regional managed instance group can contain up to 2000 instances.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setInstanceGroupManagerResource(instanceGroupManagerResource)
.build();
Operation response = regionInstanceGroupManagerClient.insertRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<InsertRegionInstanceGroupManagerHttpRequest,Operation> insertRegionInstanceGroupManagerCallable()
A regional managed instance group can contain up to 2000 instances.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
InsertRegionInstanceGroupManagerHttpRequest request = InsertRegionInstanceGroupManagerHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setInstanceGroupManagerResource(instanceGroupManagerResource)
.build();
ApiFuture<Operation> future = regionInstanceGroupManagerClient.insertRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(ProjectRegionName region)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (InstanceGroupManager element : regionInstanceGroupManagerClient.listRegionInstanceGroupManagers(region).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region scoping this request.ApiException
- if the remote call fails@BetaApi public final RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(String region)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (InstanceGroupManager element : regionInstanceGroupManagerClient.listRegionInstanceGroupManagers(region.toString()).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region scoping this request.ApiException
- if the remote call fails@BetaApi public final RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse listRegionInstanceGroupManagers(ListRegionInstanceGroupManagersHttpRequest request)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionInstanceGroupManagersHttpRequest request = ListRegionInstanceGroupManagersHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
for (InstanceGroupManager element : regionInstanceGroupManagerClient.listRegionInstanceGroupManagers(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<ListRegionInstanceGroupManagersHttpRequest,RegionInstanceGroupManagerClient.ListRegionInstanceGroupManagersPagedResponse> listRegionInstanceGroupManagersPagedCallable()
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionInstanceGroupManagersHttpRequest request = ListRegionInstanceGroupManagersHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
ApiFuture<ListRegionInstanceGroupManagersPagedResponse> future = regionInstanceGroupManagerClient.listRegionInstanceGroupManagersPagedCallable().futureCall(request);
// Do something
for (InstanceGroupManager element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final UnaryCallable<ListRegionInstanceGroupManagersHttpRequest,RegionInstanceGroupManagerList> listRegionInstanceGroupManagersCallable()
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionInstanceGroupManagersHttpRequest request = ListRegionInstanceGroupManagersHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
while (true) {
RegionInstanceGroupManagerList response = regionInstanceGroupManagerClient.listRegionInstanceGroupManagersCallable().call(request);
for (InstanceGroupManager element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(ProjectRegionInstanceGroupManagerName instanceGroupManager)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersListInstancesResponse response = regionInstanceGroupManagerClient.listManagedInstancesRegionInstanceGroupManagers(instanceGroupManager);
}
instanceGroupManager
- The name of the managed instance group.ApiException
- if the remote call fails@BetaApi public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(String instanceGroupManager)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersListInstancesResponse response = regionInstanceGroupManagerClient.listManagedInstancesRegionInstanceGroupManagers(instanceGroupManager.toString());
}
instanceGroupManager
- The name of the managed instance group.ApiException
- if the remote call fails@BetaApi public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers(ListManagedInstancesRegionInstanceGroupManagersHttpRequest request)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
ListManagedInstancesRegionInstanceGroupManagersHttpRequest request = ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.build();
RegionInstanceGroupManagersListInstancesResponse response = regionInstanceGroupManagerClient.listManagedInstancesRegionInstanceGroupManagers(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<ListManagedInstancesRegionInstanceGroupManagersHttpRequest,RegionInstanceGroupManagersListInstancesResponse> listManagedInstancesRegionInstanceGroupManagersCallable()
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
ListManagedInstancesRegionInstanceGroupManagersHttpRequest request = ListManagedInstancesRegionInstanceGroupManagersHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.build();
ApiFuture<RegionInstanceGroupManagersListInstancesResponse> future = regionInstanceGroupManagerClient.listManagedInstancesRegionInstanceGroupManagersCallable().futureCall(request);
// Do something
RegionInstanceGroupManagersListInstancesResponse response = future.get();
}
@BetaApi public final Operation patchRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, List<String> fieldMask)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = regionInstanceGroupManagerClient.patchRegionInstanceGroupManager(instanceGroupManager, instanceGroupManagerResource, fieldMask);
}
instanceGroupManager
- The name of the instance group manager.instanceGroupManagerResource
- An Instance Group Manager resource. (== resource_for
beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (==
resource_for beta.regionInstanceGroupManagers ==) (== resource_for
v1.regionInstanceGroupManagers ==)fieldMask
- The fields that should be serialized (even if they have empty values). If the
containing message object has a non-null fieldmask, then all the fields in the field mask
(and only those fields in the field mask) will be serialized. If the containing object does
not have a fieldmask, then only non-empty fields will be serialized.ApiException
- if the remote call fails@BetaApi public final Operation patchRegionInstanceGroupManager(String instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, List<String> fieldMask)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = regionInstanceGroupManagerClient.patchRegionInstanceGroupManager(instanceGroupManager.toString(), instanceGroupManagerResource, fieldMask);
}
instanceGroupManager
- The name of the instance group manager.instanceGroupManagerResource
- An Instance Group Manager resource. (== resource_for
beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (==
resource_for beta.regionInstanceGroupManagers ==) (== resource_for
v1.regionInstanceGroupManagers ==)fieldMask
- The fields that should be serialized (even if they have empty values). If the
containing message object has a non-null fieldmask, then all the fields in the field mask
(and only those fields in the field mask) will be serialized. If the containing object does
not have a fieldmask, then only non-empty fields will be serialized.ApiException
- if the remote call fails@BetaApi public final Operation patchRegionInstanceGroupManager(PatchRegionInstanceGroupManagerHttpRequest request)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchRegionInstanceGroupManagerHttpRequest request = PatchRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setInstanceGroupManagerResource(instanceGroupManagerResource)
.addAllFieldMask(fieldMask)
.build();
Operation response = regionInstanceGroupManagerClient.patchRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<PatchRegionInstanceGroupManagerHttpRequest,Operation> patchRegionInstanceGroupManagerCallable()
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchRegionInstanceGroupManagerHttpRequest request = PatchRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setInstanceGroupManagerResource(instanceGroupManagerResource)
.addAllFieldMask(fieldMask)
.build();
ApiFuture<Operation> future = regionInstanceGroupManagerClient.patchRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation recreateInstancesRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource)
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersRecreateRequestResource);
}
instanceGroupManager
- Name of the managed instance group.regionInstanceGroupManagersRecreateRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation recreateInstancesRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource)
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersRecreateRequestResource);
}
instanceGroupManager
- Name of the managed instance group.regionInstanceGroupManagersRecreateRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation recreateInstancesRegionInstanceGroupManager(RecreateInstancesRegionInstanceGroupManagerHttpRequest request)
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource)
.build();
Operation response = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<RecreateInstancesRegionInstanceGroupManagerHttpRequest,Operation> recreateInstancesRegionInstanceGroupManagerCallable()
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
You can specify a maximum of 1000 instances with this method per request.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersRecreateRequest regionInstanceGroupManagersRecreateRequestResource = RegionInstanceGroupManagersRecreateRequest.newBuilder().build();
RecreateInstancesRegionInstanceGroupManagerHttpRequest request = RecreateInstancesRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersRecreateRequestResource(regionInstanceGroupManagersRecreateRequestResource)
.build();
ApiFuture<Operation> future = regionInstanceGroupManagerClient.recreateInstancesRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation resizeRegionInstanceGroupManager(Integer size, ProjectRegionInstanceGroupManagerName instanceGroupManager)
The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
Integer size = 0;
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, instanceGroupManager);
}
size
- Number of instances that should exist in this instance group manager.instanceGroupManager
- Name of the managed instance group.ApiException
- if the remote call fails@BetaApi public final Operation resizeRegionInstanceGroupManager(Integer size, String instanceGroupManager)
The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
Integer size = 0;
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, instanceGroupManager.toString());
}
size
- Number of instances that should exist in this instance group manager.instanceGroupManager
- Name of the managed instance group.ApiException
- if the remote call fails@BetaApi public final Operation resizeRegionInstanceGroupManager(ResizeRegionInstanceGroupManagerHttpRequest request)
The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
Integer size = 0;
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
.setSize(size)
.setInstanceGroupManager(formattedInstanceGroupManager)
.build();
Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<ResizeRegionInstanceGroupManagerHttpRequest,Operation> resizeRegionInstanceGroupManagerCallable()
The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.
If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
Integer size = 0;
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
.setSize(size)
.setInstanceGroupManager(formattedInstanceGroupManager)
.build();
ApiFuture<Operation> future = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation setInstanceTemplateRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTemplateRequestResource);
}
instanceGroupManager
- The name of the managed instance group.regionInstanceGroupManagersSetTemplateRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation setInstanceTemplateRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersSetTemplateRequestResource);
}
instanceGroupManager
- The name of the managed instance group.regionInstanceGroupManagersSetTemplateRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation setInstanceTemplateRegionInstanceGroupManager(SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource)
.build();
Operation response = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<SetInstanceTemplateRegionInstanceGroupManagerHttpRequest,Operation> setInstanceTemplateRegionInstanceGroupManagerCallable()
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersSetTemplateRequest regionInstanceGroupManagersSetTemplateRequestResource = RegionInstanceGroupManagersSetTemplateRequest.newBuilder().build();
SetInstanceTemplateRegionInstanceGroupManagerHttpRequest request = SetInstanceTemplateRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersSetTemplateRequestResource(regionInstanceGroupManagersSetTemplateRequestResource)
.build();
ApiFuture<Operation> future = regionInstanceGroupManagerClient.setInstanceTemplateRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation setTargetPoolsRegionInstanceGroupManager(ProjectRegionInstanceGroupManagerName instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager, regionInstanceGroupManagersSetTargetPoolsRequestResource);
}
instanceGroupManager
- Name of the managed instance group.regionInstanceGroupManagersSetTargetPoolsRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation setTargetPoolsRegionInstanceGroupManager(String instanceGroupManager, RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(instanceGroupManager.toString(), regionInstanceGroupManagersSetTargetPoolsRequestResource);
}
instanceGroupManager
- Name of the managed instance group.regionInstanceGroupManagersSetTargetPoolsRequestResource
- ApiException
- if the remote call fails@BetaApi public final Operation setTargetPoolsRegionInstanceGroupManager(SetTargetPoolsRegionInstanceGroupManagerHttpRequest request)
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource)
.build();
Operation response = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManager(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi public final UnaryCallable<SetTargetPoolsRegionInstanceGroupManagerHttpRequest,Operation> setTargetPoolsRegionInstanceGroupManagerCallable()
Sample code:
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
String formattedInstanceGroupManager = ProjectRegionInstanceGroupManagerName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
RegionInstanceGroupManagersSetTargetPoolsRequest regionInstanceGroupManagersSetTargetPoolsRequestResource = RegionInstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
SetTargetPoolsRegionInstanceGroupManagerHttpRequest request = SetTargetPoolsRegionInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(formattedInstanceGroupManager)
.setRegionInstanceGroupManagersSetTargetPoolsRequestResource(regionInstanceGroupManagersSetTargetPoolsRequestResource)
.build();
ApiFuture<Operation> future = regionInstanceGroupManagerClient.setTargetPoolsRegionInstanceGroupManagerCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.