@Generated(value="by gapic-generator") @BetaApi public class ExternalVpnGatewayClient 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 (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectGlobalExternalVpnGatewayName externalVpnGateway = ProjectGlobalExternalVpnGatewayName.of("[PROJECT]", "[EXTERNAL_VPN_GATEWAY]");
Operation response = externalVpnGatewayClient.deleteExternalVpnGateway(externalVpnGateway);
}
Note: close() needs to be called on the externalVpnGatewayClient 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 ExternalVpnGatewaySettings to create(). For example:
To customize credentials:
ExternalVpnGatewaySettings externalVpnGatewaySettings =
ExternalVpnGatewaySettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ExternalVpnGatewayClient externalVpnGatewayClient =
ExternalVpnGatewayClient.create(externalVpnGatewaySettings);
To customize the endpoint:
ExternalVpnGatewaySettings externalVpnGatewaySettings =
ExternalVpnGatewaySettings.newBuilder().setEndpoint(myEndpoint).build();
ExternalVpnGatewayClient externalVpnGatewayClient =
ExternalVpnGatewayClient.create(externalVpnGatewaySettings);
Modifier and Type | Class and Description |
---|---|
static class |
ExternalVpnGatewayClient.ListExternalVpnGatewaysFixedSizeCollection |
static class |
ExternalVpnGatewayClient.ListExternalVpnGatewaysPage |
static class |
ExternalVpnGatewayClient.ListExternalVpnGatewaysPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
ExternalVpnGatewayClient(ExternalVpnGatewaySettings settings)
Constructs an instance of ExternalVpnGatewayClient, using the given settings.
|
protected |
ExternalVpnGatewayClient(ExternalVpnGatewayStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static ExternalVpnGatewayClient |
create()
Constructs an instance of ExternalVpnGatewayClient with default settings.
|
static ExternalVpnGatewayClient |
create(ExternalVpnGatewaySettings settings)
Constructs an instance of ExternalVpnGatewayClient, using the given settings.
|
static ExternalVpnGatewayClient |
create(ExternalVpnGatewayStub stub)
Constructs an instance of ExternalVpnGatewayClient, using the given stub for making calls.
|
Operation |
deleteExternalVpnGateway(DeleteExternalVpnGatewayHttpRequest request)
Deletes the specified externalVpnGateway.
|
Operation |
deleteExternalVpnGateway(ProjectGlobalExternalVpnGatewayName externalVpnGateway)
Deletes the specified externalVpnGateway.
|
Operation |
deleteExternalVpnGateway(String externalVpnGateway)
Deletes the specified externalVpnGateway.
|
com.google.api.gax.rpc.UnaryCallable<DeleteExternalVpnGatewayHttpRequest,Operation> |
deleteExternalVpnGatewayCallable()
Deletes the specified externalVpnGateway.
|
ExternalVpnGateway |
getExternalVpnGateway(GetExternalVpnGatewayHttpRequest request)
Returns the specified externalVpnGateway.
|
ExternalVpnGateway |
getExternalVpnGateway(ProjectGlobalExternalVpnGatewayName externalVpnGateway)
Returns the specified externalVpnGateway.
|
ExternalVpnGateway |
getExternalVpnGateway(String externalVpnGateway)
Returns the specified externalVpnGateway.
|
com.google.api.gax.rpc.UnaryCallable<GetExternalVpnGatewayHttpRequest,ExternalVpnGateway> |
getExternalVpnGatewayCallable()
Returns the specified externalVpnGateway.
|
ExternalVpnGatewaySettings |
getSettings() |
ExternalVpnGatewayStub |
getStub() |
Operation |
insertExternalVpnGateway(InsertExternalVpnGatewayHttpRequest request)
Creates a ExternalVpnGateway in the specified project using the data included in the request.
|
Operation |
insertExternalVpnGateway(ProjectName project,
ExternalVpnGateway externalVpnGatewayResource)
Creates a ExternalVpnGateway in the specified project using the data included in the request.
|
Operation |
insertExternalVpnGateway(String project,
ExternalVpnGateway externalVpnGatewayResource)
Creates a ExternalVpnGateway in the specified project using the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertExternalVpnGatewayHttpRequest,Operation> |
insertExternalVpnGatewayCallable()
Creates a ExternalVpnGateway in the specified project using the data included in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
ExternalVpnGatewayClient.ListExternalVpnGatewaysPagedResponse |
listExternalVpnGateways(ListExternalVpnGatewaysHttpRequest request)
Retrieves the list of ExternalVpnGateway available to the specified project.
|
ExternalVpnGatewayClient.ListExternalVpnGatewaysPagedResponse |
listExternalVpnGateways(ProjectName project)
Retrieves the list of ExternalVpnGateway available to the specified project.
|
ExternalVpnGatewayClient.ListExternalVpnGatewaysPagedResponse |
listExternalVpnGateways(String project)
Retrieves the list of ExternalVpnGateway available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListExternalVpnGatewaysHttpRequest,ExternalVpnGatewayList> |
listExternalVpnGatewaysCallable()
Retrieves the list of ExternalVpnGateway available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListExternalVpnGatewaysHttpRequest,ExternalVpnGatewayClient.ListExternalVpnGatewaysPagedResponse> |
listExternalVpnGatewaysPagedCallable()
Retrieves the list of ExternalVpnGateway available to the specified project.
|
Operation |
setLabelsExternalVpnGateway(ProjectGlobalExternalVpnGatewayResourceName resource,
GlobalSetLabelsRequest globalSetLabelsRequestResource)
Sets the labels on an ExternalVpnGateway.
|
Operation |
setLabelsExternalVpnGateway(SetLabelsExternalVpnGatewayHttpRequest request)
Sets the labels on an ExternalVpnGateway.
|
Operation |
setLabelsExternalVpnGateway(String resource,
GlobalSetLabelsRequest globalSetLabelsRequestResource)
Sets the labels on an ExternalVpnGateway.
|
com.google.api.gax.rpc.UnaryCallable<SetLabelsExternalVpnGatewayHttpRequest,Operation> |
setLabelsExternalVpnGatewayCallable()
Sets the labels on an ExternalVpnGateway.
|
void |
shutdown() |
void |
shutdownNow() |
TestPermissionsResponse |
testIamPermissionsExternalVpnGateway(ProjectGlobalExternalVpnGatewayResourceName resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissionsExternalVpnGateway(String resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissionsExternalVpnGateway(TestIamPermissionsExternalVpnGatewayHttpRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsExternalVpnGatewayHttpRequest,TestPermissionsResponse> |
testIamPermissionsExternalVpnGatewayCallable()
Returns permissions that a caller has on the specified resource.
|
protected ExternalVpnGatewayClient(ExternalVpnGatewaySettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected ExternalVpnGatewayClient(ExternalVpnGatewayStub stub)
public static final ExternalVpnGatewayClient create() throws IOException
IOException
public static final ExternalVpnGatewayClient create(ExternalVpnGatewaySettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final ExternalVpnGatewayClient create(ExternalVpnGatewayStub stub)
public final ExternalVpnGatewaySettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public ExternalVpnGatewayStub getStub()
@BetaApi public final Operation deleteExternalVpnGateway(ProjectGlobalExternalVpnGatewayName externalVpnGateway)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectGlobalExternalVpnGatewayName externalVpnGateway = ProjectGlobalExternalVpnGatewayName.of("[PROJECT]", "[EXTERNAL_VPN_GATEWAY]");
Operation response = externalVpnGatewayClient.deleteExternalVpnGateway(externalVpnGateway);
}
externalVpnGateway
- Name of the externalVpnGateways to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteExternalVpnGateway(String externalVpnGateway)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectGlobalExternalVpnGatewayName externalVpnGateway = ProjectGlobalExternalVpnGatewayName.of("[PROJECT]", "[EXTERNAL_VPN_GATEWAY]");
Operation response = externalVpnGatewayClient.deleteExternalVpnGateway(externalVpnGateway.toString());
}
externalVpnGateway
- Name of the externalVpnGateways to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteExternalVpnGateway(DeleteExternalVpnGatewayHttpRequest request)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedExternalVpnGateway = ProjectGlobalExternalVpnGatewayName.format("[PROJECT]", "[EXTERNAL_VPN_GATEWAY]");
DeleteExternalVpnGatewayHttpRequest request = DeleteExternalVpnGatewayHttpRequest.newBuilder()
.setExternalVpnGateway(formattedExternalVpnGateway)
.build();
Operation response = externalVpnGatewayClient.deleteExternalVpnGateway(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<DeleteExternalVpnGatewayHttpRequest,Operation> deleteExternalVpnGatewayCallable()
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedExternalVpnGateway = ProjectGlobalExternalVpnGatewayName.format("[PROJECT]", "[EXTERNAL_VPN_GATEWAY]");
DeleteExternalVpnGatewayHttpRequest request = DeleteExternalVpnGatewayHttpRequest.newBuilder()
.setExternalVpnGateway(formattedExternalVpnGateway)
.build();
ApiFuture<Operation> future = externalVpnGatewayClient.deleteExternalVpnGatewayCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final ExternalVpnGateway getExternalVpnGateway(ProjectGlobalExternalVpnGatewayName externalVpnGateway)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectGlobalExternalVpnGatewayName externalVpnGateway = ProjectGlobalExternalVpnGatewayName.of("[PROJECT]", "[EXTERNAL_VPN_GATEWAY]");
ExternalVpnGateway response = externalVpnGatewayClient.getExternalVpnGateway(externalVpnGateway);
}
externalVpnGateway
- Name of the externalVpnGateway to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final ExternalVpnGateway getExternalVpnGateway(String externalVpnGateway)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectGlobalExternalVpnGatewayName externalVpnGateway = ProjectGlobalExternalVpnGatewayName.of("[PROJECT]", "[EXTERNAL_VPN_GATEWAY]");
ExternalVpnGateway response = externalVpnGatewayClient.getExternalVpnGateway(externalVpnGateway.toString());
}
externalVpnGateway
- Name of the externalVpnGateway to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final ExternalVpnGateway getExternalVpnGateway(GetExternalVpnGatewayHttpRequest request)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedExternalVpnGateway = ProjectGlobalExternalVpnGatewayName.format("[PROJECT]", "[EXTERNAL_VPN_GATEWAY]");
GetExternalVpnGatewayHttpRequest request = GetExternalVpnGatewayHttpRequest.newBuilder()
.setExternalVpnGateway(formattedExternalVpnGateway)
.build();
ExternalVpnGateway response = externalVpnGatewayClient.getExternalVpnGateway(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<GetExternalVpnGatewayHttpRequest,ExternalVpnGateway> getExternalVpnGatewayCallable()
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedExternalVpnGateway = ProjectGlobalExternalVpnGatewayName.format("[PROJECT]", "[EXTERNAL_VPN_GATEWAY]");
GetExternalVpnGatewayHttpRequest request = GetExternalVpnGatewayHttpRequest.newBuilder()
.setExternalVpnGateway(formattedExternalVpnGateway)
.build();
ApiFuture<ExternalVpnGateway> future = externalVpnGatewayClient.getExternalVpnGatewayCallable().futureCall(request);
// Do something
ExternalVpnGateway response = future.get();
}
@BetaApi public final Operation insertExternalVpnGateway(ProjectName project, ExternalVpnGateway externalVpnGatewayResource)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
ExternalVpnGateway externalVpnGatewayResource = ExternalVpnGateway.newBuilder().build();
Operation response = externalVpnGatewayClient.insertExternalVpnGateway(project, externalVpnGatewayResource);
}
project
- Project ID for this request.externalVpnGatewayResource
- External VPN gateway is the on-premises VPN gateway(s) or
another cloud provider?s VPN gateway that connects to your Google Cloud VPN gateway. To
create a highly available VPN from Google Cloud to your on-premises side or another Cloud
provider's VPN gateway, you must create a external VPN gateway resource in GCP, which
provides the information to GCP about your external VPN gateway.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertExternalVpnGateway(String project, ExternalVpnGateway externalVpnGatewayResource)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
ExternalVpnGateway externalVpnGatewayResource = ExternalVpnGateway.newBuilder().build();
Operation response = externalVpnGatewayClient.insertExternalVpnGateway(project.toString(), externalVpnGatewayResource);
}
project
- Project ID for this request.externalVpnGatewayResource
- External VPN gateway is the on-premises VPN gateway(s) or
another cloud provider?s VPN gateway that connects to your Google Cloud VPN gateway. To
create a highly available VPN from Google Cloud to your on-premises side or another Cloud
provider's VPN gateway, you must create a external VPN gateway resource in GCP, which
provides the information to GCP about your external VPN gateway.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertExternalVpnGateway(InsertExternalVpnGatewayHttpRequest request)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ExternalVpnGateway externalVpnGatewayResource = ExternalVpnGateway.newBuilder().build();
InsertExternalVpnGatewayHttpRequest request = InsertExternalVpnGatewayHttpRequest.newBuilder()
.setProject(formattedProject)
.setExternalVpnGatewayResource(externalVpnGatewayResource)
.build();
Operation response = externalVpnGatewayClient.insertExternalVpnGateway(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<InsertExternalVpnGatewayHttpRequest,Operation> insertExternalVpnGatewayCallable()
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ExternalVpnGateway externalVpnGatewayResource = ExternalVpnGateway.newBuilder().build();
InsertExternalVpnGatewayHttpRequest request = InsertExternalVpnGatewayHttpRequest.newBuilder()
.setProject(formattedProject)
.setExternalVpnGatewayResource(externalVpnGatewayResource)
.build();
ApiFuture<Operation> future = externalVpnGatewayClient.insertExternalVpnGatewayCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final ExternalVpnGatewayClient.ListExternalVpnGatewaysPagedResponse listExternalVpnGateways(ProjectName project)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (ExternalVpnGateway element : externalVpnGatewayClient.listExternalVpnGateways(project).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final ExternalVpnGatewayClient.ListExternalVpnGatewaysPagedResponse listExternalVpnGateways(String project)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (ExternalVpnGateway element : externalVpnGatewayClient.listExternalVpnGateways(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 ExternalVpnGatewayClient.ListExternalVpnGatewaysPagedResponse listExternalVpnGateways(ListExternalVpnGatewaysHttpRequest request)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListExternalVpnGatewaysHttpRequest request = ListExternalVpnGatewaysHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
for (ExternalVpnGateway element : externalVpnGatewayClient.listExternalVpnGateways(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<ListExternalVpnGatewaysHttpRequest,ExternalVpnGatewayClient.ListExternalVpnGatewaysPagedResponse> listExternalVpnGatewaysPagedCallable()
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListExternalVpnGatewaysHttpRequest request = ListExternalVpnGatewaysHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
ApiFuture<ListExternalVpnGatewaysPagedResponse> future = externalVpnGatewayClient.listExternalVpnGatewaysPagedCallable().futureCall(request);
// Do something
for (ExternalVpnGateway element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListExternalVpnGatewaysHttpRequest,ExternalVpnGatewayList> listExternalVpnGatewaysCallable()
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListExternalVpnGatewaysHttpRequest request = ListExternalVpnGatewaysHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
while (true) {
ExternalVpnGatewayList response = externalVpnGatewayClient.listExternalVpnGatewaysCallable().call(request);
for (ExternalVpnGateway element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final Operation setLabelsExternalVpnGateway(ProjectGlobalExternalVpnGatewayResourceName resource, GlobalSetLabelsRequest globalSetLabelsRequestResource)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectGlobalExternalVpnGatewayResourceName resource = ProjectGlobalExternalVpnGatewayResourceName.of("[PROJECT]", "[RESOURCE]");
GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
Operation response = externalVpnGatewayClient.setLabelsExternalVpnGateway(resource, globalSetLabelsRequestResource);
}
resource
- Name or id of the resource for this request.globalSetLabelsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation setLabelsExternalVpnGateway(String resource, GlobalSetLabelsRequest globalSetLabelsRequestResource)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectGlobalExternalVpnGatewayResourceName resource = ProjectGlobalExternalVpnGatewayResourceName.of("[PROJECT]", "[RESOURCE]");
GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
Operation response = externalVpnGatewayClient.setLabelsExternalVpnGateway(resource.toString(), globalSetLabelsRequestResource);
}
resource
- Name or id of the resource for this request.globalSetLabelsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation setLabelsExternalVpnGateway(SetLabelsExternalVpnGatewayHttpRequest request)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedResource = ProjectGlobalExternalVpnGatewayResourceName.format("[PROJECT]", "[RESOURCE]");
GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
SetLabelsExternalVpnGatewayHttpRequest request = SetLabelsExternalVpnGatewayHttpRequest.newBuilder()
.setResource(formattedResource)
.setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
.build();
Operation response = externalVpnGatewayClient.setLabelsExternalVpnGateway(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<SetLabelsExternalVpnGatewayHttpRequest,Operation> setLabelsExternalVpnGatewayCallable()
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedResource = ProjectGlobalExternalVpnGatewayResourceName.format("[PROJECT]", "[RESOURCE]");
GlobalSetLabelsRequest globalSetLabelsRequestResource = GlobalSetLabelsRequest.newBuilder().build();
SetLabelsExternalVpnGatewayHttpRequest request = SetLabelsExternalVpnGatewayHttpRequest.newBuilder()
.setResource(formattedResource)
.setGlobalSetLabelsRequestResource(globalSetLabelsRequestResource)
.build();
ApiFuture<Operation> future = externalVpnGatewayClient.setLabelsExternalVpnGatewayCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final TestPermissionsResponse testIamPermissionsExternalVpnGateway(ProjectGlobalExternalVpnGatewayResourceName resource, TestPermissionsRequest testPermissionsRequestResource)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectGlobalExternalVpnGatewayResourceName resource = ProjectGlobalExternalVpnGatewayResourceName.of("[PROJECT]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response = externalVpnGatewayClient.testIamPermissionsExternalVpnGateway(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 testIamPermissionsExternalVpnGateway(String resource, TestPermissionsRequest testPermissionsRequestResource)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
ProjectGlobalExternalVpnGatewayResourceName resource = ProjectGlobalExternalVpnGatewayResourceName.of("[PROJECT]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response = externalVpnGatewayClient.testIamPermissionsExternalVpnGateway(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 testIamPermissionsExternalVpnGateway(TestIamPermissionsExternalVpnGatewayHttpRequest request)
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedResource = ProjectGlobalExternalVpnGatewayResourceName.format("[PROJECT]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestIamPermissionsExternalVpnGatewayHttpRequest request = TestIamPermissionsExternalVpnGatewayHttpRequest.newBuilder()
.setResource(formattedResource)
.setTestPermissionsRequestResource(testPermissionsRequestResource)
.build();
TestPermissionsResponse response = externalVpnGatewayClient.testIamPermissionsExternalVpnGateway(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<TestIamPermissionsExternalVpnGatewayHttpRequest,TestPermissionsResponse> testIamPermissionsExternalVpnGatewayCallable()
Sample code:
try (ExternalVpnGatewayClient externalVpnGatewayClient = ExternalVpnGatewayClient.create()) {
String formattedResource = ProjectGlobalExternalVpnGatewayResourceName.format("[PROJECT]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestIamPermissionsExternalVpnGatewayHttpRequest request = TestIamPermissionsExternalVpnGatewayHttpRequest.newBuilder()
.setResource(formattedResource)
.setTestPermissionsRequestResource(testPermissionsRequestResource)
.build();
ApiFuture<TestPermissionsResponse> future = externalVpnGatewayClient.testIamPermissionsExternalVpnGatewayCallable().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.