Class NetworkEndpointGroupsClient (1.58.0)

GitHub RepositoryProduct Reference

Service Description: The NetworkEndpointGroups 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 (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().

Methods
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.

  • aggregatedList(AggregatedListNetworkEndpointGroupsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • aggregatedList(String project)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • aggregatedListPagedCallable()

  • aggregatedListCallable()

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.

  • attachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • attachNetworkEndpointsAsync(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • attachNetworkEndpointsOperationCallable()

  • attachNetworkEndpointsCallable()

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.

  • deleteAsync(DeleteNetworkEndpointGroupRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteAsync(String project, String zone, String networkEndpointGroup)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteOperationCallable()

  • deleteCallable()

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.

  • detachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • detachNetworkEndpointsAsync(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • detachNetworkEndpointsOperationCallable()

  • detachNetworkEndpointsCallable()

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.

  • get(GetNetworkEndpointGroupRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • get(String project, String zone, String networkEndpointGroup)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getCallable()

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.

  • insertAsync(InsertNetworkEndpointGroupRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • insertAsync(String project, String zone, NetworkEndpointGroup networkEndpointGroupResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • insertOperationCallable()

  • insertCallable()

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.

  • list(ListNetworkEndpointGroupsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • list(String project, String zone)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listPagedCallable()

  • listCallable()

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.

  • listNetworkEndpoints(ListNetworkEndpointsNetworkEndpointGroupsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listNetworkEndpoints(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listNetworkEndpointsPagedCallable()

  • listNetworkEndpointsCallable()

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.

  • testIamPermissions(TestIamPermissionsNetworkEndpointGroupRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • testIamPermissions(String project, String zone, String resource, TestPermissionsRequest testPermissionsRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

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.

Inheritance

java.lang.Object > NetworkEndpointGroupsClient

Static Methods

create()

public static final NetworkEndpointGroupsClient create()

Constructs an instance of NetworkEndpointGroupsClient with default settings.

Returns
Type Description
NetworkEndpointGroupsClient
Exceptions
Type Description
IOException

create(NetworkEndpointGroupsSettings settings)

public static final NetworkEndpointGroupsClient create(NetworkEndpointGroupsSettings settings)

Constructs an instance of NetworkEndpointGroupsClient, 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 NetworkEndpointGroupsSettings
Returns
Type Description
NetworkEndpointGroupsClient
Exceptions
Type Description
IOException

create(NetworkEndpointGroupsStub stub)

public static final NetworkEndpointGroupsClient create(NetworkEndpointGroupsStub stub)

Constructs an instance of NetworkEndpointGroupsClient, using the given stub for making calls. This is for advanced usage - prefer using create(NetworkEndpointGroupsSettings).

Parameter
Name Description
stub NetworkEndpointGroupsStub
Returns
Type Description
NetworkEndpointGroupsClient

Constructors

NetworkEndpointGroupsClient(NetworkEndpointGroupsSettings settings)

protected NetworkEndpointGroupsClient(NetworkEndpointGroupsSettings settings)

Constructs an instance of NetworkEndpointGroupsClient, 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 NetworkEndpointGroupsSettings

NetworkEndpointGroupsClient(NetworkEndpointGroupsStub stub)

protected NetworkEndpointGroupsClient(NetworkEndpointGroupsStub stub)
Parameter
Name Description
stub NetworkEndpointGroupsStub

Methods

aggregatedList(AggregatedListNetworkEndpointGroupsRequest request)

public final NetworkEndpointGroupsClient.AggregatedListPagedResponse aggregatedList(AggregatedListNetworkEndpointGroupsRequest request)

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.

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);
   }
 }
 
Parameter
Name Description
request AggregatedListNetworkEndpointGroupsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NetworkEndpointGroupsClient.AggregatedListPagedResponse

aggregatedList(String project)

public final NetworkEndpointGroupsClient.AggregatedListPagedResponse aggregatedList(String project)

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.

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);
   }
 }
 
Parameter
Name Description
project String

Project ID for this request.

Returns
Type Description
NetworkEndpointGroupsClient.AggregatedListPagedResponse

aggregatedListCallable()

public final UnaryCallable<AggregatedListNetworkEndpointGroupsRequest,NetworkEndpointGroupAggregatedList> aggregatedListCallable()

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.

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<AggregatedListNetworkEndpointGroupsRequest,NetworkEndpointGroupAggregatedList>

aggregatedListPagedCallable()

public final UnaryCallable<AggregatedListNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.AggregatedListPagedResponse> aggregatedListPagedCallable()

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.

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);
   }
 }
 
Returns
Type Description
UnaryCallable<AggregatedListNetworkEndpointGroupsRequest,AggregatedListPagedResponse>

attachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request)

public final OperationFuture<Operation,Operation> attachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest request)

Attach a list of network endpoints to the specified network endpoint group.

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();
 }
 
Parameter
Name Description
request AttachNetworkEndpointsNetworkEndpointGroupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

attachNetworkEndpointsAsync(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)

public final OperationFuture<Operation,Operation> attachNetworkEndpointsAsync(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)

Attach a list of network endpoints to the specified network endpoint group.

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();
 }
 
