Class NetworkEndpointGroupsClient
- java.lang.Object
-
- com.google.cloud.compute.v1.NetworkEndpointGroupsClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class NetworkEndpointGroupsClient extends Object implements com.google.api.gax.core.BackgroundResource
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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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
-
Constructor Summary
Constructors Modifier Constructor Description protected
NetworkEndpointGroupsClient(NetworkEndpointGroupsSettings settings)
Constructs an instance of NetworkEndpointGroupsClient, using the given settings.protected
NetworkEndpointGroupsClient(NetworkEndpointGroupsStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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(TestIamPermissionsNetworkEndpointGroupRequest request)
Returns permissions that a caller has on the specified resource.TestPermissionsResponse
testIamPermissions(String project, String zone, String resource, TestPermissionsRequest testPermissionsRequestResource)
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.
-
-
-
Constructor Detail
-
NetworkEndpointGroupsClient
protected NetworkEndpointGroupsClient(NetworkEndpointGroupsSettings settings) throws IOException
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.- Throws:
IOException
-
NetworkEndpointGroupsClient
protected NetworkEndpointGroupsClient(NetworkEndpointGroupsStub stub)
-
-
Method Detail
-
create
public static final NetworkEndpointGroupsClient create() throws IOException
Constructs an instance of NetworkEndpointGroupsClient with default settings.- Throws:
IOException
-
create
public static final NetworkEndpointGroupsClient create(NetworkEndpointGroupsSettings settings) throws IOException
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.- Throws:
IOException
-
create
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).
-
getSettings
public final NetworkEndpointGroupsSettings getSettings()
-
getStub
public NetworkEndpointGroupsStub getStub()
-
aggregatedList
public final NetworkEndpointGroupsClient.AggregatedListPagedResponse aggregatedList(String project)
Retrieves the list of network endpoint groups and sorts them by 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"; for (Map.Entry<String, NetworkEndpointGroupsScopedList> element : networkEndpointGroupsClient.aggregatedList(project).iterateAll()) { // doThingsWith(element); } }
- Parameters:
project
- Project ID for this request.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
aggregatedList
public final NetworkEndpointGroupsClient.AggregatedListPagedResponse aggregatedList(AggregatedListNetworkEndpointGroupsRequest request)
Retrieves the list of network endpoint groups and sorts them by 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()) { AggregatedListNetworkEndpointGroupsRequest request = AggregatedListNetworkEndpointGroupsRequest.newBuilder() .setFilter("filter-1274492040") .setIncludeAllScopes(true) .setMaxResults(1128457243) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .setProject("project-309310695") .setReturnPartialSuccess(true) .build(); for (Map.Entry<String, NetworkEndpointGroupsScopedList> element : networkEndpointGroupsClient.aggregatedList(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
aggregatedListPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<AggregatedListNetworkEndpointGroupsRequest,NetworkEndpointGroupsClient.AggregatedListPagedResponse> aggregatedListPagedCallable()
Retrieves the list of network endpoint groups and sorts them by 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()) { AggregatedListNetworkEndpointGroupsRequest request = AggregatedListNetworkEndpointGroupsRequest.newBuilder() .setFilter("filter-1274492040") .setIncludeAllScopes(true) .setMaxResults(1128457243) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .setProject("project-309310695") .setReturnPartialSuccess(true) .build(); ApiFuture<Map.Entry<String, NetworkEndpointGroupsScopedList>> future = networkEndpointGroupsClient.aggregatedListPagedCallable().futureCall(request); // Do something. for (Map.Entry<String, NetworkEndpointGroupsScopedList> element : future.get().iterateAll()) { // doThingsWith(element); } }
-
aggregatedListCallable
public final com.google.api.gax.rpc.UnaryCallable<AggregatedListNetworkEndpointGroupsRequest,NetworkEndpointGroupAggregatedList> aggregatedListCallable()
Retrieves the list of network endpoint groups and sorts them by 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()) { AggregatedListNetworkEndpointGroupsRequest request = AggregatedListNetworkEndpointGroupsRequest.newBuilder() .setFilter("filter-1274492040") .setIncludeAllScopes(true) .setMaxResults(1128457243) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .setProject("project-309310695") .setReturnPartialSuccess(true) .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; } } }
-
attachNetworkEndpointsAsync
public final 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.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:
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 request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
attachNetworkEndpointsAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
attachNetworkEndpointsOperationCallable
public final com.google.api.gax.rpc.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(); }
-
attachNetworkEndpointsCallable
public final com.google.api.gax.rpc.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(); }
-
deleteAsync
public final com.google.api.gax.longrunning.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:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteOperationCallable
public final com.google.api.gax.rpc.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(); }
-
deleteCallable
public final com.google.api.gax.rpc.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(); }
-
detachNetworkEndpointsAsync
public final 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.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:
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 request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
detachNetworkEndpointsAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
detachNetworkEndpointsOperationCallable
public final com.google.api.gax.rpc.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(); }
-
detachNetworkEndpointsCallable
public final com.google.api.gax.rpc.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(); }
-
get
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:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
get
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getCallable
public final com.google.api.gax.rpc.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(); }
-
insertAsync
public final 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.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:
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 request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
insertAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final 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.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
insertOperationCallable
public final 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.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(); }
-
insertCallable
public final 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.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(); }
-
list
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:
project
- Project ID for this request.zone
- The name of the zone where the network endpoint group is located. It should comply with RFC1035.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
list
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPagedCallable
public final 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.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); } }
-
listCallable
public final 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.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; } } }
-
listNetworkEndpoints
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:
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 request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNetworkEndpoints
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNetworkEndpointsPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listNetworkEndpointsCallable
public final com.google.api.gax.rpc.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; } } }
-
testIamPermissions
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:
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 request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
testIamPermissions
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
testIamPermissionsCallable
public final com.google.api.gax.rpc.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(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-