@Generated(value="by gapic-generator") @BetaApi public class RegionInstanceGroupClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
InstanceGroup response = regionInstanceGroupClient.getRegionInstanceGroup(instanceGroup);
}
Note: close() needs to be called on the regionInstanceGroupClient 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 RegionInstanceGroupSettings to create(). For example:
To customize credentials:
RegionInstanceGroupSettings regionInstanceGroupSettings =
RegionInstanceGroupSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RegionInstanceGroupClient regionInstanceGroupClient =
RegionInstanceGroupClient.create(regionInstanceGroupSettings);
To customize the endpoint:
RegionInstanceGroupSettings regionInstanceGroupSettings =
RegionInstanceGroupSettings.newBuilder().setEndpoint(myEndpoint).build();
RegionInstanceGroupClient regionInstanceGroupClient =
RegionInstanceGroupClient.create(regionInstanceGroupSettings);
Modifier and Type | Class and Description |
---|---|
static class |
RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsFixedSizeCollection |
static class |
RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPage |
static class |
RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse |
static class |
RegionInstanceGroupClient.ListRegionInstanceGroupsFixedSizeCollection |
static class |
RegionInstanceGroupClient.ListRegionInstanceGroupsPage |
static class |
RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
RegionInstanceGroupClient(RegionInstanceGroupSettings settings)
Constructs an instance of RegionInstanceGroupClient, using the given settings.
|
protected |
RegionInstanceGroupClient(RegionInstanceGroupStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static RegionInstanceGroupClient |
create()
Constructs an instance of RegionInstanceGroupClient with default settings.
|
static RegionInstanceGroupClient |
create(RegionInstanceGroupSettings settings)
Constructs an instance of RegionInstanceGroupClient, using the given settings.
|
static RegionInstanceGroupClient |
create(RegionInstanceGroupStub stub)
Constructs an instance of RegionInstanceGroupClient, using the given stub for making calls.
|
InstanceGroup |
getRegionInstanceGroup(GetRegionInstanceGroupHttpRequest request)
Returns the specified instance group resource.
|
InstanceGroup |
getRegionInstanceGroup(ProjectRegionInstanceGroupName instanceGroup)
Returns the specified instance group resource.
|
InstanceGroup |
getRegionInstanceGroup(String instanceGroup)
Returns the specified instance group resource.
|
com.google.api.gax.rpc.UnaryCallable<GetRegionInstanceGroupHttpRequest,InstanceGroup> |
getRegionInstanceGroupCallable()
Returns the specified instance group resource.
|
RegionInstanceGroupSettings |
getSettings() |
RegionInstanceGroupStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse |
listInstancesRegionInstanceGroups(ListInstancesRegionInstanceGroupsHttpRequest request)
Lists the instances in the specified instance group and displays information about the named
ports.
|
RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse |
listInstancesRegionInstanceGroups(ProjectRegionInstanceGroupName instanceGroup,
RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource)
Lists the instances in the specified instance group and displays information about the named
ports.
|
RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse |
listInstancesRegionInstanceGroups(String instanceGroup,
RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource)
Lists the instances in the specified instance group and displays information about the named
ports.
|
com.google.api.gax.rpc.UnaryCallable<ListInstancesRegionInstanceGroupsHttpRequest,RegionInstanceGroupsListInstances> |
listInstancesRegionInstanceGroupsCallable()
Lists the instances in the specified instance group and displays information about the named
ports.
|
com.google.api.gax.rpc.UnaryCallable<ListInstancesRegionInstanceGroupsHttpRequest,RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse> |
listInstancesRegionInstanceGroupsPagedCallable()
Lists the instances in the specified instance group and displays information about the named
ports.
|
RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse |
listRegionInstanceGroups(ListRegionInstanceGroupsHttpRequest request)
Retrieves the list of instance group resources contained within the specified region.
|
RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse |
listRegionInstanceGroups(ProjectRegionName region)
Retrieves the list of instance group resources contained within the specified region.
|
RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse |
listRegionInstanceGroups(String region)
Retrieves the list of instance group resources contained within the specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListRegionInstanceGroupsHttpRequest,RegionInstanceGroupList> |
listRegionInstanceGroupsCallable()
Retrieves the list of instance group resources contained within the specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListRegionInstanceGroupsHttpRequest,RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse> |
listRegionInstanceGroupsPagedCallable()
Retrieves the list of instance group resources contained within the specified region.
|
Operation |
setNamedPortsRegionInstanceGroup(ProjectRegionInstanceGroupName instanceGroup,
RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource)
Sets the named ports for the specified regional instance group.
|
Operation |
setNamedPortsRegionInstanceGroup(SetNamedPortsRegionInstanceGroupHttpRequest request)
Sets the named ports for the specified regional instance group.
|
Operation |
setNamedPortsRegionInstanceGroup(String instanceGroup,
RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource)
Sets the named ports for the specified regional instance group.
|
com.google.api.gax.rpc.UnaryCallable<SetNamedPortsRegionInstanceGroupHttpRequest,Operation> |
setNamedPortsRegionInstanceGroupCallable()
Sets the named ports for the specified regional instance group.
|
void |
shutdown() |
void |
shutdownNow() |
protected RegionInstanceGroupClient(RegionInstanceGroupSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected RegionInstanceGroupClient(RegionInstanceGroupStub stub)
public static final RegionInstanceGroupClient create() throws IOException
IOException
public static final RegionInstanceGroupClient create(RegionInstanceGroupSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final RegionInstanceGroupClient create(RegionInstanceGroupStub stub)
public final RegionInstanceGroupSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public RegionInstanceGroupStub getStub()
@BetaApi public final InstanceGroup getRegionInstanceGroup(ProjectRegionInstanceGroupName instanceGroup)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
InstanceGroup response = regionInstanceGroupClient.getRegionInstanceGroup(instanceGroup);
}
instanceGroup
- Name of the instance group resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final InstanceGroup getRegionInstanceGroup(String instanceGroup)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
InstanceGroup response = regionInstanceGroupClient.getRegionInstanceGroup(instanceGroup.toString());
}
instanceGroup
- Name of the instance group resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final InstanceGroup getRegionInstanceGroup(GetRegionInstanceGroupHttpRequest request)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedInstanceGroup = ProjectRegionInstanceGroupName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
GetRegionInstanceGroupHttpRequest request = GetRegionInstanceGroupHttpRequest.newBuilder()
.setInstanceGroup(formattedInstanceGroup)
.build();
InstanceGroup response = regionInstanceGroupClient.getRegionInstanceGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<GetRegionInstanceGroupHttpRequest,InstanceGroup> getRegionInstanceGroupCallable()
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedInstanceGroup = ProjectRegionInstanceGroupName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
GetRegionInstanceGroupHttpRequest request = GetRegionInstanceGroupHttpRequest.newBuilder()
.setInstanceGroup(formattedInstanceGroup)
.build();
ApiFuture<InstanceGroup> future = regionInstanceGroupClient.getRegionInstanceGroupCallable().futureCall(request);
// Do something
InstanceGroup response = future.get();
}
@BetaApi public final RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(ProjectRegionName region)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (InstanceGroup element : regionInstanceGroupClient.listRegionInstanceGroups(region).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region scoping this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(String region)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (InstanceGroup element : regionInstanceGroupClient.listRegionInstanceGroups(region.toString()).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region scoping this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse listRegionInstanceGroups(ListRegionInstanceGroupsHttpRequest request)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
for (InstanceGroup element : regionInstanceGroupClient.listRegionInstanceGroups(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 fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListRegionInstanceGroupsHttpRequest,RegionInstanceGroupClient.ListRegionInstanceGroupsPagedResponse> listRegionInstanceGroupsPagedCallable()
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
ApiFuture<ListRegionInstanceGroupsPagedResponse> future = regionInstanceGroupClient.listRegionInstanceGroupsPagedCallable().futureCall(request);
// Do something
for (InstanceGroup element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListRegionInstanceGroupsHttpRequest,RegionInstanceGroupList> listRegionInstanceGroupsCallable()
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionInstanceGroupsHttpRequest request = ListRegionInstanceGroupsHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
while (true) {
RegionInstanceGroupList response = regionInstanceGroupClient.listRegionInstanceGroupsCallable().call(request);
for (InstanceGroup element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(ProjectRegionInstanceGroupName instanceGroup, RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
for (InstanceWithNamedPorts element : regionInstanceGroupClient.listInstancesRegionInstanceGroups(instanceGroup, regionInstanceGroupsListInstancesRequestResource).iterateAll()) {
// doThingsWith(element);
}
}
instanceGroup
- Name of the regional instance group for which we want to list the
instances.regionInstanceGroupsListInstancesRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(String instanceGroup, RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
for (InstanceWithNamedPorts element : regionInstanceGroupClient.listInstancesRegionInstanceGroups(instanceGroup.toString(), regionInstanceGroupsListInstancesRequestResource).iterateAll()) {
// doThingsWith(element);
}
}
instanceGroup
- Name of the regional instance group for which we want to list the
instances.regionInstanceGroupsListInstancesRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse listInstancesRegionInstanceGroups(ListInstancesRegionInstanceGroupsHttpRequest request)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedInstanceGroup = ProjectRegionInstanceGroupName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
ListInstancesRegionInstanceGroupsHttpRequest request = ListInstancesRegionInstanceGroupsHttpRequest.newBuilder()
.setInstanceGroup(formattedInstanceGroup)
.setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource)
.build();
for (InstanceWithNamedPorts element : regionInstanceGroupClient.listInstancesRegionInstanceGroups(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 fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListInstancesRegionInstanceGroupsHttpRequest,RegionInstanceGroupClient.ListInstancesRegionInstanceGroupsPagedResponse> listInstancesRegionInstanceGroupsPagedCallable()
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedInstanceGroup = ProjectRegionInstanceGroupName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
ListInstancesRegionInstanceGroupsHttpRequest request = ListInstancesRegionInstanceGroupsHttpRequest.newBuilder()
.setInstanceGroup(formattedInstanceGroup)
.setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource)
.build();
ApiFuture<ListInstancesRegionInstanceGroupsPagedResponse> future = regionInstanceGroupClient.listInstancesRegionInstanceGroupsPagedCallable().futureCall(request);
// Do something
for (InstanceWithNamedPorts element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListInstancesRegionInstanceGroupsHttpRequest,RegionInstanceGroupsListInstances> listInstancesRegionInstanceGroupsCallable()
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedInstanceGroup = ProjectRegionInstanceGroupName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
RegionInstanceGroupsListInstancesRequest regionInstanceGroupsListInstancesRequestResource = RegionInstanceGroupsListInstancesRequest.newBuilder().build();
ListInstancesRegionInstanceGroupsHttpRequest request = ListInstancesRegionInstanceGroupsHttpRequest.newBuilder()
.setInstanceGroup(formattedInstanceGroup)
.setRegionInstanceGroupsListInstancesRequestResource(regionInstanceGroupsListInstancesRequestResource)
.build();
while (true) {
RegionInstanceGroupsListInstances response = regionInstanceGroupClient.listInstancesRegionInstanceGroupsCallable().call(request);
for (InstanceWithNamedPorts element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final Operation setNamedPortsRegionInstanceGroup(ProjectRegionInstanceGroupName instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(instanceGroup, regionInstanceGroupsSetNamedPortsRequestResource);
}
instanceGroup
- The name of the regional instance group where the named ports are updated.regionInstanceGroupsSetNamedPortsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation setNamedPortsRegionInstanceGroup(String instanceGroup, RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
ProjectRegionInstanceGroupName instanceGroup = ProjectRegionInstanceGroupName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(instanceGroup.toString(), regionInstanceGroupsSetNamedPortsRequestResource);
}
instanceGroup
- The name of the regional instance group where the named ports are updated.regionInstanceGroupsSetNamedPortsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation setNamedPortsRegionInstanceGroup(SetNamedPortsRegionInstanceGroupHttpRequest request)
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedInstanceGroup = ProjectRegionInstanceGroupName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder()
.setInstanceGroup(formattedInstanceGroup)
.setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource)
.build();
Operation response = regionInstanceGroupClient.setNamedPortsRegionInstanceGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<SetNamedPortsRegionInstanceGroupHttpRequest,Operation> setNamedPortsRegionInstanceGroupCallable()
Sample code:
try (RegionInstanceGroupClient regionInstanceGroupClient = RegionInstanceGroupClient.create()) {
String formattedInstanceGroup = ProjectRegionInstanceGroupName.format("[PROJECT]", "[REGION]", "[INSTANCE_GROUP]");
RegionInstanceGroupsSetNamedPortsRequest regionInstanceGroupsSetNamedPortsRequestResource = RegionInstanceGroupsSetNamedPortsRequest.newBuilder().build();
SetNamedPortsRegionInstanceGroupHttpRequest request = SetNamedPortsRegionInstanceGroupHttpRequest.newBuilder()
.setInstanceGroup(formattedInstanceGroup)
.setRegionInstanceGroupsSetNamedPortsRequestResource(regionInstanceGroupsSetNamedPortsRequestResource)
.build();
ApiFuture<Operation> future = regionInstanceGroupClient.setNamedPortsRegionInstanceGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.