Class BackendServicesClient (1.6.0-beta)

public class BackendServicesClient implements 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:


 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:

  1. 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.
  2. 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.
  3. 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:


 BackendServicesSettings backendServicesSettings =
     BackendServicesSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 BackendServicesClient backendServicesClient =
     BackendServicesClient.create(backendServicesSettings);
 

To customize the endpoint:


 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.

Inheritance

java.lang.Object > BackendServicesClient

Implements

BackgroundResource

Constructors

BackendServicesClient(BackendServicesSettings settings)

protected BackendServicesClient(BackendServicesSettings settings)

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.

Parameter
NameDescription
settingsBackendServicesSettings

BackendServicesClient(BackendServicesStub stub)

protected BackendServicesClient(BackendServicesStub stub)
Parameter
NameDescription
stubBackendServicesStub

Methods

addSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request)

public final OperationFuture<Operation,Operation> addSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest request)

Adds a key for validating requests with signed URLs for this backend service.

Sample code:


 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();
 }
 
Parameter
NameDescription
requestAddSignedUrlKeyBackendServiceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

addSignedUrlKeyAsync(String project, String backendService, SignedUrlKey signedUrlKeyResource)

public final 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:


 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
NameDescription
projectString

Project ID for this request.

backendServiceString

Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.

signedUrlKeyResourceSignedUrlKey

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

addSignedUrlKeyCallable()

public final UnaryCallable<AddSignedUrlKeyBackendServiceRequest,Operation> addSignedUrlKeyCallable()

Adds a key for validating requests with signed URLs for this backend service.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   AddSignedUrlKeyBackendServiceRequest request =
       AddSignedUrlKeyBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build())
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<AddSignedUrlKeyBackendServiceRequest,Operation>

addSignedUrlKeyOperationCallable()

public final OperationCallable<AddSignedUrlKeyBackendServiceRequest,Operation,Operation> addSignedUrlKeyOperationCallable()

Adds a key for validating requests with signed URLs for this backend service.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   AddSignedUrlKeyBackendServiceRequest request =
       AddSignedUrlKeyBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setSignedUrlKeyResource(SignedUrlKey.newBuilder().build())
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<AddSignedUrlKeyBackendServiceRequest,Operation,Operation>

aggregatedList(AggregatedListBackendServicesRequest request)

public final BackendServicesClient.AggregatedListPagedResponse aggregatedList(AggregatedListBackendServicesRequest request)

Retrieves the list of all BackendService resources, regional and global, available to the specified project.

Sample code:


 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
Parameter
NameDescription
requestAggregatedListBackendServicesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
BackendServicesClient.AggregatedListPagedResponse

aggregatedList(String project)

public final BackendServicesClient.AggregatedListPagedResponse aggregatedList(String project)

Retrieves the list of all BackendService resources, regional and global, available to the specified project.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   String project = "project-309310695";
   for (Map.Entry
Parameter
NameDescription
projectString

Name of the project scoping this request.

Returns
TypeDescription
BackendServicesClient.AggregatedListPagedResponse

aggregatedListCallable()

public final UnaryCallable<AggregatedListBackendServicesRequest,BackendServiceAggregatedList> aggregatedListCallable()

Retrieves the list of all BackendService resources, regional and global, available to the specified project.

Sample code:


 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
Returns
TypeDescription
UnaryCallable<AggregatedListBackendServicesRequest,BackendServiceAggregatedList>

aggregatedListPagedCallable()

public final UnaryCallable<AggregatedListBackendServicesRequest,BackendServicesClient.AggregatedListPagedResponse> aggregatedListPagedCallable()

Retrieves the list of all BackendService resources, regional and global, available to the specified project.

Sample code:


 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<>
Returns
TypeDescription
UnaryCallable<AggregatedListBackendServicesRequest,AggregatedListPagedResponse>

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

create()

public static final BackendServicesClient create()

Constructs an instance of BackendServicesClient with default settings.

Returns
TypeDescription
BackendServicesClient
Exceptions
TypeDescription
IOException

create(BackendServicesSettings settings)

public static final BackendServicesClient create(BackendServicesSettings settings)

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.

Parameter
NameDescription
settingsBackendServicesSettings
Returns
TypeDescription
BackendServicesClient
Exceptions
TypeDescription
IOException

create(BackendServicesStub stub)

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).

Parameter
NameDescription
stubBackendServicesStub
Returns
TypeDescription
BackendServicesClient

deleteAsync(DeleteBackendServiceRequest request)

public final OperationFuture<Operation,Operation> deleteAsync(DeleteBackendServiceRequest request)

Deletes the specified BackendService resource.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   DeleteBackendServiceRequest request =
       DeleteBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   Operation response = backendServicesClient.deleteAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteBackendServiceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

deleteAsync(String project, String backendService)

