Class BackendServicesClient
- java.lang.Object
-
- com.google.cloud.compute.v1.BackendServicesClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class BackendServicesClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: The BackendServices API.This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; BackendService response = backendServicesClient.get(project, backendService); }
Note: close() needs to be called on the BackendServicesClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of BackendServicesSettings 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 BackendServicesSettings backendServicesSettings = BackendServicesSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); BackendServicesClient backendServicesClient = BackendServicesClient.create(backendServicesSettings);
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 BackendServicesSettings backendServicesSettings = BackendServicesSettings.newBuilder().setEndpoint(myEndpoint).build(); BackendServicesClient backendServicesClient = BackendServicesClient.create(backendServicesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BackendServicesClient.AggregatedListFixedSizeCollection
static class
BackendServicesClient.AggregatedListPage
static class
BackendServicesClient.AggregatedListPagedResponse
static class
BackendServicesClient.ListFixedSizeCollection
static class
BackendServicesClient.ListPage
static class
BackendServicesClient.ListPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
BackendServicesClient(BackendServicesSettings settings)
Constructs an instance of BackendServicesClient, using the given settings.protected
BackendServicesClient(BackendServicesStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
addSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request)
Adds a key for validating requests with signed URLs for this backend service.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
addSignedUrlKeyAsync(String project, String backendService, SignedUrlKey signedUrlKeyResource)
Adds a key for validating requests with signed URLs for this backend service.com.google.api.gax.rpc.UnaryCallable<AddSignedUrlKeyBackendServiceRequest,Operation>
addSignedUrlKeyCallable()
Adds a key for validating requests with signed URLs for this backend service.com.google.api.gax.rpc.OperationCallable<AddSignedUrlKeyBackendServiceRequest,Operation,Operation>
addSignedUrlKeyOperationCallable()
Adds a key for validating requests with signed URLs for this backend service.BackendServicesClient.AggregatedListPagedResponse
aggregatedList(AggregatedListBackendServicesRequest request)
Retrieves the list of all BackendService resources, regional and global, available to the specified project.BackendServicesClient.AggregatedListPagedResponse
aggregatedList(String project)
Retrieves the list of all BackendService resources, regional and global, available to the specified project.com.google.api.gax.rpc.UnaryCallable<AggregatedListBackendServicesRequest,BackendServiceAggregatedList>
aggregatedListCallable()
Retrieves the list of all BackendService resources, regional and global, available to the specified project.com.google.api.gax.rpc.UnaryCallable<AggregatedListBackendServicesRequest,BackendServicesClient.AggregatedListPagedResponse>
aggregatedListPagedCallable()
Retrieves the list of all BackendService resources, regional and global, available to the specified project.boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static BackendServicesClient
create()
Constructs an instance of BackendServicesClient with default settings.static BackendServicesClient
create(BackendServicesSettings settings)
Constructs an instance of BackendServicesClient, using the given settings.static BackendServicesClient
create(BackendServicesStub stub)
Constructs an instance of BackendServicesClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
deleteAsync(DeleteBackendServiceRequest request)
Deletes the specified BackendService resource.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
deleteAsync(String project, String backendService)
Deletes the specified BackendService resource.com.google.api.gax.rpc.UnaryCallable<DeleteBackendServiceRequest,Operation>
deleteCallable()
Deletes the specified BackendService resource.com.google.api.gax.rpc.OperationCallable<DeleteBackendServiceRequest,Operation,Operation>
deleteOperationCallable()
Deletes the specified BackendService resource.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
deleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request)
Deletes a key for validating requests with signed URLs for this backend service.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
deleteSignedUrlKeyAsync(String project, String backendService, String keyName)
Deletes a key for validating requests with signed URLs for this backend service.com.google.api.gax.rpc.UnaryCallable<DeleteSignedUrlKeyBackendServiceRequest,Operation>
deleteSignedUrlKeyCallable()
Deletes a key for validating requests with signed URLs for this backend service.com.google.api.gax.rpc.OperationCallable<DeleteSignedUrlKeyBackendServiceRequest,Operation,Operation>
deleteSignedUrlKeyOperationCallable()
Deletes a key for validating requests with signed URLs for this backend service.BackendService
get(GetBackendServiceRequest request)
Returns the specified BackendService resource.BackendService
get(String project, String backendService)
Returns the specified BackendService resource.com.google.api.gax.rpc.UnaryCallable<GetBackendServiceRequest,BackendService>
getCallable()
Returns the specified BackendService resource.BackendServiceGroupHealth
getHealth(GetHealthBackendServiceRequest request)
Gets the most recent health check results for this BackendService.BackendServiceGroupHealth
getHealth(String project, String backendService, ResourceGroupReference resourceGroupReferenceResource)
Gets the most recent health check results for this BackendService.com.google.api.gax.rpc.UnaryCallable<GetHealthBackendServiceRequest,BackendServiceGroupHealth>
getHealthCallable()
Gets the most recent health check results for this BackendService.Policy
getIamPolicy(GetIamPolicyBackendServiceRequest request)
Gets the access control policy for a resource.Policy
getIamPolicy(String project, String resource)
Gets the access control policy for a resource.com.google.api.gax.rpc.UnaryCallable<GetIamPolicyBackendServiceRequest,Policy>
getIamPolicyCallable()
Gets the access control policy for a resource.BackendServicesSettings
getSettings()
BackendServicesStub
getStub()
com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
insertAsync(InsertBackendServiceRequest request)
Creates a BackendService resource in the specified project using the data included in the request.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
insertAsync(String project, BackendService backendServiceResource)
Creates a BackendService resource in the specified project using the data included in the request.com.google.api.gax.rpc.UnaryCallable<InsertBackendServiceRequest,Operation>
insertCallable()
Creates a BackendService resource in the specified project using the data included in the request.com.google.api.gax.rpc.OperationCallable<InsertBackendServiceRequest,Operation,Operation>
insertOperationCallable()
Creates a BackendService resource in the specified project using the data included in the request.boolean
isShutdown()
boolean
isTerminated()
BackendServicesClient.ListPagedResponse
list(ListBackendServicesRequest request)
Retrieves the list of BackendService resources available to the specified project.BackendServicesClient.ListPagedResponse
list(String project)
Retrieves the list of BackendService resources available to the specified project.com.google.api.gax.rpc.UnaryCallable<ListBackendServicesRequest,BackendServiceList>
listCallable()
Retrieves the list of BackendService resources available to the specified project.com.google.api.gax.rpc.UnaryCallable<ListBackendServicesRequest,BackendServicesClient.ListPagedResponse>
listPagedCallable()
Retrieves the list of BackendService resources available to the specified project.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
patchAsync(PatchBackendServiceRequest request)
Patches the specified BackendService resource with the data included in the request.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
patchAsync(String project, String backendService, BackendService backendServiceResource)
Patches the specified BackendService resource with the data included in the request.com.google.api.gax.rpc.UnaryCallable<PatchBackendServiceRequest,Operation>
patchCallable()
Patches the specified BackendService resource with the data included in the request.com.google.api.gax.rpc.OperationCallable<PatchBackendServiceRequest,Operation,Operation>
patchOperationCallable()
Patches the specified BackendService resource with the data included in the request.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
setEdgeSecurityPolicyAsync(SetEdgeSecurityPolicyBackendServiceRequest request)
Sets the edge security policy for the specified backend service.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
setEdgeSecurityPolicyAsync(String project, String backendService, SecurityPolicyReference securityPolicyReferenceResource)
Sets the edge security policy for the specified backend service.com.google.api.gax.rpc.UnaryCallable<SetEdgeSecurityPolicyBackendServiceRequest,Operation>
setEdgeSecurityPolicyCallable()
Sets the edge security policy for the specified backend service.com.google.api.gax.rpc.OperationCallable<SetEdgeSecurityPolicyBackendServiceRequest,Operation,Operation>
setEdgeSecurityPolicyOperationCallable()
Sets the edge security policy for the specified backend service.Policy
setIamPolicy(SetIamPolicyBackendServiceRequest request)
Sets the access control policy on the specified resource.Policy
setIamPolicy(String project, String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource)
Sets the access control policy on the specified resource.com.google.api.gax.rpc.UnaryCallable<SetIamPolicyBackendServiceRequest,Policy>
setIamPolicyCallable()
Sets the access control policy on the specified resource.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
setSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest request)
Sets the Google Cloud Armor security policy for the specified backend service.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
setSecurityPolicyAsync(String project, String backendService, SecurityPolicyReference securityPolicyReferenceResource)
Sets the Google Cloud Armor security policy for the specified backend service.com.google.api.gax.rpc.UnaryCallable<SetSecurityPolicyBackendServiceRequest,Operation>
setSecurityPolicyCallable()
Sets the Google Cloud Armor security policy for the specified backend service.com.google.api.gax.rpc.OperationCallable<SetSecurityPolicyBackendServiceRequest,Operation,Operation>
setSecurityPolicyOperationCallable()
Sets the Google Cloud Armor security policy for the specified backend service.void
shutdown()
void
shutdownNow()
com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
updateAsync(UpdateBackendServiceRequest request)
Updates the specified BackendService resource with the data included in the request.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
updateAsync(String project, String backendService, BackendService backendServiceResource)
Updates the specified BackendService resource with the data included in the request.com.google.api.gax.rpc.UnaryCallable<UpdateBackendServiceRequest,Operation>
updateCallable()
Updates the specified BackendService resource with the data included in the request.com.google.api.gax.rpc.OperationCallable<UpdateBackendServiceRequest,Operation,Operation>
updateOperationCallable()
Updates the specified BackendService resource with the data included in the request.
-
-
-
Constructor Detail
-
BackendServicesClient
protected BackendServicesClient(BackendServicesSettings settings) throws IOException
Constructs an instance of BackendServicesClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
BackendServicesClient
protected BackendServicesClient(BackendServicesStub stub)
-
-
Method Detail
-
create
public static final BackendServicesClient create() throws IOException
Constructs an instance of BackendServicesClient with default settings.- Throws:
IOException
-
create
public static final BackendServicesClient create(BackendServicesSettings settings) throws IOException
Constructs an instance of BackendServicesClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final BackendServicesClient create(BackendServicesStub stub)
Constructs an instance of BackendServicesClient, using the given stub for making calls. This is for advanced usage - prefer using create(BackendServicesSettings).
-
getSettings
public final BackendServicesSettings getSettings()
-
getStub
public BackendServicesStub getStub()
-
addSignedUrlKeyAsync
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addSignedUrlKeyAsync(String project, String backendService, SignedUrlKey signedUrlKeyResource)
Adds a key for validating requests with signed URLs for this backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; SignedUrlKey signedUrlKeyResource = SignedUrlKey.newBuilder().build(); Operation response = backendServicesClient .addSignedUrlKeyAsync(project, backendService, signedUrlKeyResource) .get(); }
- Parameters:
project
- Project ID for this request.backendService
- Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.signedUrlKeyResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
addSignedUrlKeyAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request)
Adds a key for validating requests with signed URLs for this backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { AddSignedUrlKeyBackendServiceRequest request = AddSignedUrlKeyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build()) .build(); Operation response = backendServicesClient.addSignedUrlKeyAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
addSignedUrlKeyOperationCallable
public final com.google.api.gax.rpc.OperationCallable<AddSignedUrlKeyBackendServiceRequest,Operation,Operation> addSignedUrlKeyOperationCallable()
Adds a key for validating requests with signed URLs for this backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { AddSignedUrlKeyBackendServiceRequest request = AddSignedUrlKeyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build()) .build(); OperationFuture<Operation, Operation> future = backendServicesClient.addSignedUrlKeyOperationCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
addSignedUrlKeyCallable
public final com.google.api.gax.rpc.UnaryCallable<AddSignedUrlKeyBackendServiceRequest,Operation> addSignedUrlKeyCallable()
Adds a key for validating requests with signed URLs for this backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { AddSignedUrlKeyBackendServiceRequest request = AddSignedUrlKeyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build()) .build(); ApiFuture<Operation> future = backendServicesClient.addSignedUrlKeyCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
aggregatedList
public final BackendServicesClient.AggregatedListPagedResponse aggregatedList(String project)
Retrieves the list of all BackendService resources, regional and global, available to the specified 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; for (Map.Entry<String, BackendServicesScopedList> element : backendServicesClient.aggregatedList(project).iterateAll()) { // doThingsWith(element); } }
- Parameters:
project
- Name of the project scoping this request.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
aggregatedList
public final BackendServicesClient.AggregatedListPagedResponse aggregatedList(AggregatedListBackendServicesRequest request)
Retrieves the list of all BackendService resources, regional and global, available to the specified 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { AggregatedListBackendServicesRequest request = AggregatedListBackendServicesRequest.newBuilder() .setFilter("filter-1274492040") .setIncludeAllScopes(true) .setMaxResults(1128457243) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .setProject("project-309310695") .setReturnPartialSuccess(true) .build(); for (Map.Entry<String, BackendServicesScopedList> element : backendServicesClient.aggregatedList(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
aggregatedListPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<AggregatedListBackendServicesRequest,BackendServicesClient.AggregatedListPagedResponse> aggregatedListPagedCallable()
Retrieves the list of all BackendService resources, regional and global, available to the specified 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { AggregatedListBackendServicesRequest request = AggregatedListBackendServicesRequest.newBuilder() .setFilter("filter-1274492040") .setIncludeAllScopes(true) .setMaxResults(1128457243) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .setProject("project-309310695") .setReturnPartialSuccess(true) .build(); ApiFuture<Map.Entry<String, BackendServicesScopedList>> future = backendServicesClient.aggregatedListPagedCallable().futureCall(request); // Do something. for (Map.Entry<String, BackendServicesScopedList> element : future.get().iterateAll()) { // doThingsWith(element); } }
-
aggregatedListCallable
public final com.google.api.gax.rpc.UnaryCallable<AggregatedListBackendServicesRequest,BackendServiceAggregatedList> aggregatedListCallable()
Retrieves the list of all BackendService resources, regional and global, available to the specified 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { AggregatedListBackendServicesRequest request = AggregatedListBackendServicesRequest.newBuilder() .setFilter("filter-1274492040") .setIncludeAllScopes(true) .setMaxResults(1128457243) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .setProject("project-309310695") .setReturnPartialSuccess(true) .build(); while (true) { BackendServiceAggregatedList response = backendServicesClient.aggregatedListCallable().call(request); for (Map.Entry<String, BackendServicesScopedList> element : response.getItemsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
deleteAsync
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String project, String backendService)
Deletes the specified BackendService resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; Operation response = backendServicesClient.deleteAsync(project, backendService).get(); }
- Parameters:
project
- Project ID for this request.backendService
- Name of the BackendService resource to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteBackendServiceRequest request)
Deletes the specified BackendService resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { DeleteBackendServiceRequest request = DeleteBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .build(); Operation response = backendServicesClient.deleteAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteBackendServiceRequest,Operation,Operation> deleteOperationCallable()
Deletes the specified BackendService resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { DeleteBackendServiceRequest request = DeleteBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .build(); OperationFuture<Operation, Operation> future = backendServicesClient.deleteOperationCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteBackendServiceRequest,Operation> deleteCallable()
Deletes the specified BackendService resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { DeleteBackendServiceRequest request = DeleteBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backendServicesClient.deleteCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteSignedUrlKeyAsync
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteSignedUrlKeyAsync(String project, String backendService, String keyName)
Deletes a key for validating requests with signed URLs for this backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; String keyName = "keyName-815643254"; Operation response = backendServicesClient.deleteSignedUrlKeyAsync(project, backendService, keyName).get(); }
- Parameters:
project
- Project ID for this request.backendService
- Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.keyName
- The name of the Signed URL Key to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteSignedUrlKeyAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request)
Deletes a key for validating requests with signed URLs for this backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { DeleteSignedUrlKeyBackendServiceRequest request = DeleteSignedUrlKeyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setKeyName("keyName-815643254") .setProject("project-309310695") .setRequestId("requestId693933066") .build(); Operation response = backendServicesClient.deleteSignedUrlKeyAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteSignedUrlKeyOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteSignedUrlKeyBackendServiceRequest,Operation,Operation> deleteSignedUrlKeyOperationCallable()
Deletes a key for validating requests with signed URLs for this backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { DeleteSignedUrlKeyBackendServiceRequest request = DeleteSignedUrlKeyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setKeyName("keyName-815643254") .setProject("project-309310695") .setRequestId("requestId693933066") .build(); OperationFuture<Operation, Operation> future = backendServicesClient.deleteSignedUrlKeyOperationCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteSignedUrlKeyCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteSignedUrlKeyBackendServiceRequest,Operation> deleteSignedUrlKeyCallable()
Deletes a key for validating requests with signed URLs for this backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { DeleteSignedUrlKeyBackendServiceRequest request = DeleteSignedUrlKeyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setKeyName("keyName-815643254") .setProject("project-309310695") .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backendServicesClient.deleteSignedUrlKeyCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
get
public final BackendService get(String project, String backendService)
Returns the specified BackendService resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; BackendService response = backendServicesClient.get(project, backendService); }
- Parameters:
project
- Project ID for this request.backendService
- Name of the BackendService resource to return.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
get
public final BackendService get(GetBackendServiceRequest request)
Returns the specified BackendService resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { GetBackendServiceRequest request = GetBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .build(); BackendService response = backendServicesClient.get(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getCallable
public final com.google.api.gax.rpc.UnaryCallable<GetBackendServiceRequest,BackendService> getCallable()
Returns the specified BackendService resource.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { GetBackendServiceRequest request = GetBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .build(); ApiFuture<BackendService> future = backendServicesClient.getCallable().futureCall(request); // Do something. BackendService response = future.get(); }
-
getHealth
public final BackendServiceGroupHealth getHealth(String project, String backendService, ResourceGroupReference resourceGroupReferenceResource)
Gets the most recent health check results for this BackendService. Example request body: { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" }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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build(); BackendServiceGroupHealth response = backendServicesClient.getHealth(project, backendService, resourceGroupReferenceResource); }
- Parameters:
project
-backendService
- Name of the BackendService resource to which the queried instance belongs.resourceGroupReferenceResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getHealth
public final BackendServiceGroupHealth getHealth(GetHealthBackendServiceRequest request)
Gets the most recent health check results for this BackendService. Example request body: { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" }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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { GetHealthBackendServiceRequest request = GetHealthBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setResourceGroupReferenceResource(ResourceGroupReference.newBuilder().build()) .build(); BackendServiceGroupHealth response = backendServicesClient.getHealth(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getHealthCallable
public final com.google.api.gax.rpc.UnaryCallable<GetHealthBackendServiceRequest,BackendServiceGroupHealth> getHealthCallable()
Gets the most recent health check results for this BackendService. Example request body: { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" }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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { GetHealthBackendServiceRequest request = GetHealthBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setResourceGroupReferenceResource(ResourceGroupReference.newBuilder().build()) .build(); ApiFuture<BackendServiceGroupHealth> future = backendServicesClient.getHealthCallable().futureCall(request); // Do something. BackendServiceGroupHealth response = future.get(); }
-
getIamPolicy
public final Policy getIamPolicy(String project, String resource)
Gets the access control policy for a resource. May be empty if no such policy or resource exists.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String resource = "resource-341064690"; Policy response = backendServicesClient.getIamPolicy(project, resource); }
- Parameters:
project
- Project ID for this request.resource
- Name or id of the resource for this request.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getIamPolicy
public final Policy getIamPolicy(GetIamPolicyBackendServiceRequest request)
Gets the access control policy for a resource. May be empty if no such policy or resource exists.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { GetIamPolicyBackendServiceRequest request = GetIamPolicyBackendServiceRequest.newBuilder() .setOptionsRequestedPolicyVersion(-574521795) .setProject("project-309310695") .setResource("resource-341064690") .build(); Policy response = backendServicesClient.getIamPolicy(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<GetIamPolicyBackendServiceRequest,Policy> getIamPolicyCallable()
Gets the access control policy for a resource. May be empty if no such policy or resource exists.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { GetIamPolicyBackendServiceRequest request = GetIamPolicyBackendServiceRequest.newBuilder() .setOptionsRequestedPolicyVersion(-574521795) .setProject("project-309310695") .setResource("resource-341064690") .build(); ApiFuture<Policy> future = backendServicesClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); }
-
insertAsync
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String project, BackendService backendServiceResource)
Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview .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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; BackendService backendServiceResource = BackendService.newBuilder().build(); Operation response = backendServicesClient.insertAsync(project, backendServiceResource).get(); }
- Parameters:
project
- Project ID for this request.backendServiceResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
insertAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertBackendServiceRequest request)
Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview .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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { InsertBackendServiceRequest request = InsertBackendServiceRequest.newBuilder() .setBackendServiceResource(BackendService.newBuilder().build()) .setProject("project-309310695") .setRequestId("requestId693933066") .build(); Operation response = backendServicesClient.insertAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
insertOperationCallable
public final com.google.api.gax.rpc.OperationCallable<InsertBackendServiceRequest,Operation,Operation> insertOperationCallable()
Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview .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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { InsertBackendServiceRequest request = InsertBackendServiceRequest.newBuilder() .setBackendServiceResource(BackendService.newBuilder().build()) .setProject("project-309310695") .setRequestId("requestId693933066") .build(); OperationFuture<Operation, Operation> future = backendServicesClient.insertOperationCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
insertCallable
public final com.google.api.gax.rpc.UnaryCallable<InsertBackendServiceRequest,Operation> insertCallable()
Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview .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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { InsertBackendServiceRequest request = InsertBackendServiceRequest.newBuilder() .setBackendServiceResource(BackendService.newBuilder().build()) .setProject("project-309310695") .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backendServicesClient.insertCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
list
public final BackendServicesClient.ListPagedResponse list(String project)
Retrieves the list of BackendService resources available to the specified 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; for (BackendService element : backendServicesClient.list(project).iterateAll()) { // doThingsWith(element); } }
- Parameters:
project
- Project ID for this request.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
list
public final BackendServicesClient.ListPagedResponse list(ListBackendServicesRequest request)
Retrieves the list of BackendService resources available to the specified 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { ListBackendServicesRequest request = ListBackendServicesRequest.newBuilder() .setFilter("filter-1274492040") .setMaxResults(1128457243) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .setProject("project-309310695") .setReturnPartialSuccess(true) .build(); for (BackendService element : backendServicesClient.list(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListBackendServicesRequest,BackendServicesClient.ListPagedResponse> listPagedCallable()
Retrieves the list of BackendService resources available to the specified 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { ListBackendServicesRequest request = ListBackendServicesRequest.newBuilder() .setFilter("filter-1274492040") .setMaxResults(1128457243) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .setProject("project-309310695") .setReturnPartialSuccess(true) .build(); ApiFuture<BackendService> future = backendServicesClient.listPagedCallable().futureCall(request); // Do something. for (BackendService element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listCallable
public final com.google.api.gax.rpc.UnaryCallable<ListBackendServicesRequest,BackendServiceList> listCallable()
Retrieves the list of BackendService resources available to the specified 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { ListBackendServicesRequest request = ListBackendServicesRequest.newBuilder() .setFilter("filter-1274492040") .setMaxResults(1128457243) .setOrderBy("orderBy-1207110587") .setPageToken("pageToken873572522") .setProject("project-309310695") .setReturnPartialSuccess(true) .build(); while (true) { BackendServiceList response = backendServicesClient.listCallable().call(request); for (BackendService element : response.getItemsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
patchAsync
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(String project, String backendService, BackendService backendServiceResource)
Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; BackendService backendServiceResource = BackendService.newBuilder().build(); Operation response = backendServicesClient.patchAsync(project, backendService, backendServiceResource).get(); }
- Parameters:
project
- Project ID for this request.backendService
- Name of the BackendService resource to patch.backendServiceResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
patchAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(PatchBackendServiceRequest request)
Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { PatchBackendServiceRequest request = PatchBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setBackendServiceResource(BackendService.newBuilder().build()) .setProject("project-309310695") .setRequestId("requestId693933066") .build(); Operation response = backendServicesClient.patchAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
patchOperationCallable
public final com.google.api.gax.rpc.OperationCallable<PatchBackendServiceRequest,Operation,Operation> patchOperationCallable()
Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { PatchBackendServiceRequest request = PatchBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setBackendServiceResource(BackendService.newBuilder().build()) .setProject("project-309310695") .setRequestId("requestId693933066") .build(); OperationFuture<Operation, Operation> future = backendServicesClient.patchOperationCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
patchCallable
public final com.google.api.gax.rpc.UnaryCallable<PatchBackendServiceRequest,Operation> patchCallable()
Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { PatchBackendServiceRequest request = PatchBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setBackendServiceResource(BackendService.newBuilder().build()) .setProject("project-309310695") .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backendServicesClient.patchCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
setEdgeSecurityPolicyAsync
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setEdgeSecurityPolicyAsync(String project, String backendService, SecurityPolicyReference securityPolicyReferenceResource)
Sets the edge security policy for the specified backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; SecurityPolicyReference securityPolicyReferenceResource = SecurityPolicyReference.newBuilder().build(); Operation response = backendServicesClient .setEdgeSecurityPolicyAsync(project, backendService, securityPolicyReferenceResource) .get(); }
- Parameters:
project
- Project ID for this request.backendService
- Name of the BackendService resource to which the edge security policy should be set. The name should conform to RFC1035.securityPolicyReferenceResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setEdgeSecurityPolicyAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setEdgeSecurityPolicyAsync(SetEdgeSecurityPolicyBackendServiceRequest request)
Sets the edge security policy for the specified backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { SetEdgeSecurityPolicyBackendServiceRequest request = SetEdgeSecurityPolicyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build()) .build(); Operation response = backendServicesClient.setEdgeSecurityPolicyAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setEdgeSecurityPolicyOperationCallable
public final com.google.api.gax.rpc.OperationCallable<SetEdgeSecurityPolicyBackendServiceRequest,Operation,Operation> setEdgeSecurityPolicyOperationCallable()
Sets the edge security policy for the specified backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { SetEdgeSecurityPolicyBackendServiceRequest request = SetEdgeSecurityPolicyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build()) .build(); OperationFuture<Operation, Operation> future = backendServicesClient.setEdgeSecurityPolicyOperationCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
setEdgeSecurityPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<SetEdgeSecurityPolicyBackendServiceRequest,Operation> setEdgeSecurityPolicyCallable()
Sets the edge security policy for the specified backend service.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { SetEdgeSecurityPolicyBackendServiceRequest request = SetEdgeSecurityPolicyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build()) .build(); ApiFuture<Operation> future = backendServicesClient.setEdgeSecurityPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
setIamPolicy
public final Policy setIamPolicy(String project, String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource)
Sets the access control policy on the specified resource. Replaces any existing policy.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String resource = "resource-341064690"; GlobalSetPolicyRequest globalSetPolicyRequestResource = GlobalSetPolicyRequest.newBuilder().build(); Policy response = backendServicesClient.setIamPolicy(project, resource, globalSetPolicyRequestResource); }
- Parameters:
project
- Project ID for this request.resource
- Name or id of the resource for this request.globalSetPolicyRequestResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setIamPolicy
public final Policy setIamPolicy(SetIamPolicyBackendServiceRequest request)
Sets the access control policy on the specified resource. Replaces any existing policy.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { SetIamPolicyBackendServiceRequest request = SetIamPolicyBackendServiceRequest.newBuilder() .setGlobalSetPolicyRequestResource(GlobalSetPolicyRequest.newBuilder().build()) .setProject("project-309310695") .setResource("resource-341064690") .build(); Policy response = backendServicesClient.setIamPolicy(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setIamPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<SetIamPolicyBackendServiceRequest,Policy> setIamPolicyCallable()
Sets the access control policy on the specified resource. Replaces any existing policy.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { SetIamPolicyBackendServiceRequest request = SetIamPolicyBackendServiceRequest.newBuilder() .setGlobalSetPolicyRequestResource(GlobalSetPolicyRequest.newBuilder().build()) .setProject("project-309310695") .setResource("resource-341064690") .build(); ApiFuture<Policy> future = backendServicesClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); }
-
setSecurityPolicyAsync
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setSecurityPolicyAsync(String project, String backendService, SecurityPolicyReference securityPolicyReferenceResource)
Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor OverviewSample 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; SecurityPolicyReference securityPolicyReferenceResource = SecurityPolicyReference.newBuilder().build(); Operation response = backendServicesClient .setSecurityPolicyAsync(project, backendService, securityPolicyReferenceResource) .get(); }
- Parameters:
project
- Project ID for this request.backendService
- Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.securityPolicyReferenceResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setSecurityPolicyAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest request)
Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor OverviewSample 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { SetSecurityPolicyBackendServiceRequest request = SetSecurityPolicyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build()) .build(); Operation response = backendServicesClient.setSecurityPolicyAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setSecurityPolicyOperationCallable
public final com.google.api.gax.rpc.OperationCallable<SetSecurityPolicyBackendServiceRequest,Operation,Operation> setSecurityPolicyOperationCallable()
Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor OverviewSample 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { SetSecurityPolicyBackendServiceRequest request = SetSecurityPolicyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build()) .build(); OperationFuture<Operation, Operation> future = backendServicesClient.setSecurityPolicyOperationCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
setSecurityPolicyCallable
public final com.google.api.gax.rpc.UnaryCallable<SetSecurityPolicyBackendServiceRequest,Operation> setSecurityPolicyCallable()
Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor OverviewSample 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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { SetSecurityPolicyBackendServiceRequest request = SetSecurityPolicyBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setProject("project-309310695") .setRequestId("requestId693933066") .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build()) .build(); ApiFuture<Operation> future = backendServicesClient.setSecurityPolicyCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
updateAsync
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateAsync(String project, String backendService, BackendService backendServiceResource)
Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { String project = "project-309310695"; String backendService = "backendService-1884714623"; BackendService backendServiceResource = BackendService.newBuilder().build(); Operation response = backendServicesClient.updateAsync(project, backendService, backendServiceResource).get(); }
- Parameters:
project
- Project ID for this request.backendService
- Name of the BackendService resource to update.backendServiceResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> updateAsync(UpdateBackendServiceRequest request)
Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { UpdateBackendServiceRequest request = UpdateBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setBackendServiceResource(BackendService.newBuilder().build()) .setProject("project-309310695") .setRequestId("requestId693933066") .build(); Operation response = backendServicesClient.updateAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateOperationCallable
public final com.google.api.gax.rpc.OperationCallable<UpdateBackendServiceRequest,Operation,Operation> updateOperationCallable()
Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { UpdateBackendServiceRequest request = UpdateBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setBackendServiceResource(BackendService.newBuilder().build()) .setProject("project-309310695") .setRequestId("requestId693933066") .build(); OperationFuture<Operation, Operation> future = backendServicesClient.updateOperationCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
updateCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateBackendServiceRequest,Operation> updateCallable()
Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview.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 (BackendServicesClient backendServicesClient = BackendServicesClient.create()) { UpdateBackendServiceRequest request = UpdateBackendServiceRequest.newBuilder() .setBackendService("backendService-1884714623") .setBackendServiceResource(BackendService.newBuilder().build()) .setProject("project-309310695") .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = backendServicesClient.updateCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-