@Generated(value="by gapic-generator-java") public class TargetPoolsClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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().
| Method | Description | Method Variants |
|---|---|---|
AddHealthCheck |
Adds health check URLs to a target pool. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddInstance |
Adds an instance to a target pool. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AggregatedList |
Retrieves an aggregated list of target pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Delete |
Deletes the specified target pool. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Get |
Returns the specified target pool. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetHealth |
Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Insert |
Creates a target pool in the specified project and region using the data included in the request. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
List |
Retrieves a list of target pools available to the specified project and region. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveHealthCheck |
Removes health check URL from a target pool. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveInstance |
Removes instance URL from a target pool. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetBackup |
Changes a backup target pool's configurations. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetSecurityPolicy |
Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
TargetPoolsSettings targetPoolsSettings =
TargetPoolsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
TargetPoolsClient targetPoolsClient = TargetPoolsClient.create(targetPoolsSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
TargetPoolsClient.AggregatedListFixedSizeCollection |
static class |
TargetPoolsClient.AggregatedListPage |
static class |
TargetPoolsClient.AggregatedListPagedResponse |
static class |
TargetPoolsClient.ListFixedSizeCollection |
static class |
TargetPoolsClient.ListPage |
static class |
TargetPoolsClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
TargetPoolsClient(TargetPoolsSettings settings)
Constructs an instance of TargetPoolsClient, using the given settings.
|
protected |
TargetPoolsClient(TargetPoolsStub stub) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addHealthCheckAsync(AddHealthCheckTargetPoolRequest request)
Adds health check URLs to a target pool.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addHealthCheckAsync(String project,
String region,
String targetPool,
TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource)
Adds health check URLs to a target pool.
|
com.google.api.gax.rpc.UnaryCallable<AddHealthCheckTargetPoolRequest,Operation> |
addHealthCheckCallable()
Adds health check URLs to a target pool.
|
com.google.api.gax.rpc.OperationCallable<AddHealthCheckTargetPoolRequest,Operation,Operation> |
addHealthCheckOperationCallable()
Adds health check URLs to a target pool.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addInstanceAsync(AddInstanceTargetPoolRequest request)
Adds an instance to a target pool.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addInstanceAsync(String project,
String region,
String targetPool,
TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource)
Adds an instance to a target pool.
|
com.google.api.gax.rpc.UnaryCallable<AddInstanceTargetPoolRequest,Operation> |
addInstanceCallable()
Adds an instance to a target pool.
|
com.google.api.gax.rpc.OperationCallable<AddInstanceTargetPoolRequest,Operation,Operation> |
addInstanceOperationCallable()
Adds an instance to a target pool.
|
TargetPoolsClient.AggregatedListPagedResponse |
aggregatedList(AggregatedListTargetPoolsRequest request)
Retrieves an aggregated list of target pools.
|
TargetPoolsClient.AggregatedListPagedResponse |
aggregatedList(String project)
Retrieves an aggregated list of target pools.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolAggregatedList> |
aggregatedListCallable()
Retrieves an aggregated list of target pools.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolsClient.AggregatedListPagedResponse> |
aggregatedListPagedCallable()
Retrieves an aggregated list of target pools.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static TargetPoolsClient |
create()
Constructs an instance of TargetPoolsClient with default settings.
|
static TargetPoolsClient |
create(TargetPoolsSettings settings)
Constructs an instance of TargetPoolsClient, using the given settings.
|
static TargetPoolsClient |
create(TargetPoolsStub stub)
Constructs an instance of TargetPoolsClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteTargetPoolRequest request)
Deletes the specified target pool.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String project,
String region,
String targetPool)
Deletes the specified target pool.
|
com.google.api.gax.rpc.UnaryCallable<DeleteTargetPoolRequest,Operation> |
deleteCallable()
Deletes the specified target pool.
|
com.google.api.gax.rpc.OperationCallable<DeleteTargetPoolRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified target pool.
|
TargetPool |
get(GetTargetPoolRequest request)
Returns the specified target pool.
|
TargetPool |
get(String project,
String region,
String targetPool)
Returns the specified target pool.
|
com.google.api.gax.rpc.UnaryCallable<GetTargetPoolRequest,TargetPool> |
getCallable()
Returns the specified target pool.
|
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.
|
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.
|
com.google.api.gax.rpc.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.
|
TargetPoolsSettings |
getSettings() |
TargetPoolsStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertTargetPoolRequest request)
Creates a target pool in the specified project and region using the data included in the
request.
|
com.google.api.gax.longrunning.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.
|
com.google.api.gax.rpc.UnaryCallable<InsertTargetPoolRequest,Operation> |
insertCallable()
Creates a target pool in the specified project and region using the data included in the
request.
|
com.google.api.gax.rpc.OperationCallable<InsertTargetPoolRequest,Operation,Operation> |
insertOperationCallable()
Creates a target pool in the specified project and region using the data included in the
request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
TargetPoolsClient.ListPagedResponse |
list(ListTargetPoolsRequest request)
Retrieves a list of target pools available to the specified project and region.
|
TargetPoolsClient.ListPagedResponse |
list(String project,
String region)
Retrieves a list of target pools available to the specified project and region.
|
com.google.api.gax.rpc.UnaryCallable<ListTargetPoolsRequest,TargetPoolList> |
listCallable()
Retrieves a list of target pools available to the specified project and region.
|
com.google.api.gax.rpc.UnaryCallable<ListTargetPoolsRequest,TargetPoolsClient.ListPagedResponse> |
listPagedCallable()
Retrieves a list of target pools available to the specified project and region.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request)
Removes health check URL from a target pool.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeHealthCheckAsync(String project,
String region,
String targetPool,
TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource)
Removes health check URL from a target pool.
|
com.google.api.gax.rpc.UnaryCallable<RemoveHealthCheckTargetPoolRequest,Operation> |
removeHealthCheckCallable()
Removes health check URL from a target pool.
|
com.google.api.gax.rpc.OperationCallable<RemoveHealthCheckTargetPoolRequest,Operation,Operation> |
removeHealthCheckOperationCallable()
Removes health check URL from a target pool.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeInstanceAsync(RemoveInstanceTargetPoolRequest request)
Removes instance URL from a target pool.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeInstanceAsync(String project,
String region,
String targetPool,
TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource)
Removes instance URL from a target pool.
|
com.google.api.gax.rpc.UnaryCallable<RemoveInstanceTargetPoolRequest,Operation> |
removeInstanceCallable()
Removes instance URL from a target pool.
|
com.google.api.gax.rpc.OperationCallable<RemoveInstanceTargetPoolRequest,Operation,Operation> |
removeInstanceOperationCallable()
Removes instance URL from a target pool.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setBackupAsync(SetBackupTargetPoolRequest request)
Changes a backup target pool's configurations.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setBackupAsync(String project,
String region,
String targetPool,
TargetReference targetReferenceResource)
Changes a backup target pool's configurations.
|
com.google.api.gax.rpc.UnaryCallable<SetBackupTargetPoolRequest,Operation> |
setBackupCallable()
Changes a backup target pool's configurations.
|
com.google.api.gax.rpc.OperationCallable<SetBackupTargetPoolRequest,Operation,Operation> |
setBackupOperationCallable()
Changes a backup target pool's configurations.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setSecurityPolicyAsync(SetSecurityPolicyTargetPoolRequest request)
Sets the Google Cloud Armor security policy for the specified target pool.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setSecurityPolicyAsync(String project,
String region,
String targetPool,
SecurityPolicyReference securityPolicyReferenceResource)
Sets the Google Cloud Armor security policy for the specified target pool.
|
com.google.api.gax.rpc.UnaryCallable<SetSecurityPolicyTargetPoolRequest,Operation> |
setSecurityPolicyCallable()
Sets the Google Cloud Armor security policy for the specified target pool.
|
com.google.api.gax.rpc.OperationCallable<SetSecurityPolicyTargetPoolRequest,Operation,Operation> |
setSecurityPolicyOperationCallable()
Sets the Google Cloud Armor security policy for the specified target pool.
|
void |
shutdown() |
void |
shutdownNow() |
protected TargetPoolsClient(TargetPoolsSettings settings) throws IOException
IOExceptionprotected TargetPoolsClient(TargetPoolsStub stub)
public static final TargetPoolsClient create() throws IOException
IOExceptionpublic static final TargetPoolsClient create(TargetPoolsSettings settings) throws IOException
IOExceptionpublic static final TargetPoolsClient create(TargetPoolsStub stub)
public final TargetPoolsSettings getSettings()
public TargetPoolsStub getStub()
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addHealthCheckAsync(String project, String region, String targetPool, TargetPoolsAddHealthCheckRequest targetPoolsAddHealthCheckRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
project - Project ID for this request.region - Name of the region scoping this request.targetPool - Name of the target pool to add a health check to.targetPoolsAddHealthCheckRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addHealthCheckAsync(AddHealthCheckTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AddHealthCheckTargetPoolRequest,Operation,Operation> addHealthCheckOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AddHealthCheckTargetPoolRequest request =
AddHealthCheckTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsAddHealthCheckRequestResource(
TargetPoolsAddHealthCheckRequest.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
targetPoolsClient.addHealthCheckOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AddHealthCheckTargetPoolRequest,Operation> addHealthCheckCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addInstanceAsync(String project, String region, String targetPool, TargetPoolsAddInstanceRequest targetPoolsAddInstanceRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
project - Project ID for this request.region - Name of the region scoping this request.targetPool - Name of the TargetPool resource to add instances to.targetPoolsAddInstanceRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addInstanceAsync(AddInstanceTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AddInstanceTargetPoolRequest,Operation,Operation> addInstanceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
AddInstanceTargetPoolRequest request =
AddInstanceTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsAddInstanceRequestResource(
TargetPoolsAddInstanceRequest.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
targetPoolsClient.addInstanceOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AddInstanceTargetPoolRequest,Operation> addInstanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final TargetPoolsClient.AggregatedListPagedResponse aggregatedList(String project)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
for (Map.Entry<String, TargetPoolsScopedList> element :
targetPoolsClient.aggregatedList(project).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TargetPoolsClient.AggregatedListPagedResponse aggregatedList(AggregatedListTargetPoolsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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)
.setServiceProjectNumber(-1293855239)
.build();
for (Map.Entry<String, TargetPoolsScopedList> element :
targetPoolsClient.aggregatedList(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolsClient.AggregatedListPagedResponse> aggregatedListPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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)
.setServiceProjectNumber(-1293855239)
.build();
ApiFuture<Map.Entry<String, TargetPoolsScopedList>> future =
targetPoolsClient.aggregatedListPagedCallable().futureCall(request);
// Do something.
for (Map.Entry<String, TargetPoolsScopedList> element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolAggregatedList> aggregatedListCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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)
.setServiceProjectNumber(-1293855239)
.build();
while (true) {
TargetPoolAggregatedList response =
targetPoolsClient.aggregatedListCallable().call(request);
for (Map.Entry<String, TargetPoolsScopedList> element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String project, String region, String targetPool)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
Operation response = targetPoolsClient.deleteAsync(project, region, targetPool).get();
}
project - Project ID for this request.region - Name of the region scoping this request.targetPool - Name of the TargetPool resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteTargetPoolRequest,Operation,Operation> deleteOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
DeleteTargetPoolRequest request =
DeleteTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.build();
OperationFuture<Operation, Operation> future =
targetPoolsClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteTargetPoolRequest,Operation> deleteCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final TargetPool get(String project, String region, String targetPool)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
TargetPool response = targetPoolsClient.get(project, region, targetPool);
}
project - Project ID for this request.region - Name of the region scoping this request.targetPool - Name of the TargetPool resource to return.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TargetPool get(GetTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
GetTargetPoolRequest request =
GetTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setTargetPool("targetPool486493517")
.build();
TargetPool response = targetPoolsClient.get(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetTargetPoolRequest,TargetPool> getCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
GetTargetPoolRequest request =
GetTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setTargetPool("targetPool486493517")
.build();
ApiFuture<TargetPool> future = targetPoolsClient.getCallable().futureCall(request);
// Do something.
TargetPool response = future.get();
}
public final TargetPoolInstanceHealth getHealth(String project, String region, String targetPool, InstanceReference instanceReferenceResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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);
}
project - Project ID for this request.region - Name of the region scoping this request.targetPool - Name of the TargetPool resource to which the queried instance belongs.instanceReferenceResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final TargetPoolInstanceHealth getHealth(GetHealthTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetHealthTargetPoolRequest,TargetPoolInstanceHealth> getHealthCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
GetHealthTargetPoolRequest request =
GetHealthTargetPoolRequest.newBuilder()
.setInstanceReferenceResource(InstanceReference.newBuilder().build())
.setProject("project-309310695")
.setRegion("region-934795532")
.setTargetPool("targetPool486493517")
.build();
ApiFuture<TargetPoolInstanceHealth> future =
targetPoolsClient.getHealthCallable().futureCall(request);
// Do something.
TargetPoolInstanceHealth response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String project, String region, TargetPool targetPoolResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
project - Project ID for this request.region - Name of the region scoping this request.targetPoolResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<InsertTargetPoolRequest,Operation,Operation> insertOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
InsertTargetPoolRequest request =
InsertTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPoolResource(TargetPool.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
targetPoolsClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertTargetPoolRequest,Operation> insertCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final TargetPoolsClient.ListPagedResponse list(String project, String region)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
for (TargetPool element : targetPoolsClient.list(project, region).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.region - Name of the region scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TargetPoolsClient.ListPagedResponse list(ListTargetPoolsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListTargetPoolsRequest,TargetPoolsClient.ListPagedResponse> listPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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<TargetPool> future = targetPoolsClient.listPagedCallable().futureCall(request);
// Do something.
for (TargetPool element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTargetPoolsRequest,TargetPoolList> listCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeHealthCheckAsync(String project, String region, String targetPool, TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
project - Project ID for this request.region - Name of the region for this request.targetPool - Name of the target pool to remove health checks from.targetPoolsRemoveHealthCheckRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeHealthCheckAsync(RemoveHealthCheckTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RemoveHealthCheckTargetPoolRequest,Operation,Operation> removeHealthCheckOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
RemoveHealthCheckTargetPoolRequest request =
RemoveHealthCheckTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsRemoveHealthCheckRequestResource(
TargetPoolsRemoveHealthCheckRequest.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
targetPoolsClient.removeHealthCheckOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveHealthCheckTargetPoolRequest,Operation> removeHealthCheckCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeInstanceAsync(String project, String region, String targetPool, TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
project - Project ID for this request.region - Name of the region scoping this request.targetPool - Name of the TargetPool resource to remove instances from.targetPoolsRemoveInstanceRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeInstanceAsync(RemoveInstanceTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RemoveInstanceTargetPoolRequest,Operation,Operation> removeInstanceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
RemoveInstanceTargetPoolRequest request =
RemoveInstanceTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setTargetPool("targetPool486493517")
.setTargetPoolsRemoveInstanceRequestResource(
TargetPoolsRemoveInstanceRequest.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
targetPoolsClient.removeInstanceOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveInstanceTargetPoolRequest,Operation> removeInstanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setBackupAsync(String project, String region, String targetPool, TargetReference targetReferenceResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
project - Project ID for this request.region - Name of the region scoping this request.targetPool - Name of the TargetPool resource to set a backup pool for.targetReferenceResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setBackupAsync(SetBackupTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SetBackupTargetPoolRequest,Operation,Operation> setBackupOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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<Operation, Operation> future =
targetPoolsClient.setBackupOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetBackupTargetPoolRequest,Operation> setBackupCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setSecurityPolicyAsync(String project, String region, String targetPool, SecurityPolicyReference securityPolicyReferenceResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String targetPool = "targetPool486493517";
SecurityPolicyReference securityPolicyReferenceResource =
SecurityPolicyReference.newBuilder().build();
Operation response =
targetPoolsClient
.setSecurityPolicyAsync(project, region, targetPool, securityPolicyReferenceResource)
.get();
}
project - Project ID for this request.region - Name of the region scoping this request.targetPool - Name of the TargetPool resource to which the security policy should be set.
The name should conform to RFC1035.securityPolicyReferenceResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setSecurityPolicyAsync(SetSecurityPolicyTargetPoolRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
SetSecurityPolicyTargetPoolRequest request =
SetSecurityPolicyTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
.setTargetPool("targetPool486493517")
.build();
Operation response = targetPoolsClient.setSecurityPolicyAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SetSecurityPolicyTargetPoolRequest,Operation,Operation> setSecurityPolicyOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
SetSecurityPolicyTargetPoolRequest request =
SetSecurityPolicyTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
.setTargetPool("targetPool486493517")
.build();
OperationFuture<Operation, Operation> future =
targetPoolsClient.setSecurityPolicyOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetSecurityPolicyTargetPoolRequest,Operation> setSecurityPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (TargetPoolsClient targetPoolsClient = TargetPoolsClient.create()) {
SetSecurityPolicyTargetPoolRequest request =
SetSecurityPolicyTargetPoolRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
.setTargetPool("targetPool486493517")
.build();
ApiFuture<Operation> future =
targetPoolsClient.setSecurityPolicyCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.