Parameters
Name Description
project String

Project ID for this request.

zone String

The name of the zone where the network endpoint group is located. It should comply with RFC1035.

networkEndpointGroup String

The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.

networkEndpointGroupsAttachEndpointsRequestResource NetworkEndpointGroupsAttachEndpointsRequest

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

attachNetworkEndpointsCallable()

public final UnaryCallable<AttachNetworkEndpointsNetworkEndpointGroupRequest,Operation> attachNetworkEndpointsCallable()

Attach a list of network endpoints to the specified network endpoint group.

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();
 }
 
Returns
Type Description
UnaryCallable<AttachNetworkEndpointsNetworkEndpointGroupRequest,Operation>

attachNetworkEndpointsOperationCallable()

public final OperationCallable<AttachNetworkEndpointsNetworkEndpointGroupRequest,Operation,Operation> attachNetworkEndpointsOperationCallable()

Attach a list of network endpoints to the specified network endpoint group.

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();
 }
 
Returns
Type Description
OperationCallable<AttachNetworkEndpointsNetworkEndpointGroupRequest,Operation,Operation>

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(DeleteNetworkEndpointGroupRequest request)

public final OperationFuture<Operation,Operation> deleteAsync(DeleteNetworkEndpointGroupRequest request)

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.

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();
 }
 
Parameter
Name Description
request DeleteNetworkEndpointGroupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

deleteAsync(String project, String zone, String networkEndpointGroup)

public final OperationFuture<Operation,Operation> deleteAsync(String project, String zone, String networkEndpointGroup)

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.

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();
 }
 
Parameters
Name Description
project String

Project ID for this request.

zone String

The name of the zone where the network endpoint group is located. It should comply with RFC1035.

networkEndpointGroup String

The name of the network endpoint group to delete. It should comply with RFC1035.

Returns
Type Description
OperationFuture<Operation,Operation>

deleteCallable()

public final UnaryCallable<DeleteNetworkEndpointGroupRequest,Operation> deleteCallable()

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.

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();
 }
 
Returns
Type Description
UnaryCallable<DeleteNetworkEndpointGroupRequest,Operation>

deleteOperationCallable()

public final OperationCallable<DeleteNetworkEndpointGroupRequest,Operation,Operation> deleteOperationCallable()

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.

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();
 }
 
Returns
Type Description
OperationCallable<DeleteNetworkEndpointGroupRequest,Operation,Operation>

detachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request)

public final OperationFuture<Operation,Operation> detachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest request)

Detach a list of network endpoints from the specified network endpoint group.

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();
 }
 
Parameter
Name Description
request DetachNetworkEndpointsNetworkEndpointGroupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

detachNetworkEndpointsAsync(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)

