@Generated(value="by gapic-generator") @BetaApi public class RegionTargetHttpProxyClient 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 (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionTargetHttpProxyName targetHttpProxy = ProjectRegionTargetHttpProxyName.of("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
Operation response = regionTargetHttpProxyClient.deleteRegionTargetHttpProxy(targetHttpProxy);
}
Note: close() needs to be called on the regionTargetHttpProxyClient 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 RegionTargetHttpProxySettings to create(). For example:
To customize credentials:
RegionTargetHttpProxySettings regionTargetHttpProxySettings =
RegionTargetHttpProxySettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RegionTargetHttpProxyClient regionTargetHttpProxyClient =
RegionTargetHttpProxyClient.create(regionTargetHttpProxySettings);
To customize the endpoint:
RegionTargetHttpProxySettings regionTargetHttpProxySettings =
RegionTargetHttpProxySettings.newBuilder().setEndpoint(myEndpoint).build();
RegionTargetHttpProxyClient regionTargetHttpProxyClient =
RegionTargetHttpProxyClient.create(regionTargetHttpProxySettings);
Modifier and Type | Class and Description |
---|---|
static class |
RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesFixedSizeCollection |
static class |
RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPage |
static class |
RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
RegionTargetHttpProxyClient(RegionTargetHttpProxySettings settings)
Constructs an instance of RegionTargetHttpProxyClient, using the given settings.
|
protected |
RegionTargetHttpProxyClient(RegionTargetHttpProxyStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static RegionTargetHttpProxyClient |
create()
Constructs an instance of RegionTargetHttpProxyClient with default settings.
|
static RegionTargetHttpProxyClient |
create(RegionTargetHttpProxySettings settings)
Constructs an instance of RegionTargetHttpProxyClient, using the given settings.
|
static RegionTargetHttpProxyClient |
create(RegionTargetHttpProxyStub stub)
Constructs an instance of RegionTargetHttpProxyClient, using the given stub for making calls.
|
Operation |
deleteRegionTargetHttpProxy(DeleteRegionTargetHttpProxyHttpRequest request)
Deletes the specified TargetHttpProxy resource.
|
Operation |
deleteRegionTargetHttpProxy(ProjectRegionTargetHttpProxyName targetHttpProxy)
Deletes the specified TargetHttpProxy resource.
|
Operation |
deleteRegionTargetHttpProxy(String targetHttpProxy)
Deletes the specified TargetHttpProxy resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteRegionTargetHttpProxyHttpRequest,Operation> |
deleteRegionTargetHttpProxyCallable()
Deletes the specified TargetHttpProxy resource.
|
TargetHttpProxy |
getRegionTargetHttpProxy(GetRegionTargetHttpProxyHttpRequest request)
Returns the specified TargetHttpProxy resource in the specified region.
|
TargetHttpProxy |
getRegionTargetHttpProxy(ProjectRegionTargetHttpProxyName targetHttpProxy)
Returns the specified TargetHttpProxy resource in the specified region.
|
TargetHttpProxy |
getRegionTargetHttpProxy(String targetHttpProxy)
Returns the specified TargetHttpProxy resource in the specified region.
|
com.google.api.gax.rpc.UnaryCallable<GetRegionTargetHttpProxyHttpRequest,TargetHttpProxy> |
getRegionTargetHttpProxyCallable()
Returns the specified TargetHttpProxy resource in the specified region.
|
RegionTargetHttpProxySettings |
getSettings() |
RegionTargetHttpProxyStub |
getStub() |
Operation |
insertRegionTargetHttpProxy(InsertRegionTargetHttpProxyHttpRequest request)
Creates a TargetHttpProxy resource in the specified project and region using the data included
in the request.
|
Operation |
insertRegionTargetHttpProxy(ProjectRegionName region,
TargetHttpProxy targetHttpProxyResource)
Creates a TargetHttpProxy resource in the specified project and region using the data included
in the request.
|
Operation |
insertRegionTargetHttpProxy(String region,
TargetHttpProxy targetHttpProxyResource)
Creates a TargetHttpProxy resource in the specified project and region using the data included
in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertRegionTargetHttpProxyHttpRequest,Operation> |
insertRegionTargetHttpProxyCallable()
Creates a TargetHttpProxy resource in the specified project and region using the data included
in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPagedResponse |
listRegionTargetHttpProxies(ListRegionTargetHttpProxiesHttpRequest request)
Retrieves the list of TargetHttpProxy resources available to the specified project in the
specified region.
|
RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPagedResponse |
listRegionTargetHttpProxies(ProjectRegionName region)
Retrieves the list of TargetHttpProxy resources available to the specified project in the
specified region.
|
RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPagedResponse |
listRegionTargetHttpProxies(String region)
Retrieves the list of TargetHttpProxy resources available to the specified project in the
specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListRegionTargetHttpProxiesHttpRequest,TargetHttpProxyList> |
listRegionTargetHttpProxiesCallable()
Retrieves the list of TargetHttpProxy resources available to the specified project in the
specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListRegionTargetHttpProxiesHttpRequest,RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPagedResponse> |
listRegionTargetHttpProxiesPagedCallable()
Retrieves the list of TargetHttpProxy resources available to the specified project in the
specified region.
|
Operation |
setUrlMapRegionTargetHttpProxy(ProjectRegionTargetHttpProxyName targetHttpProxy,
UrlMapReference urlMapReferenceResource)
Changes the URL map for TargetHttpProxy.
|
Operation |
setUrlMapRegionTargetHttpProxy(SetUrlMapRegionTargetHttpProxyHttpRequest request)
Changes the URL map for TargetHttpProxy.
|
Operation |
setUrlMapRegionTargetHttpProxy(String targetHttpProxy,
UrlMapReference urlMapReferenceResource)
Changes the URL map for TargetHttpProxy.
|
com.google.api.gax.rpc.UnaryCallable<SetUrlMapRegionTargetHttpProxyHttpRequest,Operation> |
setUrlMapRegionTargetHttpProxyCallable()
Changes the URL map for TargetHttpProxy.
|
void |
shutdown() |
void |
shutdownNow() |
protected RegionTargetHttpProxyClient(RegionTargetHttpProxySettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected RegionTargetHttpProxyClient(RegionTargetHttpProxyStub stub)
public static final RegionTargetHttpProxyClient create() throws IOException
IOException
public static final RegionTargetHttpProxyClient create(RegionTargetHttpProxySettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final RegionTargetHttpProxyClient create(RegionTargetHttpProxyStub stub)
public final RegionTargetHttpProxySettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public RegionTargetHttpProxyStub getStub()
@BetaApi public final Operation deleteRegionTargetHttpProxy(ProjectRegionTargetHttpProxyName targetHttpProxy)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionTargetHttpProxyName targetHttpProxy = ProjectRegionTargetHttpProxyName.of("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
Operation response = regionTargetHttpProxyClient.deleteRegionTargetHttpProxy(targetHttpProxy);
}
targetHttpProxy
- Name of the TargetHttpProxy resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteRegionTargetHttpProxy(String targetHttpProxy)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionTargetHttpProxyName targetHttpProxy = ProjectRegionTargetHttpProxyName.of("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
Operation response = regionTargetHttpProxyClient.deleteRegionTargetHttpProxy(targetHttpProxy.toString());
}
targetHttpProxy
- Name of the TargetHttpProxy resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteRegionTargetHttpProxy(DeleteRegionTargetHttpProxyHttpRequest request)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedTargetHttpProxy = ProjectRegionTargetHttpProxyName.format("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
DeleteRegionTargetHttpProxyHttpRequest request = DeleteRegionTargetHttpProxyHttpRequest.newBuilder()
.setTargetHttpProxy(formattedTargetHttpProxy)
.build();
Operation response = regionTargetHttpProxyClient.deleteRegionTargetHttpProxy(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<DeleteRegionTargetHttpProxyHttpRequest,Operation> deleteRegionTargetHttpProxyCallable()
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedTargetHttpProxy = ProjectRegionTargetHttpProxyName.format("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
DeleteRegionTargetHttpProxyHttpRequest request = DeleteRegionTargetHttpProxyHttpRequest.newBuilder()
.setTargetHttpProxy(formattedTargetHttpProxy)
.build();
ApiFuture<Operation> future = regionTargetHttpProxyClient.deleteRegionTargetHttpProxyCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final TargetHttpProxy getRegionTargetHttpProxy(ProjectRegionTargetHttpProxyName targetHttpProxy)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionTargetHttpProxyName targetHttpProxy = ProjectRegionTargetHttpProxyName.of("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
TargetHttpProxy response = regionTargetHttpProxyClient.getRegionTargetHttpProxy(targetHttpProxy);
}
targetHttpProxy
- Name of the TargetHttpProxy resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final TargetHttpProxy getRegionTargetHttpProxy(String targetHttpProxy)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionTargetHttpProxyName targetHttpProxy = ProjectRegionTargetHttpProxyName.of("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
TargetHttpProxy response = regionTargetHttpProxyClient.getRegionTargetHttpProxy(targetHttpProxy.toString());
}
targetHttpProxy
- Name of the TargetHttpProxy resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final TargetHttpProxy getRegionTargetHttpProxy(GetRegionTargetHttpProxyHttpRequest request)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedTargetHttpProxy = ProjectRegionTargetHttpProxyName.format("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
GetRegionTargetHttpProxyHttpRequest request = GetRegionTargetHttpProxyHttpRequest.newBuilder()
.setTargetHttpProxy(formattedTargetHttpProxy)
.build();
TargetHttpProxy response = regionTargetHttpProxyClient.getRegionTargetHttpProxy(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<GetRegionTargetHttpProxyHttpRequest,TargetHttpProxy> getRegionTargetHttpProxyCallable()
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedTargetHttpProxy = ProjectRegionTargetHttpProxyName.format("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
GetRegionTargetHttpProxyHttpRequest request = GetRegionTargetHttpProxyHttpRequest.newBuilder()
.setTargetHttpProxy(formattedTargetHttpProxy)
.build();
ApiFuture<TargetHttpProxy> future = regionTargetHttpProxyClient.getRegionTargetHttpProxyCallable().futureCall(request);
// Do something
TargetHttpProxy response = future.get();
}
@BetaApi public final Operation insertRegionTargetHttpProxy(ProjectRegionName region, TargetHttpProxy targetHttpProxyResource)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
Operation response = regionTargetHttpProxyClient.insertRegionTargetHttpProxy(region, targetHttpProxyResource);
}
region
- Name of the region scoping this request.targetHttpProxyResource
- Represents a Target HTTP Proxy resource.
A target HTTP proxy is a component of certain types of load balancers. Global forwarding rules reference a target HTTP proxy, and the target proxy then references a URL map. For more information, read Using Target Proxies. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertRegionTargetHttpProxy(String region, TargetHttpProxy targetHttpProxyResource)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
Operation response = regionTargetHttpProxyClient.insertRegionTargetHttpProxy(region.toString(), targetHttpProxyResource);
}
region
- Name of the region scoping this request.targetHttpProxyResource
- Represents a Target HTTP Proxy resource.
A target HTTP proxy is a component of certain types of load balancers. Global forwarding rules reference a target HTTP proxy, and the target proxy then references a URL map. For more information, read Using Target Proxies. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertRegionTargetHttpProxy(InsertRegionTargetHttpProxyHttpRequest request)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
InsertRegionTargetHttpProxyHttpRequest request = InsertRegionTargetHttpProxyHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setTargetHttpProxyResource(targetHttpProxyResource)
.build();
Operation response = regionTargetHttpProxyClient.insertRegionTargetHttpProxy(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<InsertRegionTargetHttpProxyHttpRequest,Operation> insertRegionTargetHttpProxyCallable()
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
TargetHttpProxy targetHttpProxyResource = TargetHttpProxy.newBuilder().build();
InsertRegionTargetHttpProxyHttpRequest request = InsertRegionTargetHttpProxyHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setTargetHttpProxyResource(targetHttpProxyResource)
.build();
ApiFuture<Operation> future = regionTargetHttpProxyClient.insertRegionTargetHttpProxyCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPagedResponse listRegionTargetHttpProxies(ProjectRegionName region)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (TargetHttpProxy element : regionTargetHttpProxyClient.listRegionTargetHttpProxies(region).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region scoping this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPagedResponse listRegionTargetHttpProxies(String region)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (TargetHttpProxy element : regionTargetHttpProxyClient.listRegionTargetHttpProxies(region.toString()).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region scoping this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPagedResponse listRegionTargetHttpProxies(ListRegionTargetHttpProxiesHttpRequest request)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionTargetHttpProxiesHttpRequest request = ListRegionTargetHttpProxiesHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
for (TargetHttpProxy element : regionTargetHttpProxyClient.listRegionTargetHttpProxies(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<ListRegionTargetHttpProxiesHttpRequest,RegionTargetHttpProxyClient.ListRegionTargetHttpProxiesPagedResponse> listRegionTargetHttpProxiesPagedCallable()
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionTargetHttpProxiesHttpRequest request = ListRegionTargetHttpProxiesHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
ApiFuture<ListRegionTargetHttpProxiesPagedResponse> future = regionTargetHttpProxyClient.listRegionTargetHttpProxiesPagedCallable().futureCall(request);
// Do something
for (TargetHttpProxy element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListRegionTargetHttpProxiesHttpRequest,TargetHttpProxyList> listRegionTargetHttpProxiesCallable()
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionTargetHttpProxiesHttpRequest request = ListRegionTargetHttpProxiesHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
while (true) {
TargetHttpProxyList response = regionTargetHttpProxyClient.listRegionTargetHttpProxiesCallable().call(request);
for (TargetHttpProxy 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 setUrlMapRegionTargetHttpProxy(ProjectRegionTargetHttpProxyName targetHttpProxy, UrlMapReference urlMapReferenceResource)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionTargetHttpProxyName targetHttpProxy = ProjectRegionTargetHttpProxyName.of("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
Operation response = regionTargetHttpProxyClient.setUrlMapRegionTargetHttpProxy(targetHttpProxy, urlMapReferenceResource);
}
targetHttpProxy
- Name of the TargetHttpProxy to set a URL map for.urlMapReferenceResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation setUrlMapRegionTargetHttpProxy(String targetHttpProxy, UrlMapReference urlMapReferenceResource)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
ProjectRegionTargetHttpProxyName targetHttpProxy = ProjectRegionTargetHttpProxyName.of("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
Operation response = regionTargetHttpProxyClient.setUrlMapRegionTargetHttpProxy(targetHttpProxy.toString(), urlMapReferenceResource);
}
targetHttpProxy
- Name of the TargetHttpProxy to set a URL map for.urlMapReferenceResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation setUrlMapRegionTargetHttpProxy(SetUrlMapRegionTargetHttpProxyHttpRequest request)
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedTargetHttpProxy = ProjectRegionTargetHttpProxyName.format("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
SetUrlMapRegionTargetHttpProxyHttpRequest request = SetUrlMapRegionTargetHttpProxyHttpRequest.newBuilder()
.setTargetHttpProxy(formattedTargetHttpProxy)
.setUrlMapReferenceResource(urlMapReferenceResource)
.build();
Operation response = regionTargetHttpProxyClient.setUrlMapRegionTargetHttpProxy(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<SetUrlMapRegionTargetHttpProxyHttpRequest,Operation> setUrlMapRegionTargetHttpProxyCallable()
Sample code:
try (RegionTargetHttpProxyClient regionTargetHttpProxyClient = RegionTargetHttpProxyClient.create()) {
String formattedTargetHttpProxy = ProjectRegionTargetHttpProxyName.format("[PROJECT]", "[REGION]", "[TARGET_HTTP_PROXY]");
UrlMapReference urlMapReferenceResource = UrlMapReference.newBuilder().build();
SetUrlMapRegionTargetHttpProxyHttpRequest request = SetUrlMapRegionTargetHttpProxyHttpRequest.newBuilder()
.setTargetHttpProxy(formattedTargetHttpProxy)
.setUrlMapReferenceResource(urlMapReferenceResource)
.build();
ApiFuture<Operation> future = regionTargetHttpProxyClient.setUrlMapRegionTargetHttpProxyCallable().futureCall(request);
// Do something
Operation 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.