@Generated(value="by gapic-generator-java") public class NetworkEndpointGroupsClient 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String networkEndpointGroup = "networkEndpointGroup-2120389028";
NetworkEndpointGroup response =
networkEndpointGroupsClient.get(project, zone, networkEndpointGroup);
}
Note: close() needs to be called on the NetworkEndpointGroupsClient 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 |
|---|---|---|
AggregatedList |
Retrieves the list of network endpoint groups and sorts them by zone. 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.
|
AttachNetworkEndpoints |
Attach a list of network endpoints to the specified network endpoint group. |
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.
|
Delete |
Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. |
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.
|
DetachNetworkEndpoints |
Detach a list of network endpoints from the specified network endpoint group. |
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 network endpoint group. |
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 network endpoint group in the specified project using the parameters that are 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 the list of network endpoint groups that are located in the specified project and zone. |
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.
|
ListNetworkEndpoints |
Lists the network endpoints in the specified network endpoint group. |
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.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. |
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.
|
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 NetworkEndpointGroupsSettings 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
NetworkEndpointGroupsSettings networkEndpointGroupsSettings =
NetworkEndpointGroupsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create(networkEndpointGroupsSettings);
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
NetworkEndpointGroupsSettings networkEndpointGroupsSettings =
NetworkEndpointGroupsSettings.newBuilder().setEndpoint(myEndpoint).build();
NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create(networkEndpointGroupsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
NetworkEndpointGroupsClient.AggregatedListFixedSizeCollection |
static class |
NetworkEndpointGroupsClient.AggregatedListPage |
static class |
NetworkEndpointGroupsClient.AggregatedListPagedResponse |
static class |
NetworkEndpointGroupsClient.ListFixedSizeCollection |
static class |
NetworkEndpointGroupsClient.ListNetworkEndpointsFixedSizeCollection |
static class |
NetworkEndpointGroupsClient.ListNetworkEndpointsPage |
static class |
NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse |
static class |
NetworkEndpointGroupsClient.ListPage |
static class |
NetworkEndpointGroupsClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
NetworkEndpointGroupsClient(NetworkEndpointGroupsSettings settings)
Constructs an instance of NetworkEndpointGroupsClient, using the given settings.
|
protected |
NetworkEndpointGroupsClient(NetworkEndpointGroupsStub stub) |
| Modifier and Type | Method and Description |
|---|---|
NetworkEndpointGroupsClient.AggregatedListPagedResponse |
aggregatedList(AggregatedListNetworkEndpointGroupsRequest request)
Retrieves the list of network endpoint groups and sorts them by zone.
|
NetworkEndpointGroupsClient.AggregatedListPagedResponse |
aggregatedList(String project)
Retrieves the list of network endpoint groups and sorts them by zone.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListNetworkEndpointGroupsRequest,NetworkEndpointGroupAggregatedList> |
aggregatedListCallable()
Retrieves the list of network endpoint groups and sorts them by zone.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.AggregatedListPagedResponse> |
aggregatedListPagedCallable()
Retrieves the list of network endpoint groups and sorts them by zone.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
attachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request)
Attach a list of network endpoints to the specified network endpoint group.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
attachNetworkEndpointsAsync(String project,
String zone,
String networkEndpointGroup,
NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)
Attach a list of network endpoints to the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<AttachNetworkEndpointsNetworkEndpointGroupRequest,Operation> |
attachNetworkEndpointsCallable()
Attach a list of network endpoints to the specified network endpoint group.
|
com.google.api.gax.rpc.OperationCallable<AttachNetworkEndpointsNetworkEndpointGroupRequest,Operation,Operation> |
attachNetworkEndpointsOperationCallable()
Attach a list of network endpoints to the specified network endpoint group.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static NetworkEndpointGroupsClient |
create()
Constructs an instance of NetworkEndpointGroupsClient with default settings.
|
static NetworkEndpointGroupsClient |
create(NetworkEndpointGroupsSettings settings)
Constructs an instance of NetworkEndpointGroupsClient, using the given settings.
|
static NetworkEndpointGroupsClient |
create(NetworkEndpointGroupsStub stub)
Constructs an instance of NetworkEndpointGroupsClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteNetworkEndpointGroupRequest request)
Deletes the specified network endpoint group.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String project,
String zone,
String networkEndpointGroup)
Deletes the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<DeleteNetworkEndpointGroupRequest,Operation> |
deleteCallable()
Deletes the specified network endpoint group.
|
com.google.api.gax.rpc.OperationCallable<DeleteNetworkEndpointGroupRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified network endpoint group.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
detachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request)
Detach a list of network endpoints from the specified network endpoint group.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
detachNetworkEndpointsAsync(String project,
String zone,
String networkEndpointGroup,
NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)
Detach a list of network endpoints from the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<DetachNetworkEndpointsNetworkEndpointGroupRequest,Operation> |
detachNetworkEndpointsCallable()
Detach a list of network endpoints from the specified network endpoint group.
|
com.google.api.gax.rpc.OperationCallable<DetachNetworkEndpointsNetworkEndpointGroupRequest,Operation,Operation> |
detachNetworkEndpointsOperationCallable()
Detach a list of network endpoints from the specified network endpoint group.
|
NetworkEndpointGroup |
get(GetNetworkEndpointGroupRequest request)
Returns the specified network endpoint group.
|
NetworkEndpointGroup |
get(String project,
String zone,
String networkEndpointGroup)
Returns the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<GetNetworkEndpointGroupRequest,NetworkEndpointGroup> |
getCallable()
Returns the specified network endpoint group.
|
NetworkEndpointGroupsSettings |
getSettings() |
NetworkEndpointGroupsStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertNetworkEndpointGroupRequest request)
Creates a network endpoint group in the specified project using the parameters that are
included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(String project,
String zone,
NetworkEndpointGroup networkEndpointGroupResource)
Creates a network endpoint group in the specified project using the parameters that are
included in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertNetworkEndpointGroupRequest,Operation> |
insertCallable()
Creates a network endpoint group in the specified project using the parameters that are
included in the request.
|
com.google.api.gax.rpc.OperationCallable<InsertNetworkEndpointGroupRequest,Operation,Operation> |
insertOperationCallable()
Creates a network endpoint group in the specified project using the parameters that are
included in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
NetworkEndpointGroupsClient.ListPagedResponse |
list(ListNetworkEndpointGroupsRequest request)
Retrieves the list of network endpoint groups that are located in the specified project and
zone.
|
NetworkEndpointGroupsClient.ListPagedResponse |
list(String project,
String zone)
Retrieves the list of network endpoint groups that are located in the specified project and
zone.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointGroupsRequest,NetworkEndpointGroupList> |
listCallable()
Retrieves the list of network endpoint groups that are located in the specified project and
zone.
|
NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse |
listNetworkEndpoints(ListNetworkEndpointsNetworkEndpointGroupsRequest request)
Lists the network endpoints in the specified network endpoint group.
|
NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse |
listNetworkEndpoints(String project,
String zone,
String networkEndpointGroup,
NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)
Lists the network endpoints in the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsRequest,NetworkEndpointGroupsListNetworkEndpoints> |
listNetworkEndpointsCallable()
Lists the network endpoints in the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse> |
listNetworkEndpointsPagedCallable()
Lists the network endpoints in the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.ListPagedResponse> |
listPagedCallable()
Retrieves the list of network endpoint groups that are located in the specified project and
zone.
|
void |
shutdown() |
void |
shutdownNow() |
TestPermissionsResponse |
testIamPermissions(String project,
String zone,
String resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissions(TestIamPermissionsNetworkEndpointGroupRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsNetworkEndpointGroupRequest,TestPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
protected NetworkEndpointGroupsClient(NetworkEndpointGroupsSettings settings) throws IOException
IOExceptionprotected NetworkEndpointGroupsClient(NetworkEndpointGroupsStub stub)
public static final NetworkEndpointGroupsClient create() throws IOException
IOExceptionpublic static final NetworkEndpointGroupsClient create(NetworkEndpointGroupsSettings settings) throws IOException
IOExceptionpublic static final NetworkEndpointGroupsClient create(NetworkEndpointGroupsStub stub)
public final NetworkEndpointGroupsSettings getSettings()
public NetworkEndpointGroupsStub getStub()
public final NetworkEndpointGroupsClient.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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
for (Map.Entry<String, NetworkEndpointGroupsScopedList> element :
networkEndpointGroupsClient.aggregatedList(project).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NetworkEndpointGroupsClient.AggregatedListPagedResponse aggregatedList(AggregatedListNetworkEndpointGroupsRequest 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
AggregatedListNetworkEndpointGroupsRequest request =
AggregatedListNetworkEndpointGroupsRequest.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, NetworkEndpointGroupsScopedList> element :
networkEndpointGroupsClient.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<AggregatedListNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
AggregatedListNetworkEndpointGroupsRequest request =
AggregatedListNetworkEndpointGroupsRequest.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, NetworkEndpointGroupsScopedList>> future =
networkEndpointGroupsClient.aggregatedListPagedCallable().futureCall(request);
// Do something.
for (Map.Entry<String, NetworkEndpointGroupsScopedList> element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<AggregatedListNetworkEndpointGroupsRequest,NetworkEndpointGroupAggregatedList> 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
AggregatedListNetworkEndpointGroupsRequest request =
AggregatedListNetworkEndpointGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
while (true) {
NetworkEndpointGroupAggregatedList response =
networkEndpointGroupsClient.aggregatedListCallable().call(request);
for (Map.Entry<String, NetworkEndpointGroupsScopedList> 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> attachNetworkEndpointsAsync(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String networkEndpointGroup = "networkEndpointGroup-2120389028";
NetworkEndpointGroupsAttachEndpointsRequest
networkEndpointGroupsAttachEndpointsRequestResource =
NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build();
Operation response =
networkEndpointGroupsClient
.attachNetworkEndpointsAsync(
project,
zone,
networkEndpointGroup,
networkEndpointGroupsAttachEndpointsRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone where the network endpoint group is located. It should comply
with RFC1035.networkEndpointGroup - The name of the network endpoint group where you are attaching
network endpoints to. It should comply with RFC1035.networkEndpointGroupsAttachEndpointsRequestResource - 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> attachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
AttachNetworkEndpointsNetworkEndpointGroupRequest request =
AttachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setNetworkEndpointGroupsAttachEndpointsRequestResource(
NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = networkEndpointGroupsClient.attachNetworkEndpointsAsync(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<AttachNetworkEndpointsNetworkEndpointGroupRequest,Operation,Operation> attachNetworkEndpointsOperationCallable()
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
AttachNetworkEndpointsNetworkEndpointGroupRequest request =
AttachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setNetworkEndpointGroupsAttachEndpointsRequestResource(
NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
networkEndpointGroupsClient.attachNetworkEndpointsOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AttachNetworkEndpointsNetworkEndpointGroupRequest,Operation> attachNetworkEndpointsCallable()
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
AttachNetworkEndpointsNetworkEndpointGroupRequest request =
AttachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setNetworkEndpointGroupsAttachEndpointsRequestResource(
NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
networkEndpointGroupsClient.attachNetworkEndpointsCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String project, String zone, String networkEndpointGroup)
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String networkEndpointGroup = "networkEndpointGroup-2120389028";
Operation response =
networkEndpointGroupsClient.deleteAsync(project, zone, networkEndpointGroup).get();
}
project - Project ID for this request.zone - The name of the zone where the network endpoint group is located. It should comply
with RFC1035.networkEndpointGroup - The name of the network endpoint group to delete. It should comply
with RFC1035.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteNetworkEndpointGroupRequest 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
DeleteNetworkEndpointGroupRequest request =
DeleteNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = networkEndpointGroupsClient.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<DeleteNetworkEndpointGroupRequest,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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
DeleteNetworkEndpointGroupRequest request =
DeleteNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
networkEndpointGroupsClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteNetworkEndpointGroupRequest,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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
DeleteNetworkEndpointGroupRequest request =
DeleteNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
networkEndpointGroupsClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> detachNetworkEndpointsAsync(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String networkEndpointGroup = "networkEndpointGroup-2120389028";
NetworkEndpointGroupsDetachEndpointsRequest
networkEndpointGroupsDetachEndpointsRequestResource =
NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build();
Operation response =
networkEndpointGroupsClient
.detachNetworkEndpointsAsync(
project,
zone,
networkEndpointGroup,
networkEndpointGroupsDetachEndpointsRequestResource)
.get();
}
project - Project ID for this request.zone - The name of the zone where the network endpoint group is located. It should comply
with RFC1035.networkEndpointGroup - The name of the network endpoint group where you are removing
network endpoints. It should comply with RFC1035.networkEndpointGroupsDetachEndpointsRequestResource - 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> detachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
DetachNetworkEndpointsNetworkEndpointGroupRequest request =
DetachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setNetworkEndpointGroupsDetachEndpointsRequestResource(
NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = networkEndpointGroupsClient.detachNetworkEndpointsAsync(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<DetachNetworkEndpointsNetworkEndpointGroupRequest,Operation,Operation> detachNetworkEndpointsOperationCallable()
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
DetachNetworkEndpointsNetworkEndpointGroupRequest request =
DetachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setNetworkEndpointGroupsDetachEndpointsRequestResource(
NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
networkEndpointGroupsClient.detachNetworkEndpointsOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DetachNetworkEndpointsNetworkEndpointGroupRequest,Operation> detachNetworkEndpointsCallable()
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
DetachNetworkEndpointsNetworkEndpointGroupRequest request =
DetachNetworkEndpointsNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setNetworkEndpointGroupsDetachEndpointsRequestResource(
NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
networkEndpointGroupsClient.detachNetworkEndpointsCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final NetworkEndpointGroup get(String project, String zone, String networkEndpointGroup)
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String networkEndpointGroup = "networkEndpointGroup-2120389028";
NetworkEndpointGroup response =
networkEndpointGroupsClient.get(project, zone, networkEndpointGroup);
}
project - Project ID for this request.zone - The name of the zone where the network endpoint group is located. It should comply
with RFC1035.networkEndpointGroup - The name of the network endpoint group. It should comply with
RFC1035.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NetworkEndpointGroup get(GetNetworkEndpointGroupRequest 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
GetNetworkEndpointGroupRequest request =
GetNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
NetworkEndpointGroup response = networkEndpointGroupsClient.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<GetNetworkEndpointGroupRequest,NetworkEndpointGroup> 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
GetNetworkEndpointGroupRequest request =
GetNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ApiFuture<NetworkEndpointGroup> future =
networkEndpointGroupsClient.getCallable().futureCall(request);
// Do something.
NetworkEndpointGroup response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String project, String zone, NetworkEndpointGroup networkEndpointGroupResource)
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
NetworkEndpointGroup networkEndpointGroupResource = NetworkEndpointGroup.newBuilder().build();
Operation response =
networkEndpointGroupsClient
.insertAsync(project, zone, networkEndpointGroupResource)
.get();
}
project - Project ID for this request.zone - The name of the zone where you want to create the network endpoint group. It should
comply with RFC1035.networkEndpointGroupResource - 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(InsertNetworkEndpointGroupRequest 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
InsertNetworkEndpointGroupRequest request =
InsertNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroupResource(NetworkEndpointGroup.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = networkEndpointGroupsClient.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<InsertNetworkEndpointGroupRequest,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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
InsertNetworkEndpointGroupRequest request =
InsertNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroupResource(NetworkEndpointGroup.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
networkEndpointGroupsClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertNetworkEndpointGroupRequest,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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
InsertNetworkEndpointGroupRequest request =
InsertNetworkEndpointGroupRequest.newBuilder()
.setNetworkEndpointGroupResource(NetworkEndpointGroup.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
networkEndpointGroupsClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final NetworkEndpointGroupsClient.ListPagedResponse list(String project, String zone)
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
for (NetworkEndpointGroup element :
networkEndpointGroupsClient.list(project, zone).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.zone - The name of the zone where the network endpoint group is located. It should comply
with RFC1035.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NetworkEndpointGroupsClient.ListPagedResponse list(ListNetworkEndpointGroupsRequest 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
ListNetworkEndpointGroupsRequest request =
ListNetworkEndpointGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
for (NetworkEndpointGroup element : networkEndpointGroupsClient.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<ListNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
ListNetworkEndpointGroupsRequest request =
ListNetworkEndpointGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
ApiFuture<NetworkEndpointGroup> future =
networkEndpointGroupsClient.listPagedCallable().futureCall(request);
// Do something.
for (NetworkEndpointGroup element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointGroupsRequest,NetworkEndpointGroupList> 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
ListNetworkEndpointGroupsRequest request =
ListNetworkEndpointGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
while (true) {
NetworkEndpointGroupList response =
networkEndpointGroupsClient.listCallable().call(request);
for (NetworkEndpointGroup element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse listNetworkEndpoints(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String networkEndpointGroup = "networkEndpointGroup-2120389028";
NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource =
NetworkEndpointGroupsListEndpointsRequest.newBuilder().build();
for (NetworkEndpointWithHealthStatus element :
networkEndpointGroupsClient
.listNetworkEndpoints(
project,
zone,
networkEndpointGroup,
networkEndpointGroupsListEndpointsRequestResource)
.iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.zone - The name of the zone where the network endpoint group is located. It should comply
with RFC1035.networkEndpointGroup - The name of the network endpoint group from which you want to
generate a list of included network endpoints. It should comply with RFC1035.networkEndpointGroupsListEndpointsRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse listNetworkEndpoints(ListNetworkEndpointsNetworkEndpointGroupsRequest 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
ListNetworkEndpointsNetworkEndpointGroupsRequest request =
ListNetworkEndpointsNetworkEndpointGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setNetworkEndpointGroupsListEndpointsRequestResource(
NetworkEndpointGroupsListEndpointsRequest.newBuilder().build())
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
for (NetworkEndpointWithHealthStatus element :
networkEndpointGroupsClient.listNetworkEndpoints(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<ListNetworkEndpointsNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse> listNetworkEndpointsPagedCallable()
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
ListNetworkEndpointsNetworkEndpointGroupsRequest request =
ListNetworkEndpointsNetworkEndpointGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setNetworkEndpointGroupsListEndpointsRequestResource(
NetworkEndpointGroupsListEndpointsRequest.newBuilder().build())
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
ApiFuture<NetworkEndpointWithHealthStatus> future =
networkEndpointGroupsClient.listNetworkEndpointsPagedCallable().futureCall(request);
// Do something.
for (NetworkEndpointWithHealthStatus element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsRequest,NetworkEndpointGroupsListNetworkEndpoints> listNetworkEndpointsCallable()
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
ListNetworkEndpointsNetworkEndpointGroupsRequest request =
ListNetworkEndpointsNetworkEndpointGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setNetworkEndpointGroup("networkEndpointGroup-2120389028")
.setNetworkEndpointGroupsListEndpointsRequestResource(
NetworkEndpointGroupsListEndpointsRequest.newBuilder().build())
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
while (true) {
NetworkEndpointGroupsListNetworkEndpoints response =
networkEndpointGroupsClient.listNetworkEndpointsCallable().call(request);
for (NetworkEndpointWithHealthStatus element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final TestPermissionsResponse testIamPermissions(String project, String zone, String resource, TestPermissionsRequest testPermissionsRequestResource)
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String resource = "resource-341064690";
TestPermissionsRequest testPermissionsRequestResource =
TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response =
networkEndpointGroupsClient.testIamPermissions(
project, zone, resource, testPermissionsRequestResource);
}
project - Project ID for this request.zone - The name of the zone for this request.resource - Name or id of the resource for this request.testPermissionsRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final TestPermissionsResponse testIamPermissions(TestIamPermissionsNetworkEndpointGroupRequest 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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
TestIamPermissionsNetworkEndpointGroupRequest request =
TestIamPermissionsNetworkEndpointGroupRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.setZone("zone3744684")
.build();
TestPermissionsResponse response = networkEndpointGroupsClient.testIamPermissions(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<TestIamPermissionsNetworkEndpointGroupRequest,TestPermissionsResponse> testIamPermissionsCallable()
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 (NetworkEndpointGroupsClient networkEndpointGroupsClient =
NetworkEndpointGroupsClient.create()) {
TestIamPermissionsNetworkEndpointGroupRequest request =
TestIamPermissionsNetworkEndpointGroupRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.setZone("zone3744684")
.build();
ApiFuture<TestPermissionsResponse> future =
networkEndpointGroupsClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestPermissionsResponse 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.