public final OperationFuture<Operation,Operation> detachNetworkEndpointsAsync(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)

Detach a list of network endpoints from the specified network endpoint group.

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();
 }
 
Parameters
Name Description
project String

Project ID for this request.

zone String

The name of the zone where the network endpoint group is located. It should comply with RFC1035.

networkEndpointGroup String

The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.

networkEndpointGroupsDetachEndpointsRequestResource NetworkEndpointGroupsDetachEndpointsRequest

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

detachNetworkEndpointsCallable()

public final UnaryCallable<DetachNetworkEndpointsNetworkEndpointGroupRequest,Operation> detachNetworkEndpointsCallable()

Detach a list of network endpoints from the specified network endpoint group.

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();
 }
 
Returns
Type Description
UnaryCallable<DetachNetworkEndpointsNetworkEndpointGroupRequest,Operation>

detachNetworkEndpointsOperationCallable()

public final OperationCallable<DetachNetworkEndpointsNetworkEndpointGroupRequest,Operation,Operation> detachNetworkEndpointsOperationCallable()

Detach a list of network endpoints from the specified network endpoint group.

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();
 }
 
Returns
Type Description
OperationCallable<DetachNetworkEndpointsNetworkEndpointGroupRequest,Operation,Operation>

get(GetNetworkEndpointGroupRequest request)

public final NetworkEndpointGroup get(GetNetworkEndpointGroupRequest request)

Returns the specified network endpoint group.

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);
 }
 
Parameter
Name Description
request GetNetworkEndpointGroupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NetworkEndpointGroup

get(String project, String zone, String networkEndpointGroup)

public final NetworkEndpointGroup get(String project, String zone, String networkEndpointGroup)

Returns the specified network endpoint group.

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);
 }
 
Parameters
Name Description
project String

Project ID for this request.

zone String

The name of the zone where the network endpoint group is located. It should comply with RFC1035.

networkEndpointGroup String

The name of the network endpoint group. It should comply with RFC1035.

Returns
Type Description
NetworkEndpointGroup

getCallable()

public final UnaryCallable<GetNetworkEndpointGroupRequest,NetworkEndpointGroup> getCallable()

Returns the specified network endpoint group.

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();
 }
 
Returns
Type Description
UnaryCallable<GetNetworkEndpointGroupRequest,NetworkEndpointGroup>

getSettings()

public final NetworkEndpointGroupsSettings getSettings()
Returns
Type Description
NetworkEndpointGroupsSettings

getStub()

public NetworkEndpointGroupsStub getStub()
Returns
Type Description
NetworkEndpointGroupsStub

insertAsync(InsertNetworkEndpointGroupRequest request)

public final OperationFuture<Operation,Operation> insertAsync(InsertNetworkEndpointGroupRequest request)

Creates a network endpoint group in the specified project using the parameters that are 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 (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();
 }
 
Parameter
Name Description
request InsertNetworkEndpointGroupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

insertAsync(String project, String zone, NetworkEndpointGroup networkEndpointGroupResource)

public final 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.

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();
 }
 
Parameters
Name Description
project String

Project ID for this request.

zone String

The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.

networkEndpointGroupResource NetworkEndpointGroup

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

insertCallable()

public final UnaryCallable<InsertNetworkEndpointGroupRequest,Operation> insertCallable()

Creates a network endpoint group in the specified project using the parameters that are 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 (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();
 }
 
Returns
Type Description
UnaryCallable<InsertNetworkEndpointGroupRequest,Operation>

insertOperationCallable()

public final OperationCallable<InsertNetworkEndpointGroupRequest,Operation,Operation> insertOperationCallable()

Creates a network endpoint group in the specified project using the parameters that are 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 (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();
 }
 
Returns
Type Description
OperationCallable<InsertNetworkEndpointGroupRequest,Operation,Operation>

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

list(ListNetworkEndpointGroupsRequest request)