public final OperationFuture<Operation,Operation> deleteAsync(String project, String backendService)

Deletes the specified BackendService resource.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   String project = "project-309310695";
   String backendService = "backendService-1884714623";
   Operation response = backendServicesClient.deleteAsync(project, backendService).get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

backendServiceString

Name of the BackendService resource to delete.

Returns
TypeDescription
OperationFuture<Operation,Operation>

deleteCallable()

public final UnaryCallable<DeleteBackendServiceRequest,Operation> deleteCallable()

Deletes the specified BackendService resource.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   DeleteBackendServiceRequest request =
       DeleteBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<DeleteBackendServiceRequest,Operation>

deleteOperationCallable()

public final OperationCallable<DeleteBackendServiceRequest,Operation,Operation> deleteOperationCallable()

Deletes the specified BackendService resource.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   DeleteBackendServiceRequest request =
       DeleteBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<DeleteBackendServiceRequest,Operation,Operation>

deleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request)

public final OperationFuture<Operation,Operation> deleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest request)

Deletes a key for validating requests with signed URLs for this backend service.

Sample code:


 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();
 }
 
Parameter
NameDescription
requestDeleteSignedUrlKeyBackendServiceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

deleteSignedUrlKeyAsync(String project, String backendService, String keyName)

public final 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:


 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
NameDescription
projectString

Project ID for this request.

backendServiceString

Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.

keyNameString

The name of the Signed URL Key to delete.

Returns
TypeDescription
OperationFuture<Operation,Operation>

deleteSignedUrlKeyCallable()

public final UnaryCallable<DeleteSignedUrlKeyBackendServiceRequest,Operation> deleteSignedUrlKeyCallable()

Deletes a key for validating requests with signed URLs for this backend service.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   DeleteSignedUrlKeyBackendServiceRequest request =
       DeleteSignedUrlKeyBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setKeyName("keyName-815643254")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<DeleteSignedUrlKeyBackendServiceRequest,Operation>

deleteSignedUrlKeyOperationCallable()

public final OperationCallable<DeleteSignedUrlKeyBackendServiceRequest,Operation,Operation> deleteSignedUrlKeyOperationCallable()

Deletes a key for validating requests with signed URLs for this backend service.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   DeleteSignedUrlKeyBackendServiceRequest request =
       DeleteSignedUrlKeyBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setKeyName("keyName-815643254")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<DeleteSignedUrlKeyBackendServiceRequest,Operation,Operation>

get(GetBackendServiceRequest request)

public final BackendService get(GetBackendServiceRequest request)

Returns the specified BackendService resource. Gets a list of available backend services.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   GetBackendServiceRequest request =
       GetBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .build();
   BackendService response = backendServicesClient.get(request);
 }
 
Parameter
NameDescription
requestGetBackendServiceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
BackendService

get(String project, String backendService)

public final BackendService get(String project, String backendService)

Returns the specified BackendService resource. Gets a list of available backend services.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   String project = "project-309310695";
   String backendService = "backendService-1884714623";
   BackendService response = backendServicesClient.get(project, backendService);
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

backendServiceString

Name of the BackendService resource to return.

Returns
TypeDescription
BackendService

getCallable()

public final UnaryCallable<GetBackendServiceRequest,BackendService> getCallable()

Returns the specified BackendService resource. Gets a list of available backend services.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   GetBackendServiceRequest request =
       GetBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<GetBackendServiceRequest,BackendService>

getHealth(GetHealthBackendServiceRequest request)

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:


 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);
 }
 
Parameter
NameDescription
requestGetHealthBackendServiceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
BackendServiceGroupHealth

getHealth(String project, String backendService, ResourceGroupReference resourceGroupReferenceResource)

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:


 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
NameDescription
projectString
backendServiceString

Name of the BackendService resource to which the queried instance belongs.

resourceGroupReferenceResourceResourceGroupReference

The body resource for this request

Returns
TypeDescription
BackendServiceGroupHealth

getHealthCallable()

public final 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:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   GetHealthBackendServiceRequest request =
       GetHealthBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .setResourceGroupReferenceResource(ResourceGroupReference.newBuilder().build())
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<GetHealthBackendServiceRequest,BackendServiceGroupHealth>

getSettings()

public final BackendServicesSettings getSettings()
Returns
TypeDescription
BackendServicesSettings

getStub()

public BackendServicesStub getStub()
Returns
TypeDescription
BackendServicesStub

insertAsync(InsertBackendServiceRequest request)

public final 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:


 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();
 }
 
Parameter
NameDescription
requestInsertBackendServiceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

insertAsync(String project, BackendService backendServiceResource)

public final 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:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   String project = "project-309310695";
   BackendService backendServiceResource = BackendService.newBuilder().build();
   Operation response = backendServicesClient.insertAsync(project, backendServiceResource).get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

