- 1.65.0 (latest)
- 1.64.0
- 1.63.0
- 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
GitHub Repository | Product Reference |
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:
// 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
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
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. |
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
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
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
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
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
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
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.
Static Methods
create()
public static final TargetPoolsClient create()
Constructs an instance of TargetPoolsClient with default settings.
Returns | |
---|---|
Type | Description |
TargetPoolsClient |
Exceptions | |
---|---|
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.
Parameter | |
---|---|
Name | Description |
settings | TargetPoolsSettings |
Returns | |
---|---|
Type | Description |
TargetPoolsClient |
Exceptions | |
---|---|
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).
Parameter | |
---|---|
Name | Description |
stub | TargetPoolsStub |
Returns | |
---|---|
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.
Parameter | |
---|---|
Name | Description |
settings | TargetPoolsSettings |
TargetPoolsClient(TargetPoolsStub stub)
protected TargetPoolsClient(TargetPoolsStub stub)
Parameter | |
---|---|
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:
// 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();
}
Parameter | |
---|---|
Name | Description |
request | AddHealthCheckTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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:
// 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();
}
Parameters | |
---|---|
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 |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
addHealthCheckCallable()
public final UnaryCallable<AddHealthCheckTargetPoolRequest,Operation> addHealthCheckCallable()
Adds health check URLs to a target pool.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<AddHealthCheckTargetPoolRequest,Operation> |
addHealthCheckOperationCallable()
public final OperationCallable<AddHealthCheckTargetPoolRequest,Operation,Operation> addHealthCheckOperationCallable()
Adds health check URLs to a target pool.
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();
}
Returns | |
---|---|
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:
// 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();
}
Parameter | |
---|---|
Name | Description |
request | AddInstanceTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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:
// 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();
}
Parameters | |
---|---|
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 |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
addInstanceCallable()
public final UnaryCallable<AddInstanceTargetPoolRequest,Operation> addInstanceCallable()
Adds an instance to a target pool.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<AddInstanceTargetPoolRequest,Operation> |
addInstanceOperationCallable()
public final OperationCallable<AddInstanceTargetPoolRequest,Operation,Operation> addInstanceOperationCallable()
Adds an instance to a target pool.
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();
}
Returns | |
---|---|
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:
// 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);
}
}
Parameter | |
---|---|
Name | Description |
request | AggregatedListTargetPoolsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
TargetPoolsClient.AggregatedListPagedResponse |
aggregatedList(String project)
public final TargetPoolsClient.AggregatedListPagedResponse aggregatedList(String project)
Retrieves an aggregated list of target pools.
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);
}
}
Parameter | |
---|---|
Name | Description |
project | String Project ID for this request. |
Returns | |
---|---|
Type | Description |
TargetPoolsClient.AggregatedListPagedResponse |
aggregatedListCallable()
public final UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolAggregatedList> aggregatedListCallable()
Retrieves an aggregated list of target pools.
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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolAggregatedList> |
aggregatedListPagedCallable()
public final UnaryCallable<AggregatedListTargetPoolsRequest,TargetPoolsClient.AggregatedListPagedResponse> aggregatedListPagedCallable()
Retrieves an aggregated list of target pools.
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);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<AggregatedListTargetPoolsRequest,AggregatedListPagedResponse> |
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration | long |
unit | TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
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:
// 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();
}
Parameter | |
---|---|
Name | Description |
request | DeleteTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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:
// 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();
}
Parameters | |
---|---|
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. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
deleteCallable()
public final UnaryCallable<DeleteTargetPoolRequest,Operation> deleteCallable()
Deletes the specified target pool.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteTargetPoolRequest,Operation> |
deleteOperationCallable()
public final OperationCallable<DeleteTargetPoolRequest,Operation,Operation> deleteOperationCallable()
Deletes the specified target pool.
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteTargetPoolRequest,Operation,Operation> |
get(GetTargetPoolRequest request)
public final TargetPool get(GetTargetPoolRequest request)
Returns the specified target pool.
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);
}
Parameter | |
---|---|
Name | Description |
request | GetTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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.
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);
}
Parameters | |
---|---|
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. |
Returns | |
---|---|
Type | Description |
TargetPool |
getCallable()
public final UnaryCallable<GetTargetPoolRequest,TargetPool> getCallable()
Returns the specified target pool.
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();
}
Returns | |
---|---|
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:
// 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);
}
Parameter | |
---|---|
Name | Description |
request | GetHealthTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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:
// 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);
}
Parameters | |
---|---|
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 |
Returns | |
---|---|
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:
// 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetHealthTargetPoolRequest,TargetPoolInstanceHealth> |
getSettings()
public final TargetPoolsSettings getSettings()
Returns | |
---|---|
Type | Description |
TargetPoolsSettings |
getStub()
public TargetPoolsStub getStub()
Returns | |
---|---|
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:
// 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();
}
Parameter | |
---|---|
Name | Description |
request | InsertTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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:
// 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();
}
Parameters | |
---|---|
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 |
Returns | |
---|---|
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:
// 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();
}
Returns | |
---|---|
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:
// 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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<InsertTargetPoolRequest,Operation,Operation> |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
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:
// 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);
}
}
Parameter | |
---|---|
Name | Description |
request | ListTargetPoolsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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:
// 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);
}
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
region | String Name of the region scoping this request. |
Returns | |
---|---|
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:
// 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;
}
}
}
Returns | |
---|---|
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:
// 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);
}
}
Returns | |
---|---|
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:
// 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();
}
Parameter | |
---|---|
Name | Description |
request | RemoveHealthCheckTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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:
// 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();
}
Parameters | |
---|---|
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 |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
removeHealthCheckCallable()
public final UnaryCallable<RemoveHealthCheckTargetPoolRequest,Operation> removeHealthCheckCallable()
Removes health check URL from a target pool.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<RemoveHealthCheckTargetPoolRequest,Operation> |
removeHealthCheckOperationCallable()
public final OperationCallable<RemoveHealthCheckTargetPoolRequest,Operation,Operation> removeHealthCheckOperationCallable()
Removes health check URL from a target pool.
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();
}
Returns | |
---|---|
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:
// 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();
}
Parameter | |
---|---|
Name | Description |
request | RemoveInstanceTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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:
// 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();
}
Parameters | |
---|---|
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 |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
removeInstanceCallable()
public final UnaryCallable<RemoveInstanceTargetPoolRequest,Operation> removeInstanceCallable()
Removes instance URL from a target pool.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<RemoveInstanceTargetPoolRequest,Operation> |
removeInstanceOperationCallable()
public final OperationCallable<RemoveInstanceTargetPoolRequest,Operation,Operation> removeInstanceOperationCallable()
Removes instance URL from a target pool.
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();
}
Returns | |
---|---|
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:
// 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();
}
Parameter | |
---|---|
Name | Description |
request | SetBackupTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
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:
// 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();
}
Parameters | |
---|---|
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 |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
setBackupCallable()
public final UnaryCallable<SetBackupTargetPoolRequest,Operation> setBackupCallable()
Changes a backup target pool's configurations.
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<SetBackupTargetPoolRequest,Operation> |
setBackupOperationCallable()
public final OperationCallable<SetBackupTargetPoolRequest,Operation,Operation> setBackupOperationCallable()
Changes a backup target pool's configurations.
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<SetBackupTargetPoolRequest,Operation,Operation> |
setSecurityPolicyAsync(SetSecurityPolicyTargetPoolRequest request)
public final OperationFuture<Operation,Operation> setSecurityPolicyAsync(SetSecurityPolicyTargetPoolRequest request)
Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview
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();
}
Parameter | |
---|---|
Name | Description |
request | SetSecurityPolicyTargetPoolRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
setSecurityPolicyAsync(String project, String region, String targetPool, SecurityPolicyReference securityPolicyReferenceResource)
public final OperationFuture<Operation,Operation> setSecurityPolicyAsync(String project, String region, String targetPool, SecurityPolicyReference securityPolicyReferenceResource)
Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview
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();
}
Parameters | |
---|---|
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 security policy should be set. The name should conform to RFC1035. |
securityPolicyReferenceResource | SecurityPolicyReference The body resource for this request |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
setSecurityPolicyCallable()
public final UnaryCallable<SetSecurityPolicyTargetPoolRequest,Operation> setSecurityPolicyCallable()
Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<SetSecurityPolicyTargetPoolRequest,Operation> |
setSecurityPolicyOperationCallable()
public final OperationCallable<SetSecurityPolicyTargetPoolRequest,Operation,Operation> setSecurityPolicyOperationCallable()
Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<SetSecurityPolicyTargetPoolRequest,Operation,Operation> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()