@Generated(value="by gapic-generator-java") public class UrlMapsClient 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
String urlMap = "urlMap-836780691";
UrlMap response = urlMapsClient.get(project, urlMap);
}
Note: close() needs to be called on the UrlMapsClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
AggregatedList |
Retrieves the list of all UrlMap resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Delete |
Deletes the specified UrlMap resource. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Get |
Returns the specified UrlMap resource. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Insert |
Creates a UrlMap resource in the specified project using the data included in the request. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
InvalidateCache |
Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. For more information, see [Invalidating cached content](/cdn/docs/invalidating-cached-content). |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
List |
Retrieves the list of UrlMap resources available to the specified project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Patch |
Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Update |
Updates the specified UrlMap resource with the data included in the request. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Validate |
Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of UrlMapsSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
UrlMapsSettings urlMapsSettings =
UrlMapsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
UrlMapsClient urlMapsClient = UrlMapsClient.create(urlMapsSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
UrlMapsSettings urlMapsSettings = UrlMapsSettings.newBuilder().setEndpoint(myEndpoint).build();
UrlMapsClient urlMapsClient = UrlMapsClient.create(urlMapsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
UrlMapsClient.AggregatedListFixedSizeCollection |
static class |
UrlMapsClient.AggregatedListPage |
static class |
UrlMapsClient.AggregatedListPagedResponse |
static class |
UrlMapsClient.ListFixedSizeCollection |
static class |
UrlMapsClient.ListPage |
static class |
UrlMapsClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
UrlMapsClient(UrlMapsSettings settings)
Constructs an instance of UrlMapsClient, using the given settings.
|
protected |
UrlMapsClient(UrlMapsStub stub) |
| Modifier and Type | Method and Description |
|---|---|
UrlMapsClient.AggregatedListPagedResponse |
aggregatedList(AggregatedListUrlMapsRequest request)
Retrieves the list of all UrlMap resources, regional and global, available to the specified
project.
|
UrlMapsClient.AggregatedListPagedResponse |
aggregatedList(String project)
Retrieves the list of all UrlMap resources, regional and global, available to the specified
project.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListUrlMapsRequest,UrlMapsAggregatedList> |
aggregatedListCallable()
Retrieves the list of all UrlMap resources, regional and global, available to the specified
project.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListUrlMapsRequest,UrlMapsClient.AggregatedListPagedResponse> |
aggregatedListPagedCallable()
Retrieves the list of all UrlMap resources, regional and global, available to the specified
project.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static UrlMapsClient |
create()
Constructs an instance of UrlMapsClient with default settings.
|
static UrlMapsClient |
create(UrlMapsSettings settings)
Constructs an instance of UrlMapsClient, using the given settings.
|
static UrlMapsClient |
create(UrlMapsStub stub)
Constructs an instance of UrlMapsClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteUrlMapRequest request)
Deletes the specified UrlMap resource.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String project,
String urlMap)
Deletes the specified UrlMap resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteUrlMapRequest,Operation> |
deleteCallable()
Deletes the specified UrlMap resource.
|
com.google.api.gax.rpc.OperationCallable<DeleteUrlMapRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified UrlMap resource.
|
UrlMap |
get(GetUrlMapRequest request)
Returns the specified UrlMap resource.
|
UrlMap |
get(String project,
String urlMap)
Returns the specified UrlMap resource.
|
com.google.api.gax.rpc.UnaryCallable<GetUrlMapRequest,UrlMap> |
getCallable()
Returns the specified UrlMap resource.
|
UrlMapsSettings |
getSettings() |
UrlMapsStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertUrlMapRequest request)
Creates a UrlMap resource in the specified project using the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(String project,
UrlMap urlMapResource)
Creates a UrlMap resource in the specified project using the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertUrlMapRequest,Operation> |
insertCallable()
Creates a UrlMap resource in the specified project using the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<InsertUrlMapRequest,Operation,Operation> |
insertOperationCallable()
Creates a UrlMap resource in the specified project using the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
invalidateCacheAsync(InvalidateCacheUrlMapRequest request)
Initiates a cache invalidation operation, invalidating the specified path, scoped to the
specified UrlMap.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
invalidateCacheAsync(String project,
String urlMap,
CacheInvalidationRule cacheInvalidationRuleResource)
Initiates a cache invalidation operation, invalidating the specified path, scoped to the
specified UrlMap.
|
com.google.api.gax.rpc.UnaryCallable<InvalidateCacheUrlMapRequest,Operation> |
invalidateCacheCallable()
Initiates a cache invalidation operation, invalidating the specified path, scoped to the
specified UrlMap.
|
com.google.api.gax.rpc.OperationCallable<InvalidateCacheUrlMapRequest,Operation,Operation> |
invalidateCacheOperationCallable()
Initiates a cache invalidation operation, invalidating the specified path, scoped to the
specified UrlMap.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
UrlMapsClient.ListPagedResponse |
list(ListUrlMapsRequest request)
Retrieves the list of UrlMap resources available to the specified project.
|
UrlMapsClient.ListPagedResponse |
list(String project)
Retrieves the list of UrlMap resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListUrlMapsRequest,UrlMapList> |
listCallable()
Retrieves the list of UrlMap resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListUrlMapsRequest,UrlMapsClient.ListPagedResponse> |
listPagedCallable()
Retrieves the list of UrlMap resources available to the specified project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(PatchUrlMapRequest request)
Patches the specified UrlMap resource with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(String project,
String urlMap,
UrlMap urlMapResource)
Patches the specified UrlMap resource with the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<PatchUrlMapRequest,Operation> |
patchCallable()
Patches the specified UrlMap resource with the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<PatchUrlMapRequest,Operation,Operation> |
patchOperationCallable()
Patches the specified UrlMap resource with the data included in the request.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateAsync(String project,
String urlMap,
UrlMap urlMapResource)
Updates the specified UrlMap resource with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
updateAsync(UpdateUrlMapRequest request)
Updates the specified UrlMap resource with the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<UpdateUrlMapRequest,Operation> |
updateCallable()
Updates the specified UrlMap resource with the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<UpdateUrlMapRequest,Operation,Operation> |
updateOperationCallable()
Updates the specified UrlMap resource with the data included in the request.
|
UrlMapsValidateResponse |
validate(String project,
String urlMap,
UrlMapsValidateRequest urlMapsValidateRequestResource)
Runs static validation for the UrlMap.
|
UrlMapsValidateResponse |
validate(ValidateUrlMapRequest request)
Runs static validation for the UrlMap.
|
com.google.api.gax.rpc.UnaryCallable<ValidateUrlMapRequest,UrlMapsValidateResponse> |
validateCallable()
Runs static validation for the UrlMap.
|
protected UrlMapsClient(UrlMapsSettings settings) throws IOException
IOExceptionprotected UrlMapsClient(UrlMapsStub stub)
public static final UrlMapsClient create() throws IOException
IOExceptionpublic static final UrlMapsClient create(UrlMapsSettings settings) throws IOException
IOExceptionpublic static final UrlMapsClient create(UrlMapsStub stub)
public final UrlMapsSettings getSettings()
public UrlMapsStub getStub()
public final UrlMapsClient.AggregatedListPagedResponse aggregatedList(String project)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
for (Map.Entry<String, UrlMapsScopedList> element :
urlMapsClient.aggregatedList(project).iterateAll()) {
// doThingsWith(element);
}
}
project - Name of the project scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final UrlMapsClient.AggregatedListPagedResponse aggregatedList(AggregatedListUrlMapsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
AggregatedListUrlMapsRequest request =
AggregatedListUrlMapsRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
for (Map.Entry<String, UrlMapsScopedList> element :
urlMapsClient.aggregatedList(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 failspublic final com.google.api.gax.rpc.UnaryCallable<AggregatedListUrlMapsRequest,UrlMapsClient.AggregatedListPagedResponse> aggregatedListPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
AggregatedListUrlMapsRequest request =
AggregatedListUrlMapsRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
ApiFuture<Map.Entry<String, UrlMapsScopedList>> future =
urlMapsClient.aggregatedListPagedCallable().futureCall(request);
// Do something.
for (Map.Entry<String, UrlMapsScopedList> element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<AggregatedListUrlMapsRequest,UrlMapsAggregatedList> aggregatedListCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
AggregatedListUrlMapsRequest request =
AggregatedListUrlMapsRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
while (true) {
UrlMapsAggregatedList response = urlMapsClient.aggregatedListCallable().call(request);
for (Map.Entry<String, UrlMapsScopedList> element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String project, String urlMap)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
String urlMap = "urlMap-836780691";
Operation response = urlMapsClient.deleteAsync(project, urlMap).get();
}
project - Project ID for this request.urlMap - Name of the UrlMap resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteUrlMapRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
DeleteUrlMapRequest request =
DeleteUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.build();
Operation response = urlMapsClient.deleteAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteUrlMapRequest,Operation,Operation> deleteOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
DeleteUrlMapRequest request =
DeleteUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.build();
OperationFuture<Operation, Operation> future =
urlMapsClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteUrlMapRequest,Operation> deleteCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
DeleteUrlMapRequest request =
DeleteUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.build();
ApiFuture<Operation> future = urlMapsClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final UrlMap get(String project, String urlMap)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
String urlMap = "urlMap-836780691";
UrlMap response = urlMapsClient.get(project, urlMap);
}
project - Project ID for this request.urlMap - Name of the UrlMap resource to return.com.google.api.gax.rpc.ApiException - if the remote call failspublic final UrlMap get(GetUrlMapRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
GetUrlMapRequest request =
GetUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setUrlMap("urlMap-836780691")
.build();
UrlMap response = urlMapsClient.get(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetUrlMapRequest,UrlMap> getCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
GetUrlMapRequest request =
GetUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setUrlMap("urlMap-836780691")
.build();
ApiFuture<UrlMap> future = urlMapsClient.getCallable().futureCall(request);
// Do something.
UrlMap response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String project, UrlMap urlMapResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
UrlMap urlMapResource = UrlMap.newBuilder().build();
Operation response = urlMapsClient.insertAsync(project, urlMapResource).get();
}
project - Project ID for this request.urlMapResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertUrlMapRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
InsertUrlMapRequest request =
InsertUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMapResource(UrlMap.newBuilder().build())
.build();
Operation response = urlMapsClient.insertAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<InsertUrlMapRequest,Operation,Operation> insertOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
InsertUrlMapRequest request =
InsertUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMapResource(UrlMap.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
urlMapsClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertUrlMapRequest,Operation> insertCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
InsertUrlMapRequest request =
InsertUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMapResource(UrlMap.newBuilder().build())
.build();
ApiFuture<Operation> future = urlMapsClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> invalidateCacheAsync(String project, String urlMap, CacheInvalidationRule cacheInvalidationRuleResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
String urlMap = "urlMap-836780691";
CacheInvalidationRule cacheInvalidationRuleResource =
CacheInvalidationRule.newBuilder().build();
Operation response =
urlMapsClient.invalidateCacheAsync(project, urlMap, cacheInvalidationRuleResource).get();
}
project - Project ID for this request.urlMap - Name of the UrlMap scoping this request.cacheInvalidationRuleResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> invalidateCacheAsync(InvalidateCacheUrlMapRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
InvalidateCacheUrlMapRequest request =
InvalidateCacheUrlMapRequest.newBuilder()
.setCacheInvalidationRuleResource(CacheInvalidationRule.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.build();
Operation response = urlMapsClient.invalidateCacheAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<InvalidateCacheUrlMapRequest,Operation,Operation> invalidateCacheOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
InvalidateCacheUrlMapRequest request =
InvalidateCacheUrlMapRequest.newBuilder()
.setCacheInvalidationRuleResource(CacheInvalidationRule.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.build();
OperationFuture<Operation, Operation> future =
urlMapsClient.invalidateCacheOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<InvalidateCacheUrlMapRequest,Operation> invalidateCacheCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
InvalidateCacheUrlMapRequest request =
InvalidateCacheUrlMapRequest.newBuilder()
.setCacheInvalidationRuleResource(CacheInvalidationRule.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.build();
ApiFuture<Operation> future = urlMapsClient.invalidateCacheCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final UrlMapsClient.ListPagedResponse list(String project)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
for (UrlMap element : urlMapsClient.list(project).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final UrlMapsClient.ListPagedResponse list(ListUrlMapsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
ListUrlMapsRequest request =
ListUrlMapsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
for (UrlMap element : urlMapsClient.list(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 failspublic final com.google.api.gax.rpc.UnaryCallable<ListUrlMapsRequest,UrlMapsClient.ListPagedResponse> listPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
ListUrlMapsRequest request =
ListUrlMapsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
ApiFuture<UrlMap> future = urlMapsClient.listPagedCallable().futureCall(request);
// Do something.
for (UrlMap element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListUrlMapsRequest,UrlMapList> listCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
ListUrlMapsRequest request =
ListUrlMapsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
while (true) {
UrlMapList response = urlMapsClient.listCallable().call(request);
for (UrlMap element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(String project, String urlMap, UrlMap urlMapResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
String urlMap = "urlMap-836780691";
UrlMap urlMapResource = UrlMap.newBuilder().build();
Operation response = urlMapsClient.patchAsync(project, urlMap, urlMapResource).get();
}
project - Project ID for this request.urlMap - Name of the UrlMap resource to patch.urlMapResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(PatchUrlMapRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
PatchUrlMapRequest request =
PatchUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.setUrlMapResource(UrlMap.newBuilder().build())
.build();
Operation response = urlMapsClient.patchAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<PatchUrlMapRequest,Operation,Operation> patchOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
PatchUrlMapRequest request =
PatchUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.setUrlMapResource(UrlMap.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
urlMapsClient.patchOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<PatchUrlMapRequest,Operation> patchCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
PatchUrlMapRequest request =
PatchUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.setUrlMapResource(UrlMap.newBuilder().build())
.build();
ApiFuture<Operation> future = urlMapsClient.patchCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateAsync(String project, String urlMap, UrlMap urlMapResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
String urlMap = "urlMap-836780691";
UrlMap urlMapResource = UrlMap.newBuilder().build();
Operation response = urlMapsClient.updateAsync(project, urlMap, urlMapResource).get();
}
project - Project ID for this request.urlMap - Name of the UrlMap resource to update.urlMapResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateAsync(UpdateUrlMapRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
UpdateUrlMapRequest request =
UpdateUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.setUrlMapResource(UrlMap.newBuilder().build())
.build();
Operation response = urlMapsClient.updateAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateUrlMapRequest,Operation,Operation> updateOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
UpdateUrlMapRequest request =
UpdateUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.setUrlMapResource(UrlMap.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
urlMapsClient.updateOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateUrlMapRequest,Operation> updateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
UpdateUrlMapRequest request =
UpdateUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUrlMap("urlMap-836780691")
.setUrlMapResource(UrlMap.newBuilder().build())
.build();
ApiFuture<Operation> future = urlMapsClient.updateCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final UrlMapsValidateResponse validate(String project, String urlMap, UrlMapsValidateRequest urlMapsValidateRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
String project = "project-309310695";
String urlMap = "urlMap-836780691";
UrlMapsValidateRequest urlMapsValidateRequestResource =
UrlMapsValidateRequest.newBuilder().build();
UrlMapsValidateResponse response =
urlMapsClient.validate(project, urlMap, urlMapsValidateRequestResource);
}
project - Project ID for this request.urlMap - Name of the UrlMap resource to be validated as.urlMapsValidateRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final UrlMapsValidateResponse validate(ValidateUrlMapRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
ValidateUrlMapRequest request =
ValidateUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setUrlMap("urlMap-836780691")
.setUrlMapsValidateRequestResource(UrlMapsValidateRequest.newBuilder().build())
.build();
UrlMapsValidateResponse response = urlMapsClient.validate(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ValidateUrlMapRequest,UrlMapsValidateResponse> validateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (UrlMapsClient urlMapsClient = UrlMapsClient.create()) {
ValidateUrlMapRequest request =
ValidateUrlMapRequest.newBuilder()
.setProject("project-309310695")
.setUrlMap("urlMap-836780691")
.setUrlMapsValidateRequestResource(UrlMapsValidateRequest.newBuilder().build())
.build();
ApiFuture<UrlMapsValidateResponse> future =
urlMapsClient.validateCallable().futureCall(request);
// Do something.
UrlMapsValidateResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.