public final NetworkEndpointGroupsClient.ListPagedResponse list(ListNetworkEndpointGroupsRequest request)

Retrieves the list of network endpoint groups that are located in the specified project and 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()) {
   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);
   }
 }
 
Parameter
Name Description
request ListNetworkEndpointGroupsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NetworkEndpointGroupsClient.ListPagedResponse

list(String project, String zone)

public final NetworkEndpointGroupsClient.ListPagedResponse list(String project, String zone)

Retrieves the list of network endpoint groups that are located in the specified project and 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);
   }
 }
 
Parameters
Name Description
project String

Project ID for this request.

zone String

The name of the zone where the network endpoint group is located. It should comply with RFC1035.

Returns
Type Description
NetworkEndpointGroupsClient.ListPagedResponse

listCallable()

public final UnaryCallable<ListNetworkEndpointGroupsRequest,NetworkEndpointGroupList> listCallable()

Retrieves the list of network endpoint groups that are located in the specified project and 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()) {
   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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListNetworkEndpointGroupsRequest,NetworkEndpointGroupList>

listNetworkEndpoints(ListNetworkEndpointsNetworkEndpointGroupsRequest request)

public final NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse listNetworkEndpoints(ListNetworkEndpointsNetworkEndpointGroupsRequest request)

Lists the network endpoints in the specified network endpoint group.

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);
   }
 }
 
Parameter
Name Description
request ListNetworkEndpointsNetworkEndpointGroupsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse

listNetworkEndpoints(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)

public final NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse listNetworkEndpoints(String project, String zone, String networkEndpointGroup, NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)

Lists the network endpoints in the specified network endpoint group.

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);
   }
 }
 
Parameters
Name Description
project String

Project ID for this request.

zone String

The name of the zone where the network endpoint group is located. It should comply with RFC1035.

networkEndpointGroup String

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 NetworkEndpointGroupsListEndpointsRequest

The body resource for this request

Returns
Type Description
NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse

listNetworkEndpointsCallable()

public final UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsRequest,NetworkEndpointGroupsListNetworkEndpoints> listNetworkEndpointsCallable()

Lists the network endpoints in the specified network endpoint group.

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsRequest,NetworkEndpointGroupsListNetworkEndpoints>

listNetworkEndpointsPagedCallable()

public final UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.ListNetworkEndpointsPagedResponse> listNetworkEndpointsPagedCallable()

Lists the network endpoints in the specified network endpoint group.

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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsRequest,ListNetworkEndpointsPagedResponse>

listPagedCallable()

public final UnaryCallable<ListNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.ListPagedResponse> listPagedCallable()

Retrieves the list of network endpoint groups that are located in the specified project and 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()) {
   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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListNetworkEndpointGroupsRequest,ListPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsNetworkEndpointGroupRequest request)

public final TestPermissionsResponse testIamPermissions(TestIamPermissionsNetworkEndpointGroupRequest request)

Returns permissions that a caller has on the specified resource.

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);
 }
 
Parameter
Name Description
request TestIamPermissionsNetworkEndpointGroupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
TestPermissionsResponse

testIamPermissions(String project, String zone, String resource, TestPermissionsRequest testPermissionsRequestResource)

public final TestPermissionsResponse testIamPermissions(String project, String zone, String resource, TestPermissionsRequest testPermissionsRequestResource)

Returns permissions that a caller has on the specified resource.

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);
 }
 
Parameters
Name Description
project String

Project ID for this request.

zone String

The name of the zone for this request.

resource String

Name or id of the resource for this request.

testPermissionsRequestResource TestPermissionsRequest

The body resource for this request

Returns
Type Description
TestPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsNetworkEndpointGroupRequest,TestPermissionsResponse> testIamPermissionsCallable()

Returns permissions that a caller has on the specified resource.

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();
 }
 
Returns
Type Description
UnaryCallable<TestIamPermissionsNetworkEndpointGroupRequest,TestPermissionsResponse>