@Generated(value="by gapic-generator") @BetaApi public class NetworkEndpointGroupClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource = NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build();
Operation response = networkEndpointGroupClient.attachNetworkEndpointsNetworkEndpointGroup(networkEndpointGroup, networkEndpointGroupsAttachEndpointsRequestResource);
}
Note: close() needs to be called on the networkEndpointGroupClient 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:
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 NetworkEndpointGroupSettings to create(). For example:
To customize credentials:
NetworkEndpointGroupSettings networkEndpointGroupSettings =
NetworkEndpointGroupSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
NetworkEndpointGroupClient networkEndpointGroupClient =
NetworkEndpointGroupClient.create(networkEndpointGroupSettings);
To customize the endpoint:
NetworkEndpointGroupSettings networkEndpointGroupSettings =
NetworkEndpointGroupSettings.newBuilder().setEndpoint(myEndpoint).build();
NetworkEndpointGroupClient networkEndpointGroupClient =
NetworkEndpointGroupClient.create(networkEndpointGroupSettings);
Modifier and Type | Class and Description |
---|---|
static class |
NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsFixedSizeCollection |
static class |
NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPage |
static class |
NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPagedResponse |
static class |
NetworkEndpointGroupClient.ListNetworkEndpointGroupsFixedSizeCollection |
static class |
NetworkEndpointGroupClient.ListNetworkEndpointGroupsPage |
static class |
NetworkEndpointGroupClient.ListNetworkEndpointGroupsPagedResponse |
static class |
NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsFixedSizeCollection |
static class |
NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPage |
static class |
NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
NetworkEndpointGroupClient(NetworkEndpointGroupSettings settings)
Constructs an instance of NetworkEndpointGroupClient, using the given settings.
|
protected |
NetworkEndpointGroupClient(NetworkEndpointGroupStub stub) |
Modifier and Type | Method and Description |
---|---|
NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPagedResponse |
aggregatedListNetworkEndpointGroups(AggregatedListNetworkEndpointGroupsHttpRequest request)
Retrieves the list of network endpoint groups and sorts them by zone.
|
NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPagedResponse |
aggregatedListNetworkEndpointGroups(ProjectName project)
Retrieves the list of network endpoint groups and sorts them by zone.
|
NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPagedResponse |
aggregatedListNetworkEndpointGroups(String project)
Retrieves the list of network endpoint groups and sorts them by zone.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupAggregatedList> |
aggregatedListNetworkEndpointGroupsCallable()
Retrieves the list of network endpoint groups and sorts them by zone.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPagedResponse> |
aggregatedListNetworkEndpointGroupsPagedCallable()
Retrieves the list of network endpoint groups and sorts them by zone.
|
Operation |
attachNetworkEndpointsNetworkEndpointGroup(AttachNetworkEndpointsNetworkEndpointGroupHttpRequest request)
Attach a list of network endpoints to the specified network endpoint group.
|
Operation |
attachNetworkEndpointsNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupName networkEndpointGroup,
NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)
Attach a list of network endpoints to the specified network endpoint group.
|
Operation |
attachNetworkEndpointsNetworkEndpointGroup(String networkEndpointGroup,
NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)
Attach a list of network endpoints to the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<AttachNetworkEndpointsNetworkEndpointGroupHttpRequest,Operation> |
attachNetworkEndpointsNetworkEndpointGroupCallable()
Attach a list of network endpoints to the specified network endpoint group.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static NetworkEndpointGroupClient |
create()
Constructs an instance of NetworkEndpointGroupClient with default settings.
|
static NetworkEndpointGroupClient |
create(NetworkEndpointGroupSettings settings)
Constructs an instance of NetworkEndpointGroupClient, using the given settings.
|
static NetworkEndpointGroupClient |
create(NetworkEndpointGroupStub stub)
Constructs an instance of NetworkEndpointGroupClient, using the given stub for making calls.
|
Operation |
deleteNetworkEndpointGroup(DeleteNetworkEndpointGroupHttpRequest request)
Deletes the specified network endpoint group.
|
Operation |
deleteNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupName networkEndpointGroup)
Deletes the specified network endpoint group.
|
Operation |
deleteNetworkEndpointGroup(String networkEndpointGroup)
Deletes the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<DeleteNetworkEndpointGroupHttpRequest,Operation> |
deleteNetworkEndpointGroupCallable()
Deletes the specified network endpoint group.
|
Operation |
detachNetworkEndpointsNetworkEndpointGroup(DetachNetworkEndpointsNetworkEndpointGroupHttpRequest request)
Detach a list of network endpoints from the specified network endpoint group.
|
Operation |
detachNetworkEndpointsNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupName networkEndpointGroup,
NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)
Detach a list of network endpoints from the specified network endpoint group.
|
Operation |
detachNetworkEndpointsNetworkEndpointGroup(String networkEndpointGroup,
NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)
Detach a list of network endpoints from the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<DetachNetworkEndpointsNetworkEndpointGroupHttpRequest,Operation> |
detachNetworkEndpointsNetworkEndpointGroupCallable()
Detach a list of network endpoints from the specified network endpoint group.
|
NetworkEndpointGroup |
getNetworkEndpointGroup(GetNetworkEndpointGroupHttpRequest request)
Returns the specified network endpoint group.
|
NetworkEndpointGroup |
getNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupName networkEndpointGroup)
Returns the specified network endpoint group.
|
NetworkEndpointGroup |
getNetworkEndpointGroup(String networkEndpointGroup)
Returns the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<GetNetworkEndpointGroupHttpRequest,NetworkEndpointGroup> |
getNetworkEndpointGroupCallable()
Returns the specified network endpoint group.
|
NetworkEndpointGroupSettings |
getSettings() |
NetworkEndpointGroupStub |
getStub() |
Operation |
insertNetworkEndpointGroup(InsertNetworkEndpointGroupHttpRequest request)
Creates a network endpoint group in the specified project using the parameters that are
included in the request.
|
Operation |
insertNetworkEndpointGroup(ProjectZoneName zone,
NetworkEndpointGroup networkEndpointGroupResource)
Creates a network endpoint group in the specified project using the parameters that are
included in the request.
|
Operation |
insertNetworkEndpointGroup(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<InsertNetworkEndpointGroupHttpRequest,Operation> |
insertNetworkEndpointGroupCallable()
Creates a network endpoint group in the specified project using the parameters that are
included in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
NetworkEndpointGroupClient.ListNetworkEndpointGroupsPagedResponse |
listNetworkEndpointGroups(ListNetworkEndpointGroupsHttpRequest request)
Retrieves the list of network endpoint groups that are located in the specified project and
zone.
|
NetworkEndpointGroupClient.ListNetworkEndpointGroupsPagedResponse |
listNetworkEndpointGroups(ProjectZoneName zone)
Retrieves the list of network endpoint groups that are located in the specified project and
zone.
|
NetworkEndpointGroupClient.ListNetworkEndpointGroupsPagedResponse |
listNetworkEndpointGroups(String zone)
Retrieves the list of network endpoint groups that are located in the specified project and
zone.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupList> |
listNetworkEndpointGroupsCallable()
Retrieves the list of network endpoint groups that are located in the specified project and
zone.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupClient.ListNetworkEndpointGroupsPagedResponse> |
listNetworkEndpointGroupsPagedCallable()
Retrieves the list of network endpoint groups that are located in the specified project and
zone.
|
NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPagedResponse |
listNetworkEndpointsNetworkEndpointGroups(ListNetworkEndpointsNetworkEndpointGroupsHttpRequest request)
Lists the network endpoints in the specified network endpoint group.
|
NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPagedResponse |
listNetworkEndpointsNetworkEndpointGroups(ProjectZoneNetworkEndpointGroupName networkEndpointGroup,
NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)
Lists the network endpoints in the specified network endpoint group.
|
NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPagedResponse |
listNetworkEndpointsNetworkEndpointGroups(String networkEndpointGroup,
NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)
Lists the network endpoints in the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupsListNetworkEndpoints> |
listNetworkEndpointsNetworkEndpointGroupsCallable()
Lists the network endpoints in the specified network endpoint group.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPagedResponse> |
listNetworkEndpointsNetworkEndpointGroupsPagedCallable()
Lists the network endpoints in the specified network endpoint group.
|
void |
shutdown() |
void |
shutdownNow() |
TestPermissionsResponse |
testIamPermissionsNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupResourceName resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissionsNetworkEndpointGroup(String resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissionsNetworkEndpointGroup(TestIamPermissionsNetworkEndpointGroupHttpRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsNetworkEndpointGroupHttpRequest,TestPermissionsResponse> |
testIamPermissionsNetworkEndpointGroupCallable()
Returns permissions that a caller has on the specified resource.
|
protected NetworkEndpointGroupClient(NetworkEndpointGroupSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected NetworkEndpointGroupClient(NetworkEndpointGroupStub stub)
public static final NetworkEndpointGroupClient create() throws IOException
IOException
public static final NetworkEndpointGroupClient create(NetworkEndpointGroupSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final NetworkEndpointGroupClient create(NetworkEndpointGroupStub stub)
public final NetworkEndpointGroupSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public NetworkEndpointGroupStub getStub()
@BetaApi public final NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPagedResponse aggregatedListNetworkEndpointGroups(ProjectName project)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (NetworkEndpointGroupsScopedList element : networkEndpointGroupClient.aggregatedListNetworkEndpointGroups(project).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPagedResponse aggregatedListNetworkEndpointGroups(String project)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (NetworkEndpointGroupsScopedList element : networkEndpointGroupClient.aggregatedListNetworkEndpointGroups(project.toString()).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPagedResponse aggregatedListNetworkEndpointGroups(AggregatedListNetworkEndpointGroupsHttpRequest request)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListNetworkEndpointGroupsHttpRequest request = AggregatedListNetworkEndpointGroupsHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
for (NetworkEndpointGroupsScopedList element : networkEndpointGroupClient.aggregatedListNetworkEndpointGroups(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AggregatedListNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupClient.AggregatedListNetworkEndpointGroupsPagedResponse> aggregatedListNetworkEndpointGroupsPagedCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListNetworkEndpointGroupsHttpRequest request = AggregatedListNetworkEndpointGroupsHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
ApiFuture<AggregatedListNetworkEndpointGroupsPagedResponse> future = networkEndpointGroupClient.aggregatedListNetworkEndpointGroupsPagedCallable().futureCall(request);
// Do something
for (NetworkEndpointGroupsScopedList element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AggregatedListNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupAggregatedList> aggregatedListNetworkEndpointGroupsCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListNetworkEndpointGroupsHttpRequest request = AggregatedListNetworkEndpointGroupsHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
while (true) {
NetworkEndpointGroupAggregatedList response = networkEndpointGroupClient.aggregatedListNetworkEndpointGroupsCallable().call(request);
for (NetworkEndpointGroupsScopedList element : response.getItemsMap()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final Operation attachNetworkEndpointsNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupName networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource = NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build();
Operation response = networkEndpointGroupClient.attachNetworkEndpointsNetworkEndpointGroup(networkEndpointGroup, networkEndpointGroupsAttachEndpointsRequestResource);
}
networkEndpointGroup
- The name of the network endpoint group where you are attaching
network endpoints to. It should comply with RFC1035.networkEndpointGroupsAttachEndpointsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation attachNetworkEndpointsNetworkEndpointGroup(String networkEndpointGroup, NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource = NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build();
Operation response = networkEndpointGroupClient.attachNetworkEndpointsNetworkEndpointGroup(networkEndpointGroup.toString(), networkEndpointGroupsAttachEndpointsRequestResource);
}
networkEndpointGroup
- The name of the network endpoint group where you are attaching
network endpoints to. It should comply with RFC1035.networkEndpointGroupsAttachEndpointsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation attachNetworkEndpointsNetworkEndpointGroup(AttachNetworkEndpointsNetworkEndpointGroupHttpRequest request)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource = NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build();
AttachNetworkEndpointsNetworkEndpointGroupHttpRequest request = AttachNetworkEndpointsNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.setNetworkEndpointGroupsAttachEndpointsRequestResource(networkEndpointGroupsAttachEndpointsRequestResource)
.build();
Operation response = networkEndpointGroupClient.attachNetworkEndpointsNetworkEndpointGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AttachNetworkEndpointsNetworkEndpointGroupHttpRequest,Operation> attachNetworkEndpointsNetworkEndpointGroupCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsAttachEndpointsRequest networkEndpointGroupsAttachEndpointsRequestResource = NetworkEndpointGroupsAttachEndpointsRequest.newBuilder().build();
AttachNetworkEndpointsNetworkEndpointGroupHttpRequest request = AttachNetworkEndpointsNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.setNetworkEndpointGroupsAttachEndpointsRequestResource(networkEndpointGroupsAttachEndpointsRequestResource)
.build();
ApiFuture<Operation> future = networkEndpointGroupClient.attachNetworkEndpointsNetworkEndpointGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation deleteNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupName networkEndpointGroup)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
Operation response = networkEndpointGroupClient.deleteNetworkEndpointGroup(networkEndpointGroup);
}
networkEndpointGroup
- The name of the network endpoint group to delete. It should comply
with RFC1035.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteNetworkEndpointGroup(String networkEndpointGroup)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
Operation response = networkEndpointGroupClient.deleteNetworkEndpointGroup(networkEndpointGroup.toString());
}
networkEndpointGroup
- The name of the network endpoint group to delete. It should comply
with RFC1035.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteNetworkEndpointGroup(DeleteNetworkEndpointGroupHttpRequest request)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
DeleteNetworkEndpointGroupHttpRequest request = DeleteNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.build();
Operation response = networkEndpointGroupClient.deleteNetworkEndpointGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<DeleteNetworkEndpointGroupHttpRequest,Operation> deleteNetworkEndpointGroupCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
DeleteNetworkEndpointGroupHttpRequest request = DeleteNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.build();
ApiFuture<Operation> future = networkEndpointGroupClient.deleteNetworkEndpointGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation detachNetworkEndpointsNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupName networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource = NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build();
Operation response = networkEndpointGroupClient.detachNetworkEndpointsNetworkEndpointGroup(networkEndpointGroup, networkEndpointGroupsDetachEndpointsRequestResource);
}
networkEndpointGroup
- The name of the network endpoint group where you are removing
network endpoints. It should comply with RFC1035.networkEndpointGroupsDetachEndpointsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation detachNetworkEndpointsNetworkEndpointGroup(String networkEndpointGroup, NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource = NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build();
Operation response = networkEndpointGroupClient.detachNetworkEndpointsNetworkEndpointGroup(networkEndpointGroup.toString(), networkEndpointGroupsDetachEndpointsRequestResource);
}
networkEndpointGroup
- The name of the network endpoint group where you are removing
network endpoints. It should comply with RFC1035.networkEndpointGroupsDetachEndpointsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation detachNetworkEndpointsNetworkEndpointGroup(DetachNetworkEndpointsNetworkEndpointGroupHttpRequest request)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource = NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build();
DetachNetworkEndpointsNetworkEndpointGroupHttpRequest request = DetachNetworkEndpointsNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.setNetworkEndpointGroupsDetachEndpointsRequestResource(networkEndpointGroupsDetachEndpointsRequestResource)
.build();
Operation response = networkEndpointGroupClient.detachNetworkEndpointsNetworkEndpointGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<DetachNetworkEndpointsNetworkEndpointGroupHttpRequest,Operation> detachNetworkEndpointsNetworkEndpointGroupCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsDetachEndpointsRequest networkEndpointGroupsDetachEndpointsRequestResource = NetworkEndpointGroupsDetachEndpointsRequest.newBuilder().build();
DetachNetworkEndpointsNetworkEndpointGroupHttpRequest request = DetachNetworkEndpointsNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.setNetworkEndpointGroupsDetachEndpointsRequestResource(networkEndpointGroupsDetachEndpointsRequestResource)
.build();
ApiFuture<Operation> future = networkEndpointGroupClient.detachNetworkEndpointsNetworkEndpointGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final NetworkEndpointGroup getNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupName networkEndpointGroup)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroup response = networkEndpointGroupClient.getNetworkEndpointGroup(networkEndpointGroup);
}
networkEndpointGroup
- The name of the network endpoint group. It should comply with
RFC1035.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NetworkEndpointGroup getNetworkEndpointGroup(String networkEndpointGroup)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroup response = networkEndpointGroupClient.getNetworkEndpointGroup(networkEndpointGroup.toString());
}
networkEndpointGroup
- The name of the network endpoint group. It should comply with
RFC1035.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NetworkEndpointGroup getNetworkEndpointGroup(GetNetworkEndpointGroupHttpRequest request)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
GetNetworkEndpointGroupHttpRequest request = GetNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.build();
NetworkEndpointGroup response = networkEndpointGroupClient.getNetworkEndpointGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<GetNetworkEndpointGroupHttpRequest,NetworkEndpointGroup> getNetworkEndpointGroupCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
GetNetworkEndpointGroupHttpRequest request = GetNetworkEndpointGroupHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.build();
ApiFuture<NetworkEndpointGroup> future = networkEndpointGroupClient.getNetworkEndpointGroupCallable().futureCall(request);
// Do something
NetworkEndpointGroup response = future.get();
}
@BetaApi public final Operation insertNetworkEndpointGroup(ProjectZoneName zone, NetworkEndpointGroup networkEndpointGroupResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
NetworkEndpointGroup networkEndpointGroupResource = NetworkEndpointGroup.newBuilder().build();
Operation response = networkEndpointGroupClient.insertNetworkEndpointGroup(zone, networkEndpointGroupResource);
}
zone
- The name of the zone where you want to create the network endpoint group. It should
comply with RFC1035.networkEndpointGroupResource
- Represents a collection of network endpoints.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertNetworkEndpointGroup(String zone, NetworkEndpointGroup networkEndpointGroupResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
NetworkEndpointGroup networkEndpointGroupResource = NetworkEndpointGroup.newBuilder().build();
Operation response = networkEndpointGroupClient.insertNetworkEndpointGroup(zone.toString(), networkEndpointGroupResource);
}
zone
- The name of the zone where you want to create the network endpoint group. It should
comply with RFC1035.networkEndpointGroupResource
- Represents a collection of network endpoints.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertNetworkEndpointGroup(InsertNetworkEndpointGroupHttpRequest request)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
NetworkEndpointGroup networkEndpointGroupResource = NetworkEndpointGroup.newBuilder().build();
InsertNetworkEndpointGroupHttpRequest request = InsertNetworkEndpointGroupHttpRequest.newBuilder()
.setZone(formattedZone)
.setNetworkEndpointGroupResource(networkEndpointGroupResource)
.build();
Operation response = networkEndpointGroupClient.insertNetworkEndpointGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<InsertNetworkEndpointGroupHttpRequest,Operation> insertNetworkEndpointGroupCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
NetworkEndpointGroup networkEndpointGroupResource = NetworkEndpointGroup.newBuilder().build();
InsertNetworkEndpointGroupHttpRequest request = InsertNetworkEndpointGroupHttpRequest.newBuilder()
.setZone(formattedZone)
.setNetworkEndpointGroupResource(networkEndpointGroupResource)
.build();
ApiFuture<Operation> future = networkEndpointGroupClient.insertNetworkEndpointGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final NetworkEndpointGroupClient.ListNetworkEndpointGroupsPagedResponse listNetworkEndpointGroups(ProjectZoneName zone)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
for (NetworkEndpointGroup element : networkEndpointGroupClient.listNetworkEndpointGroups(zone).iterateAll()) {
// doThingsWith(element);
}
}
zone
- The name of the zone where the network endpoint group is located. It should comply
with RFC1035.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NetworkEndpointGroupClient.ListNetworkEndpointGroupsPagedResponse listNetworkEndpointGroups(String zone)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
for (NetworkEndpointGroup element : networkEndpointGroupClient.listNetworkEndpointGroups(zone.toString()).iterateAll()) {
// doThingsWith(element);
}
}
zone
- The name of the zone where the network endpoint group is located. It should comply
with RFC1035.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NetworkEndpointGroupClient.ListNetworkEndpointGroupsPagedResponse listNetworkEndpointGroups(ListNetworkEndpointGroupsHttpRequest request)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
ListNetworkEndpointGroupsHttpRequest request = ListNetworkEndpointGroupsHttpRequest.newBuilder()
.setZone(formattedZone)
.build();
for (NetworkEndpointGroup element : networkEndpointGroupClient.listNetworkEndpointGroups(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupClient.ListNetworkEndpointGroupsPagedResponse> listNetworkEndpointGroupsPagedCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
ListNetworkEndpointGroupsHttpRequest request = ListNetworkEndpointGroupsHttpRequest.newBuilder()
.setZone(formattedZone)
.build();
ApiFuture<ListNetworkEndpointGroupsPagedResponse> future = networkEndpointGroupClient.listNetworkEndpointGroupsPagedCallable().futureCall(request);
// Do something
for (NetworkEndpointGroup element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupList> listNetworkEndpointGroupsCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
ListNetworkEndpointGroupsHttpRequest request = ListNetworkEndpointGroupsHttpRequest.newBuilder()
.setZone(formattedZone)
.build();
while (true) {
NetworkEndpointGroupList response = networkEndpointGroupClient.listNetworkEndpointGroupsCallable().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;
}
}
}
@BetaApi public final NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPagedResponse listNetworkEndpointsNetworkEndpointGroups(ProjectZoneNetworkEndpointGroupName networkEndpointGroup, NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource = NetworkEndpointGroupsListEndpointsRequest.newBuilder().build();
for (NetworkEndpointWithHealthStatus element : networkEndpointGroupClient.listNetworkEndpointsNetworkEndpointGroups(networkEndpointGroup, networkEndpointGroupsListEndpointsRequestResource).iterateAll()) {
// doThingsWith(element);
}
}
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
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPagedResponse listNetworkEndpointsNetworkEndpointGroups(String networkEndpointGroup, NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupName networkEndpointGroup = ProjectZoneNetworkEndpointGroupName.of("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource = NetworkEndpointGroupsListEndpointsRequest.newBuilder().build();
for (NetworkEndpointWithHealthStatus element : networkEndpointGroupClient.listNetworkEndpointsNetworkEndpointGroups(networkEndpointGroup.toString(), networkEndpointGroupsListEndpointsRequestResource).iterateAll()) {
// doThingsWith(element);
}
}
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
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPagedResponse listNetworkEndpointsNetworkEndpointGroups(ListNetworkEndpointsNetworkEndpointGroupsHttpRequest request)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource = NetworkEndpointGroupsListEndpointsRequest.newBuilder().build();
ListNetworkEndpointsNetworkEndpointGroupsHttpRequest request = ListNetworkEndpointsNetworkEndpointGroupsHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.setNetworkEndpointGroupsListEndpointsRequestResource(networkEndpointGroupsListEndpointsRequestResource)
.build();
for (NetworkEndpointWithHealthStatus element : networkEndpointGroupClient.listNetworkEndpointsNetworkEndpointGroups(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupClient.ListNetworkEndpointsNetworkEndpointGroupsPagedResponse> listNetworkEndpointsNetworkEndpointGroupsPagedCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource = NetworkEndpointGroupsListEndpointsRequest.newBuilder().build();
ListNetworkEndpointsNetworkEndpointGroupsHttpRequest request = ListNetworkEndpointsNetworkEndpointGroupsHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.setNetworkEndpointGroupsListEndpointsRequestResource(networkEndpointGroupsListEndpointsRequestResource)
.build();
ApiFuture<ListNetworkEndpointsNetworkEndpointGroupsPagedResponse> future = networkEndpointGroupClient.listNetworkEndpointsNetworkEndpointGroupsPagedCallable().futureCall(request);
// Do something
for (NetworkEndpointWithHealthStatus element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListNetworkEndpointsNetworkEndpointGroupsHttpRequest,NetworkEndpointGroupsListNetworkEndpoints> listNetworkEndpointsNetworkEndpointGroupsCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedNetworkEndpointGroup = ProjectZoneNetworkEndpointGroupName.format("[PROJECT]", "[ZONE]", "[NETWORK_ENDPOINT_GROUP]");
NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource = NetworkEndpointGroupsListEndpointsRequest.newBuilder().build();
ListNetworkEndpointsNetworkEndpointGroupsHttpRequest request = ListNetworkEndpointsNetworkEndpointGroupsHttpRequest.newBuilder()
.setNetworkEndpointGroup(formattedNetworkEndpointGroup)
.setNetworkEndpointGroupsListEndpointsRequestResource(networkEndpointGroupsListEndpointsRequestResource)
.build();
while (true) {
NetworkEndpointGroupsListNetworkEndpoints response = networkEndpointGroupClient.listNetworkEndpointsNetworkEndpointGroupsCallable().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;
}
}
}
@BetaApi public final TestPermissionsResponse testIamPermissionsNetworkEndpointGroup(ProjectZoneNetworkEndpointGroupResourceName resource, TestPermissionsRequest testPermissionsRequestResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupResourceName resource = ProjectZoneNetworkEndpointGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response = networkEndpointGroupClient.testIamPermissionsNetworkEndpointGroup(resource, testPermissionsRequestResource);
}
resource
- Name or id of the resource for this request.testPermissionsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final TestPermissionsResponse testIamPermissionsNetworkEndpointGroup(String resource, TestPermissionsRequest testPermissionsRequestResource)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
ProjectZoneNetworkEndpointGroupResourceName resource = ProjectZoneNetworkEndpointGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response = networkEndpointGroupClient.testIamPermissionsNetworkEndpointGroup(resource.toString(), testPermissionsRequestResource);
}
resource
- Name or id of the resource for this request.testPermissionsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final TestPermissionsResponse testIamPermissionsNetworkEndpointGroup(TestIamPermissionsNetworkEndpointGroupHttpRequest request)
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedResource = ProjectZoneNetworkEndpointGroupResourceName.format("[PROJECT]", "[ZONE]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestIamPermissionsNetworkEndpointGroupHttpRequest request = TestIamPermissionsNetworkEndpointGroupHttpRequest.newBuilder()
.setResource(formattedResource)
.setTestPermissionsRequestResource(testPermissionsRequestResource)
.build();
TestPermissionsResponse response = networkEndpointGroupClient.testIamPermissionsNetworkEndpointGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsNetworkEndpointGroupHttpRequest,TestPermissionsResponse> testIamPermissionsNetworkEndpointGroupCallable()
Sample code:
try (NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient.create()) {
String formattedResource = ProjectZoneNetworkEndpointGroupResourceName.format("[PROJECT]", "[ZONE]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestIamPermissionsNetworkEndpointGroupHttpRequest request = TestIamPermissionsNetworkEndpointGroupHttpRequest.newBuilder()
.setResource(formattedResource)
.setTestPermissionsRequestResource(testPermissionsRequestResource)
.build();
ApiFuture<TestPermissionsResponse> future = networkEndpointGroupClient.testIamPermissionsNetworkEndpointGroupCallable().futureCall(request);
// Do something
TestPermissionsResponse response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.