- 1.63.0 (latest)
- 1.62.0
- 1.61.0
- 1.59.0
- 1.58.0
- 1.57.0
- 1.56.0
- 1.55.0
- 1.54.0
- 1.53.0
- 1.52.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.25.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.1
- 1.11.0
- 1.9.1
- 1.8.1
- 1.7.2
- 1.6.0-beta
public class TargetPoolsClient implements BackgroundResource
Service Description: The TargetPools API.
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 (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
TargetPool response = targetPoolsClient.get(project, region, targetPool);
}
Note: close() needs to be called on the TargetPoolsClient 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:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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 TargetPoolsSettings to create(). For example:
To customize credentials:
TargetPoolsSettings targetPoolsSettings =
TargetPoolsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
TargetPoolsClient targetPoolsClient = TargetPoolsClient.create(targetPoolsSettings);
To customize the endpoint:
TargetPoolsSettings targetPoolsSettings =
TargetPoolsSettings.newBuilder().setEndpoint(myEndpoint).build();
TargetPoolsClient targetPoolsClient = TargetPoolsClient.create(targetPoolsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final TargetPoolsClient create()
Constructs an instance of TargetPoolsClient with default settings.
Type | Description |
TargetPoolsClient |
Type | Description |
IOException |
create(TargetPoolsSettings settings)
public static final TargetPoolsClient create(TargetPoolsSettings settings)
Constructs an instance of TargetPoolsClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | TargetPoolsSettings |
Type | Description |
TargetPoolsClient |
Type | Description |
IOException |
create(TargetPoolsStub stub)
public static final TargetPoolsClient create(TargetPoolsStub stub)
Constructs an instance of TargetPoolsClient, using the given stub for making calls. This is for advanced usage - prefer using create(TargetPoolsSettings).
Name | Description |
stub | TargetPoolsStub |
Type | Description |
TargetPoolsClient |
Constructors
TargetPoolsClient(TargetPoolsSettings settings)
protected TargetPoolsClient(TargetPoolsSettings settings)
Constructs an instance of TargetPoolsClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Name | Description |
settings | TargetPoolsSettings |
TargetPoolsClient(TargetPoolsStub stub)
protected TargetPoolsClient(TargetPoolsStub stub)
Name | Description |
stub | TargetPoolsStub |
Methods
addHealthCheckAsync(AddHealthCheckTargetPoolRequest request)
public final OperationFuture<Operation,Operation> addHealthCheckAsync(AddHealthCheckTargetPoolRequest request)
Adds health check URLs to a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AddHealthCheckTargetPoolRequest request =
AddHealthCheckTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsAddHealthCheckRequestResource(
TargetPoolsAddHealthCheckRequest.newBuilder().build())
.build();
Operation response = targetPoolsClient.addHealthCheckAsync(request).get();
}
Name | Description |
request | AddHealthCheckTargetPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
addHealthCheckAsync(String project, String region, String targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource)
public final OperationFuture<Operation,Operation> addHealthCheckAsync(String project, String region, String targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource)
Adds health check URLs to a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource =
TargetPoolsAddHealthCheckRequest.newBuilder().build();
Operation response =
targetPoolsClient
.addHealthCheckAsync(
project, region, targetPool, targetPoolsAddHealthCheckRequestResource)
.get();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
targetPool | String Name of the target pool to add a health check to. |
targetPoolsAddHealthCheckRequestResource | TargetPoolsAddHealthCheckRequest The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
addHealthCheckCallable()
public final UnaryCallable<AddHealthCheckTargetPoolRequest,Operation> addHealthCheckCallable()
Adds health check URLs to a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AddHealthCheckTargetPoolRequest request =
AddHealthCheckTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsAddHealthCheckRequestResource(
TargetPoolsAddHealthCheckRequest.newBuilder().build())
.build();
ApiFuture<Operation> future = targetPoolsClient.addHealthCheckCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<AddHealthCheckTargetPoolRequest,Operation> |
addHealthCheckOperationCallable()
public final OperationCallable<AddHealthCheckTargetPoolRequest,Operation,Operation> addHealthCheckOperationCallable()
Adds health check URLs to a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AddHealthCheckTargetPoolRequest request =
AddHealthCheckTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsAddHealthCheckRequestResource(
TargetPoolsAddHealthCheckRequest.newBuilder().build())
.build();
OperationFuture
Type | Description |
OperationCallable<AddHealthCheckTargetPoolRequest,Operation,Operation> |
addInstanceAsync(AddInstanceTargetPoolRequest request)
public final OperationFuture<Operation,Operation> addInstanceAsync(AddInstanceTargetPoolRequest request)
Adds an instance to a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AddInstanceTargetPoolRequest request =
AddInstanceTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsAddInstanceRequestResource(
TargetPoolsAddInstanceRequest.newBuilder().build())
.build();
Operation response = targetPoolsClient.addInstanceAsync(request).get();
}
Name | Description |
request | AddInstanceTargetPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
addInstanceAsync(String project, String region, String targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource)
public final OperationFuture<Operation,Operation> addInstanceAsync(String project, String region, String targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource)
Adds an instance to a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource =
TargetPoolsAddInstanceRequest.newBuilder().build();
Operation response =
targetPoolsClient
.addInstanceAsync(project, region, targetPool, targetPoolsAddInstanceRequestResource)
.get();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
targetPool | String Name of the TargetPool resource to add instances to. |
targetPoolsAddInstanceRequestResource | TargetPoolsAddInstanceRequest The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
addInstanceCallable()
public final UnaryCallable<AddInstanceTargetPoolRequest,Operation> addInstanceCallable()
Adds an instance to a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AddInstanceTargetPoolRequest request =
AddInstanceTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsAddInstanceRequestResource(
TargetPoolsAddInstanceRequest.newBuilder().build())
.build();
ApiFuture<Operation> future = targetPoolsClient.addInstanceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<AddInstanceTargetPoolRequest,Operation> |
addInstanceOperationCallable()
public final OperationCallable<AddInstanceTargetPoolRequest,Operation,Operation> addInstanceOperationCallable()
Adds an instance to a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AddInstanceTargetPoolRequest request =
AddInstanceTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsAddInstanceRequestResource(
TargetPoolsAddInstanceRequest.newBuilder().build())
.build();
OperationFuture
Type | Description |
OperationCallable<AddInstanceTargetPoolRequest,Operation,Operation> |
aggregatedList(AggregatedListTargetPoolsRequest request)
public final TargetPoolsClient.AggregatedListPagedResponse aggregatedList(AggregatedListTargetPoolsRequest request)
Retrieves an aggregated list of target pools.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AggregatedListTargetPoolsRequest request =
AggregatedListTargetPoolsRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
for (Map.Entry
Name | Description |
request | AggregatedListTargetPoolsRequest The request object containing all of the parameters for the API call. |
Type | Description |
TargetPoolsClient.AggregatedListPagedResponse |
aggregatedList(String project)
public final TargetPoolsClient.AggregatedListPagedResponse aggregatedList(String project)
Retrieves an aggregated list of target pools.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
for (Map.Entry
Name | Description |
project | String Project ID for this request. |
Type | Description |
TargetPoolsClient.AggregatedListPagedResponse |
aggregatedListCallable()
public final UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolAggregatedList> aggregatedListCallable()
Retrieves an aggregated list of target pools.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AggregatedListTargetPoolsRequest request =
AggregatedListTargetPoolsRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
while (true) {
TargetPoolAggregatedList response =
targetPoolsClient.aggregatedListCallable().call(request);
for (Map.Entry
Type | Description |
UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolAggregatedList> |
aggregatedListPagedCallable()
public final UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolsClient.AggregatedListPagedResponse> aggregatedListPagedCallable()
Retrieves an aggregated list of target pools.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AggregatedListTargetPoolsRequest request =
AggregatedListTargetPoolsRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
ApiFuture<>
Type | Description |
UnaryCallable<AggregatedListTargetPoolsRequest,AggregatedListPagedResponse> |
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
deleteAsync(DeleteTargetPoolRequest request)
public final OperationFuture<Operation,Operation> deleteAsync(DeleteTargetPoolRequest request)
Deletes the specified target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
DeleteTargetPoolRequest request =
DeleteTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.build();
Operation response = targetPoolsClient.deleteAsync(request).get();
}
Name | Description |
request | DeleteTargetPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
deleteAsync(String project, String region, String targetPool)
public final OperationFuture<Operation,Operation> deleteAsync(String project, String region, String targetPool)
Deletes the specified target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
Operation response = targetPoolsClient.deleteAsync(project, region, targetPool).get();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
targetPool | String Name of the TargetPool resource to delete. |
Type | Description |
OperationFuture<Operation,Operation> |
deleteCallable()
public final UnaryCallable<DeleteTargetPoolRequest,Operation> deleteCallable()
Deletes the specified target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
DeleteTargetPoolRequest request =
DeleteTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.build();
ApiFuture<Operation> future = targetPoolsClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<DeleteTargetPoolRequest,Operation> |
deleteOperationCallable()
public final OperationCallable<DeleteTargetPoolRequest,Operation,Operation> deleteOperationCallable()
Deletes the specified target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
DeleteTargetPoolRequest request =
DeleteTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.build();
OperationFuture
Type | Description |
OperationCallable<DeleteTargetPoolRequest,Operation,Operation> |
get(GetTargetPoolRequest request)
public final TargetPool get(GetTargetPoolRequest request)
Returns the specified target pool. Gets a list of available target pools by making a list() request.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
GetTargetPoolRequest request =
GetTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setTargetPool("targetPool486493517")
.build();
TargetPool response = targetPoolsClient.get(request);
}
Name | Description |
request | GetTargetPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
TargetPool |
get(String project, String region, String targetPool)
public final TargetPool get(String project, String region, String targetPool)
Returns the specified target pool. Gets a list of available target pools by making a list() request.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
TargetPool response = targetPoolsClient.get(project, region, targetPool);
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
targetPool | String Name of the TargetPool resource to return. |
Type | Description |
TargetPool |
getCallable()
public final UnaryCallable<GetTargetPoolRequest,TargetPool> getCallable()
Returns the specified target pool. Gets a list of available target pools by making a list() request.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
GetTargetPoolRequest request =
GetTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setTargetPool("targetPool486493517")
.build();
ApiFuture
Type | Description |
UnaryCallable<GetTargetPoolRequest,TargetPool> |
getHealth(GetHealthTargetPoolRequest request)
public final TargetPoolInstanceHealth getHealth(GetHealthTargetPoolRequest request)
Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
GetHealthTargetPoolRequest request =
GetHealthTargetPoolRequest.newBuilder()
.setInstanceReferenceResource(InstanceReference.newBuilder().build())
.setProject("project-309310695")
.setRegion("region-934795532")
.setTargetPool("targetPool486493517")
.build();
TargetPoolInstanceHealth response = targetPoolsClient.getHealth(request);
}
Name | Description |
request | GetHealthTargetPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
TargetPoolInstanceHealth |
getHealth(String project, String region, String targetPool, InstanceReference instanceReferenceResource)
public final TargetPoolInstanceHealth getHealth(String project, String region, String targetPool, InstanceReference instanceReferenceResource)
Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
InstanceReference instanceReferenceResource = InstanceReference.newBuilder().build();
TargetPoolInstanceHealth response =
targetPoolsClient.getHealth(project, region, targetPool, instanceReferenceResource);
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
targetPool | String Name of the TargetPool resource to which the queried instance belongs. |
instanceReferenceResource | InstanceReference The body resource for this request |
Type | Description |
TargetPoolInstanceHealth |
getHealthCallable()
public final UnaryCallable<GetHealthTargetPoolRequest,TargetPoolInstanceHealth> getHealthCallable()
Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
GetHealthTargetPoolRequest request =
GetHealthTargetPoolRequest.newBuilder()
.setInstanceReferenceResource(InstanceReference.newBuilder().build())
.setProject("project-309310695")
.setRegion("region-934795532")
.setTargetPool("targetPool486493517")
.build();
ApiFuture
Type | Description |
UnaryCallable<GetHealthTargetPoolRequest,TargetPoolInstanceHealth> |
getSettings()
public final TargetPoolsSettings getSettings()
Type | Description |
TargetPoolsSettings |
getStub()
public TargetPoolsStub getStub()
Type | Description |
TargetPoolsStub |
insertAsync(InsertTargetPoolRequest request)
public final OperationFuture<Operation,Operation> insertAsync(InsertTargetPoolRequest request)
Creates a target pool in the specified project and region using the data included in the request.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
InsertTargetPoolRequest request =
InsertTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPoolResource(TargetPool.newBuilder().build())
.build();
Operation response = targetPoolsClient.insertAsync(request).get();
}
Name | Description |
request | InsertTargetPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
insertAsync(String project, String region, TargetPool targetPoolResource)
public final OperationFuture<Operation,Operation> insertAsync(String project, String region, TargetPool targetPoolResource)
Creates a target pool in the specified project and region using the data included in the request.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
TargetPool targetPoolResource = TargetPool.newBuilder().build();
Operation response = targetPoolsClient.insertAsync(project, region, targetPoolResource).get();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
targetPoolResource | TargetPool The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
insertCallable()
public final UnaryCallable<InsertTargetPoolRequest,Operation> insertCallable()
Creates a target pool in the specified project and region using the data included in the request.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
InsertTargetPoolRequest request =
InsertTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPoolResource(TargetPool.newBuilder().build())
.build();
ApiFuture<Operation> future = targetPoolsClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<InsertTargetPoolRequest,Operation> |
insertOperationCallable()
public final OperationCallable<InsertTargetPoolRequest,Operation,Operation> insertOperationCallable()
Creates a target pool in the specified project and region using the data included in the request.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
InsertTargetPoolRequest request =
InsertTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPoolResource(TargetPool.newBuilder().build())
.build();
OperationFuture
Type | Description |
OperationCallable<InsertTargetPoolRequest,Operation,Operation> |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
list(ListTargetPoolsRequest request)
public final TargetPoolsClient.ListPagedResponse list(ListTargetPoolsRequest request)
Retrieves a list of target pools available to the specified project and region.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
ListTargetPoolsRequest request =
ListTargetPoolsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setRegion("region-934795532")
.setReturnPartialSuccess(true)
.build();
for (TargetPool element : targetPoolsClient.list(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListTargetPoolsRequest The request object containing all of the parameters for the API call. |
Type | Description |
TargetPoolsClient.ListPagedResponse |
list(String project, String region)
public final TargetPoolsClient.ListPagedResponse list(String project, String region)
Retrieves a list of target pools available to the specified project and region.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
for (TargetPool element : targetPoolsClient.list(project, region).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
Type | Description |
TargetPoolsClient.ListPagedResponse |
listCallable()
public final UnaryCallable<ListTargetPoolsRequest,TargetPoolList> listCallable()
Retrieves a list of target pools available to the specified project and region.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
ListTargetPoolsRequest request =
ListTargetPoolsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setRegion("region-934795532")
.setReturnPartialSuccess(true)
.build();
while (true) {
TargetPoolList response = targetPoolsClient.listCallable().call(request);
for (TargetPool element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListTargetPoolsRequest,TargetPoolList> |
listPagedCallable()
public final UnaryCallable<ListTargetPoolsRequest,TargetPoolsClient.ListPagedResponse> listPagedCallable()
Retrieves a list of target pools available to the specified project and region.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
ListTargetPoolsRequest request =
ListTargetPoolsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setRegion("region-934795532")
.setReturnPartialSuccess(true)
.build();
ApiFuture
Type | Description |
UnaryCallable<ListTargetPoolsRequest,ListPagedResponse> |
removeHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request)
public final OperationFuture<Operation,Operation> removeHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request)
Removes health check URL from a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
RemoveHealthCheckTargetPoolRequest request =
RemoveHealthCheckTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsRemoveHealthCheckRequestResource(
TargetPoolsRemoveHealthCheckRequest.newBuilder().build())
.build();
Operation response = targetPoolsClient.removeHealthCheckAsync(request).get();
}
Name | Description |
request | RemoveHealthCheckTargetPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
removeHealthCheckAsync(String project, String region, String targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource)
public final OperationFuture<Operation,Operation> removeHealthCheckAsync(String project, String region, String targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource)
Removes health check URL from a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource =
TargetPoolsRemoveHealthCheckRequest.newBuilder().build();
Operation response =
targetPoolsClient
.removeHealthCheckAsync(
project, region, targetPool, targetPoolsRemoveHealthCheckRequestResource)
.get();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region for this request. |
targetPool | String Name of the target pool to remove health checks from. |
targetPoolsRemoveHealthCheckRequestResource | TargetPoolsRemoveHealthCheckRequest The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
removeHealthCheckCallable()
public final UnaryCallable<RemoveHealthCheckTargetPoolRequest,Operation> removeHealthCheckCallable()
Removes health check URL from a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
RemoveHealthCheckTargetPoolRequest request =
RemoveHealthCheckTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsRemoveHealthCheckRequestResource(
TargetPoolsRemoveHealthCheckRequest.newBuilder().build())
.build();
ApiFuture<Operation> future =
targetPoolsClient.removeHealthCheckCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<RemoveHealthCheckTargetPoolRequest,Operation> |
removeHealthCheckOperationCallable()
public final OperationCallable<RemoveHealthCheckTargetPoolRequest,Operation,Operation> removeHealthCheckOperationCallable()
Removes health check URL from a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
RemoveHealthCheckTargetPoolRequest request =
RemoveHealthCheckTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsRemoveHealthCheckRequestResource(
TargetPoolsRemoveHealthCheckRequest.newBuilder().build())
.build();
OperationFuture
Type | Description |
OperationCallable<RemoveHealthCheckTargetPoolRequest,Operation,Operation> |
removeInstanceAsync(RemoveInstanceTargetPoolRequest request)
public final OperationFuture<Operation,Operation> removeInstanceAsync(RemoveInstanceTargetPoolRequest request)
Removes instance URL from a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
RemoveInstanceTargetPoolRequest request =
RemoveInstanceTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsRemoveInstanceRequestResource(
TargetPoolsRemoveInstanceRequest.newBuilder().build())
.build();
Operation response = targetPoolsClient.removeInstanceAsync(request).get();
}
Name | Description |
request | RemoveInstanceTargetPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
removeInstanceAsync(String project, String region, String targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource)
public final OperationFuture<Operation,Operation> removeInstanceAsync(String project, String region, String targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource)
Removes instance URL from a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource =
TargetPoolsRemoveInstanceRequest.newBuilder().build();
Operation response =
targetPoolsClient
.removeInstanceAsync(
project, region, targetPool, targetPoolsRemoveInstanceRequestResource)
.get();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
targetPool | String Name of the TargetPool resource to remove instances from. |
targetPoolsRemoveInstanceRequestResource | TargetPoolsRemoveInstanceRequest The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
removeInstanceCallable()
public final UnaryCallable<RemoveInstanceTargetPoolRequest,Operation> removeInstanceCallable()
Removes instance URL from a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
RemoveInstanceTargetPoolRequest request =
RemoveInstanceTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsRemoveInstanceRequestResource(
TargetPoolsRemoveInstanceRequest.newBuilder().build())
.build();
ApiFuture<Operation> future = targetPoolsClient.removeInstanceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<RemoveInstanceTargetPoolRequest,Operation> |
removeInstanceOperationCallable()
public final OperationCallable<RemoveInstanceTargetPoolRequest,Operation,Operation> removeInstanceOperationCallable()
Removes instance URL from a target pool.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
RemoveInstanceTargetPoolRequest request =
RemoveInstanceTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsRemoveInstanceRequestResource(
TargetPoolsRemoveInstanceRequest.newBuilder().build())
.build();
OperationFuture
Type | Description |
OperationCallable<RemoveInstanceTargetPoolRequest,Operation,Operation> |
setBackupAsync(SetBackupTargetPoolRequest request)
public final OperationFuture<Operation,Operation> setBackupAsync(SetBackupTargetPoolRequest request)
Changes a backup target pool's configurations.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
SetBackupTargetPoolRequest request =
SetBackupTargetPoolRequest.newBuilder()
.setFailoverRatio(-861074818)
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetReferenceResource(TargetReference.newBuilder().build())
.build();
Operation response = targetPoolsClient.setBackupAsync(request).get();
}
Name | Description |
request | SetBackupTargetPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
setBackupAsync(String project, String region, String targetPool, TargetReference targetReferenceResource)
public final OperationFuture<Operation,Operation> setBackupAsync(String project, String region, String targetPool, TargetReference targetReferenceResource)
Changes a backup target pool's configurations.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
TargetReference targetReferenceResource = TargetReference.newBuilder().build();
Operation response =
targetPoolsClient
.setBackupAsync(project, region, targetPool, targetReferenceResource)
.get();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
targetPool | String Name of the TargetPool resource to set a backup pool for. |
targetReferenceResource | TargetReference The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
setBackupCallable()
public final UnaryCallable<SetBackupTargetPoolRequest,Operation> setBackupCallable()
Changes a backup target pool's configurations.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
SetBackupTargetPoolRequest request =
SetBackupTargetPoolRequest.newBuilder()
.setFailoverRatio(-861074818)
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetReferenceResource(TargetReference.newBuilder().build())
.build();
ApiFuture<Operation> future = targetPoolsClient.setBackupCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<SetBackupTargetPoolRequest,Operation> |
setBackupOperationCallable()
public final OperationCallable<SetBackupTargetPoolRequest,Operation,Operation> setBackupOperationCallable()
Changes a backup target pool's configurations.
Sample code:
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
SetBackupTargetPoolRequest request =
SetBackupTargetPoolRequest.newBuilder()
.setFailoverRatio(-861074818)
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetReferenceResource(TargetReference.newBuilder().build())
.build();
OperationFuture
Type | Description |
OperationCallable<SetBackupTargetPoolRequest,Operation,Operation> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()