backendServiceResourceBackendService

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

insertCallable()

public final 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:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   InsertBackendServiceRequest request =
       InsertBackendServiceRequest.newBuilder()
           .setBackendServiceResource(BackendService.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<InsertBackendServiceRequest,Operation>

insertOperationCallable()

public final 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:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   InsertBackendServiceRequest request =
       InsertBackendServiceRequest.newBuilder()
           .setBackendServiceResource(BackendService.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<InsertBackendServiceRequest,Operation,Operation>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

list(ListBackendServicesRequest request)

public final BackendServicesClient.ListPagedResponse list(ListBackendServicesRequest request)

Retrieves the list of BackendService resources available to the specified project.

Sample code:


 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);
   }
 }
 
Parameter
NameDescription
requestListBackendServicesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
BackendServicesClient.ListPagedResponse

list(String project)

public final BackendServicesClient.ListPagedResponse list(String project)

Retrieves the list of BackendService resources available to the specified project.

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   String project = "project-309310695";
   for (BackendService element : backendServicesClient.list(project).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
projectString

Project ID for this request.

Returns
TypeDescription
BackendServicesClient.ListPagedResponse

listCallable()

public final UnaryCallable<ListBackendServicesRequest,BackendServiceList> listCallable()

Retrieves the list of BackendService resources available to the specified project.

Sample code:


 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.getResponsesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListBackendServicesRequest,BackendServiceList>

listPagedCallable()

public final UnaryCallable<ListBackendServicesRequest,BackendServicesClient.ListPagedResponse> listPagedCallable()

Retrieves the list of BackendService resources available to the specified project.

Sample code:


 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
Returns
TypeDescription
UnaryCallable<ListBackendServicesRequest,ListPagedResponse>

patchAsync(PatchBackendServiceRequest request)

public final 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:


 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();
 }
 
Parameter
NameDescription
requestPatchBackendServiceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

patchAsync(String project, String backendService, BackendService backendServiceResource)

public final 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:


 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
NameDescription
projectString

Project ID for this request.

backendServiceString

Name of the BackendService resource to patch.

backendServiceResourceBackendService

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

patchCallable()

public final 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:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   PatchBackendServiceRequest request =
       PatchBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setBackendServiceResource(BackendService.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<PatchBackendServiceRequest,Operation>

patchOperationCallable()

public final 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:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   PatchBackendServiceRequest request =
       PatchBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setBackendServiceResource(BackendService.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<PatchBackendServiceRequest,Operation,Operation>

setSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest request)

public final 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 Overview

Sample code:


 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();
 }
 
Parameter
NameDescription
requestSetSecurityPolicyBackendServiceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

setSecurityPolicyAsync(String project, String backendService, SecurityPolicyReference securityPolicyReferenceResource)

public final 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 Overview

Sample code:


 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
NameDescription
projectString

Project ID for this request.

backendServiceString

Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.

securityPolicyReferenceResourceSecurityPolicyReference

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

setSecurityPolicyCallable()

public final UnaryCallable<SetSecurityPolicyBackendServiceRequest,Operation> setSecurityPolicyCallable()

Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   SetSecurityPolicyBackendServiceRequest request =
       SetSecurityPolicyBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<SetSecurityPolicyBackendServiceRequest,Operation>

setSecurityPolicyOperationCallable()

public final OperationCallable<SetSecurityPolicyBackendServiceRequest,Operation,Operation> setSecurityPolicyOperationCallable()

Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview

Sample code:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   SetSecurityPolicyBackendServiceRequest request =
       SetSecurityPolicyBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setSecurityPolicyReferenceResource(SecurityPolicyReference.newBuilder().build())
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<SetSecurityPolicyBackendServiceRequest,Operation,Operation>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateAsync(UpdateBackendServiceRequest request)

public final 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:


 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();
 }
 
Parameter
NameDescription
requestUpdateBackendServiceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Operation,Operation>

updateAsync(String project, String backendService, BackendService backendServiceResource)

public final 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:


 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
NameDescription
projectString

Project ID for this request.

backendServiceString

Name of the BackendService resource to update.

backendServiceResourceBackendService

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

updateCallable()

public final 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:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   UpdateBackendServiceRequest request =
       UpdateBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setBackendServiceResource(BackendService.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture
Returns
TypeDescription
UnaryCallable<UpdateBackendServiceRequest,Operation>

updateOperationCallable()

public final 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:


 try (BackendServicesClient backendServicesClient = BackendServicesClient.create()) {
   UpdateBackendServiceRequest request =
       UpdateBackendServiceRequest.newBuilder()
           .setBackendService("backendService-1884714623")
           .setBackendServiceResource(BackendService.newBuilder().build())
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture
Returns
TypeDescription
OperationCallable<UpdateBackendServiceRequest,Operation,Operation>