@Generated(value="by gapic-generator") @BetaApi public class RegionBackendServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
}
Note: close() needs to be called on the regionBackendServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of RegionBackendServiceSettings to create(). For example:
To customize credentials:
RegionBackendServiceSettings regionBackendServiceSettings =
RegionBackendServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RegionBackendServiceClient regionBackendServiceClient =
RegionBackendServiceClient.create(regionBackendServiceSettings);
To customize the endpoint:
RegionBackendServiceSettings regionBackendServiceSettings =
RegionBackendServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
RegionBackendServiceClient regionBackendServiceClient =
RegionBackendServiceClient.create(regionBackendServiceSettings);
Modifier and Type | Class and Description |
---|---|
static class |
RegionBackendServiceClient.ListRegionBackendServicesFixedSizeCollection |
static class |
RegionBackendServiceClient.ListRegionBackendServicesPage |
static class |
RegionBackendServiceClient.ListRegionBackendServicesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
RegionBackendServiceClient(RegionBackendServiceSettings settings)
Constructs an instance of RegionBackendServiceClient, using the given settings.
|
protected |
RegionBackendServiceClient(RegionBackendServiceStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static RegionBackendServiceClient |
create()
Constructs an instance of RegionBackendServiceClient with default settings.
|
static RegionBackendServiceClient |
create(RegionBackendServiceSettings settings)
Constructs an instance of RegionBackendServiceClient, using the given settings.
|
static RegionBackendServiceClient |
create(RegionBackendServiceStub stub)
Constructs an instance of RegionBackendServiceClient, using the given stub for making calls.
|
Operation |
deleteRegionBackendService(DeleteRegionBackendServiceHttpRequest request)
Deletes the specified regional BackendService resource.
|
Operation |
deleteRegionBackendService(ProjectRegionBackendServiceName backendService)
Deletes the specified regional BackendService resource.
|
Operation |
deleteRegionBackendService(String backendService)
Deletes the specified regional BackendService resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteRegionBackendServiceHttpRequest,Operation> |
deleteRegionBackendServiceCallable()
Deletes the specified regional BackendService resource.
|
BackendServiceGroupHealth |
getHealthRegionBackendService(GetHealthRegionBackendServiceHttpRequest request)
Gets the most recent health check results for this regional BackendService.
|
BackendServiceGroupHealth |
getHealthRegionBackendService(ProjectRegionBackendServiceName backendService,
ResourceGroupReference resourceGroupReferenceResource)
Gets the most recent health check results for this regional BackendService.
|
BackendServiceGroupHealth |
getHealthRegionBackendService(String backendService,
ResourceGroupReference resourceGroupReferenceResource)
Gets the most recent health check results for this regional BackendService.
|
com.google.api.gax.rpc.UnaryCallable<GetHealthRegionBackendServiceHttpRequest,BackendServiceGroupHealth> |
getHealthRegionBackendServiceCallable()
Gets the most recent health check results for this regional BackendService.
|
BackendService |
getRegionBackendService(GetRegionBackendServiceHttpRequest request)
Returns the specified regional BackendService resource.
|
BackendService |
getRegionBackendService(ProjectRegionBackendServiceName backendService)
Returns the specified regional BackendService resource.
|
BackendService |
getRegionBackendService(String backendService)
Returns the specified regional BackendService resource.
|
com.google.api.gax.rpc.UnaryCallable<GetRegionBackendServiceHttpRequest,BackendService> |
getRegionBackendServiceCallable()
Returns the specified regional BackendService resource.
|
RegionBackendServiceSettings |
getSettings() |
RegionBackendServiceStub |
getStub() |
Operation |
insertRegionBackendService(InsertRegionBackendServiceHttpRequest request)
Creates a regional BackendService resource in the specified project using the data included in
the request.
|
Operation |
insertRegionBackendService(ProjectRegionName region,
BackendService backendServiceResource)
Creates a regional BackendService resource in the specified project using the data included in
the request.
|
Operation |
insertRegionBackendService(String region,
BackendService backendServiceResource)
Creates a regional BackendService resource in the specified project using the data included in
the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertRegionBackendServiceHttpRequest,Operation> |
insertRegionBackendServiceCallable()
Creates a regional BackendService resource in the specified project using the data included in
the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
RegionBackendServiceClient.ListRegionBackendServicesPagedResponse |
listRegionBackendServices(ListRegionBackendServicesHttpRequest request)
Retrieves the list of regional BackendService resources available to the specified project in
the given region.
|
RegionBackendServiceClient.ListRegionBackendServicesPagedResponse |
listRegionBackendServices(ProjectRegionName region)
Retrieves the list of regional BackendService resources available to the specified project in
the given region.
|
RegionBackendServiceClient.ListRegionBackendServicesPagedResponse |
listRegionBackendServices(String region)
Retrieves the list of regional BackendService resources available to the specified project in
the given region.
|
com.google.api.gax.rpc.UnaryCallable<ListRegionBackendServicesHttpRequest,BackendServiceList> |
listRegionBackendServicesCallable()
Retrieves the list of regional BackendService resources available to the specified project in
the given region.
|
com.google.api.gax.rpc.UnaryCallable<ListRegionBackendServicesHttpRequest,RegionBackendServiceClient.ListRegionBackendServicesPagedResponse> |
listRegionBackendServicesPagedCallable()
Retrieves the list of regional BackendService resources available to the specified project in
the given region.
|
Operation |
patchRegionBackendService(PatchRegionBackendServiceHttpRequest request)
Updates the specified regional BackendService resource with the data included in the request.
|
Operation |
patchRegionBackendService(ProjectRegionBackendServiceName backendService,
BackendService backendServiceResource,
List<String> fieldMask)
Updates the specified regional BackendService resource with the data included in the request.
|
Operation |
patchRegionBackendService(String backendService,
BackendService backendServiceResource,
List<String> fieldMask)
Updates the specified regional BackendService resource with the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<PatchRegionBackendServiceHttpRequest,Operation> |
patchRegionBackendServiceCallable()
Updates the specified regional BackendService resource with the data included in the request.
|
void |
shutdown() |
void |
shutdownNow() |
Operation |
updateRegionBackendService(ProjectRegionBackendServiceName backendService,
BackendService backendServiceResource,
List<String> fieldMask)
Updates the specified regional BackendService resource with the data included in the request.
|
Operation |
updateRegionBackendService(String backendService,
BackendService backendServiceResource,
List<String> fieldMask)
Updates the specified regional BackendService resource with the data included in the request.
|
Operation |
updateRegionBackendService(UpdateRegionBackendServiceHttpRequest request)
Updates the specified regional BackendService resource with the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<UpdateRegionBackendServiceHttpRequest,Operation> |
updateRegionBackendServiceCallable()
Updates the specified regional BackendService resource with the data included in the request.
|
protected RegionBackendServiceClient(RegionBackendServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected RegionBackendServiceClient(RegionBackendServiceStub stub)
public static final RegionBackendServiceClient create() throws IOException
IOException
public static final RegionBackendServiceClient create(RegionBackendServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final RegionBackendServiceClient create(RegionBackendServiceStub stub)
public final RegionBackendServiceSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public RegionBackendServiceStub getStub()
@BetaApi public final Operation deleteRegionBackendService(ProjectRegionBackendServiceName backendService)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService);
}
backendService
- Name of the BackendService resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteRegionBackendService(String backendService)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
Operation response = regionBackendServiceClient.deleteRegionBackendService(backendService.toString());
}
backendService
- Name of the BackendService resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteRegionBackendService(DeleteRegionBackendServiceHttpRequest request)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.build();
Operation response = regionBackendServiceClient.deleteRegionBackendService(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<DeleteRegionBackendServiceHttpRequest,Operation> deleteRegionBackendServiceCallable()
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
DeleteRegionBackendServiceHttpRequest request = DeleteRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.build();
ApiFuture<Operation> future = regionBackendServiceClient.deleteRegionBackendServiceCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final BackendService getRegionBackendService(ProjectRegionBackendServiceName backendService)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService response = regionBackendServiceClient.getRegionBackendService(backendService);
}
backendService
- Name of the BackendService resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final BackendService getRegionBackendService(String backendService)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService response = regionBackendServiceClient.getRegionBackendService(backendService.toString());
}
backendService
- Name of the BackendService resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final BackendService getRegionBackendService(GetRegionBackendServiceHttpRequest request)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
GetRegionBackendServiceHttpRequest request = GetRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.build();
BackendService response = regionBackendServiceClient.getRegionBackendService(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<GetRegionBackendServiceHttpRequest,BackendService> getRegionBackendServiceCallable()
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
GetRegionBackendServiceHttpRequest request = GetRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.build();
ApiFuture<BackendService> future = regionBackendServiceClient.getRegionBackendServiceCallable().futureCall(request);
// Do something
BackendService response = future.get();
}
@BetaApi public final BackendServiceGroupHealth getHealthRegionBackendService(ProjectRegionBackendServiceName backendService, ResourceGroupReference resourceGroupReferenceResource)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
BackendServiceGroupHealth response = regionBackendServiceClient.getHealthRegionBackendService(backendService, resourceGroupReferenceResource);
}
backendService
- Name of the BackendService resource for which to get health.resourceGroupReferenceResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final BackendServiceGroupHealth getHealthRegionBackendService(String backendService, ResourceGroupReference resourceGroupReferenceResource)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
BackendServiceGroupHealth response = regionBackendServiceClient.getHealthRegionBackendService(backendService.toString(), resourceGroupReferenceResource);
}
backendService
- Name of the BackendService resource for which to get health.resourceGroupReferenceResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final BackendServiceGroupHealth getHealthRegionBackendService(GetHealthRegionBackendServiceHttpRequest request)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
GetHealthRegionBackendServiceHttpRequest request = GetHealthRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.setResourceGroupReferenceResource(resourceGroupReferenceResource)
.build();
BackendServiceGroupHealth response = regionBackendServiceClient.getHealthRegionBackendService(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<GetHealthRegionBackendServiceHttpRequest,BackendServiceGroupHealth> getHealthRegionBackendServiceCallable()
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
ResourceGroupReference resourceGroupReferenceResource = ResourceGroupReference.newBuilder().build();
GetHealthRegionBackendServiceHttpRequest request = GetHealthRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.setResourceGroupReferenceResource(resourceGroupReferenceResource)
.build();
ApiFuture<BackendServiceGroupHealth> future = regionBackendServiceClient.getHealthRegionBackendServiceCallable().futureCall(request);
// Do something
BackendServiceGroupHealth response = future.get();
}
@BetaApi public final Operation insertRegionBackendService(ProjectRegionName region, BackendService backendServiceResource)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
BackendService backendServiceResource = BackendService.newBuilder().build();
Operation response = regionBackendServiceClient.insertRegionBackendService(region, backendServiceResource);
}
region
- Name of the region scoping this request.backendServiceResource
- Represents a Backend Service resource.
Backend services must have an associated health check. Backend services also store information about session affinity. For more information, read Backend Services.
A backendServices resource represents a global backend service. Global backend services are used for HTTP(S), SSL Proxy, TCP Proxy load balancing and Traffic Director.
A regionBackendServices resource represents a regional backend service. Regional backend services are used for internal TCP/UDP load balancing. For more information, read Internal TCP/UDP Load balancing. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertRegionBackendService(String region, BackendService backendServiceResource)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
BackendService backendServiceResource = BackendService.newBuilder().build();
Operation response = regionBackendServiceClient.insertRegionBackendService(region.toString(), backendServiceResource);
}
region
- Name of the region scoping this request.backendServiceResource
- Represents a Backend Service resource.
Backend services must have an associated health check. Backend services also store information about session affinity. For more information, read Backend Services.
A backendServices resource represents a global backend service. Global backend services are used for HTTP(S), SSL Proxy, TCP Proxy load balancing and Traffic Director.
A regionBackendServices resource represents a regional backend service. Regional backend services are used for internal TCP/UDP load balancing. For more information, read Internal TCP/UDP Load balancing. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertRegionBackendService(InsertRegionBackendServiceHttpRequest request)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
BackendService backendServiceResource = BackendService.newBuilder().build();
InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setBackendServiceResource(backendServiceResource)
.build();
Operation response = regionBackendServiceClient.insertRegionBackendService(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<InsertRegionBackendServiceHttpRequest,Operation> insertRegionBackendServiceCallable()
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
BackendService backendServiceResource = BackendService.newBuilder().build();
InsertRegionBackendServiceHttpRequest request = InsertRegionBackendServiceHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setBackendServiceResource(backendServiceResource)
.build();
ApiFuture<Operation> future = regionBackendServiceClient.insertRegionBackendServiceCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final RegionBackendServiceClient.ListRegionBackendServicesPagedResponse listRegionBackendServices(ProjectRegionName region)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (BackendService element : regionBackendServiceClient.listRegionBackendServices(region).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region scoping this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final RegionBackendServiceClient.ListRegionBackendServicesPagedResponse listRegionBackendServices(String region)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (BackendService element : regionBackendServiceClient.listRegionBackendServices(region.toString()).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region scoping this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final RegionBackendServiceClient.ListRegionBackendServicesPagedResponse listRegionBackendServices(ListRegionBackendServicesHttpRequest request)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
for (BackendService element : regionBackendServiceClient.listRegionBackendServices(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListRegionBackendServicesHttpRequest,RegionBackendServiceClient.ListRegionBackendServicesPagedResponse> listRegionBackendServicesPagedCallable()
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
ApiFuture<ListRegionBackendServicesPagedResponse> future = regionBackendServiceClient.listRegionBackendServicesPagedCallable().futureCall(request);
// Do something
for (BackendService element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListRegionBackendServicesHttpRequest,BackendServiceList> listRegionBackendServicesCallable()
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
while (true) {
BackendServiceList response = regionBackendServiceClient.listRegionBackendServicesCallable().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;
}
}
}
@BetaApi public final Operation patchRegionBackendService(ProjectRegionBackendServiceName backendService, BackendService backendServiceResource, List<String> fieldMask)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService backendServiceResource = BackendService.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = regionBackendServiceClient.patchRegionBackendService(backendService, backendServiceResource, fieldMask);
}
backendService
- Name of the BackendService resource to patch.backendServiceResource
- Represents a Backend Service resource.
Backend services must have an associated health check. Backend services also store information about session affinity. For more information, read Backend Services.
A backendServices resource represents a global backend service. Global backend services are used for HTTP(S), SSL Proxy, TCP Proxy load balancing and Traffic Director.
A regionBackendServices resource represents a regional backend service. Regional backend services are used for internal TCP/UDP load balancing. For more information, read Internal TCP/UDP Load balancing. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)
fieldMask
- The fields that should be serialized (even if they have empty values). If the
containing message object has a non-null fieldmask, then all the fields in the field mask
(and only those fields in the field mask) will be serialized. If the containing object does
not have a fieldmask, then only non-empty fields will be serialized.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation patchRegionBackendService(String backendService, BackendService backendServiceResource, List<String> fieldMask)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService backendServiceResource = BackendService.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = regionBackendServiceClient.patchRegionBackendService(backendService.toString(), backendServiceResource, fieldMask);
}
backendService
- Name of the BackendService resource to patch.backendServiceResource
- Represents a Backend Service resource.
Backend services must have an associated health check. Backend services also store information about session affinity. For more information, read Backend Services.
A backendServices resource represents a global backend service. Global backend services are used for HTTP(S), SSL Proxy, TCP Proxy load balancing and Traffic Director.
A regionBackendServices resource represents a regional backend service. Regional backend services are used for internal TCP/UDP load balancing. For more information, read Internal TCP/UDP Load balancing. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)
fieldMask
- The fields that should be serialized (even if they have empty values). If the
containing message object has a non-null fieldmask, then all the fields in the field mask
(and only those fields in the field mask) will be serialized. If the containing object does
not have a fieldmask, then only non-empty fields will be serialized.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation patchRegionBackendService(PatchRegionBackendServiceHttpRequest request)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService backendServiceResource = BackendService.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.setBackendServiceResource(backendServiceResource)
.addAllFieldMask(fieldMask)
.build();
Operation response = regionBackendServiceClient.patchRegionBackendService(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<PatchRegionBackendServiceHttpRequest,Operation> patchRegionBackendServiceCallable()
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService backendServiceResource = BackendService.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchRegionBackendServiceHttpRequest request = PatchRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.setBackendServiceResource(backendServiceResource)
.addAllFieldMask(fieldMask)
.build();
ApiFuture<Operation> future = regionBackendServiceClient.patchRegionBackendServiceCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation updateRegionBackendService(ProjectRegionBackendServiceName backendService, BackendService backendServiceResource, List<String> fieldMask)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService backendServiceResource = BackendService.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = regionBackendServiceClient.updateRegionBackendService(backendService, backendServiceResource, fieldMask);
}
backendService
- Name of the BackendService resource to update.backendServiceResource
- Represents a Backend Service resource.
Backend services must have an associated health check. Backend services also store information about session affinity. For more information, read Backend Services.
A backendServices resource represents a global backend service. Global backend services are used for HTTP(S), SSL Proxy, TCP Proxy load balancing and Traffic Director.
A regionBackendServices resource represents a regional backend service. Regional backend services are used for internal TCP/UDP load balancing. For more information, read Internal TCP/UDP Load balancing. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)
fieldMask
- The fields that should be serialized (even if they have empty values). If the
containing message object has a non-null fieldmask, then all the fields in the field mask
(and only those fields in the field mask) will be serialized. If the containing object does
not have a fieldmask, then only non-empty fields will be serialized.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation updateRegionBackendService(String backendService, BackendService backendServiceResource, List<String> fieldMask)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
ProjectRegionBackendServiceName backendService = ProjectRegionBackendServiceName.of("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService backendServiceResource = BackendService.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = regionBackendServiceClient.updateRegionBackendService(backendService.toString(), backendServiceResource, fieldMask);
}
backendService
- Name of the BackendService resource to update.backendServiceResource
- Represents a Backend Service resource.
Backend services must have an associated health check. Backend services also store information about session affinity. For more information, read Backend Services.
A backendServices resource represents a global backend service. Global backend services are used for HTTP(S), SSL Proxy, TCP Proxy load balancing and Traffic Director.
A regionBackendServices resource represents a regional backend service. Regional backend services are used for internal TCP/UDP load balancing. For more information, read Internal TCP/UDP Load balancing. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)
fieldMask
- The fields that should be serialized (even if they have empty values). If the
containing message object has a non-null fieldmask, then all the fields in the field mask
(and only those fields in the field mask) will be serialized. If the containing object does
not have a fieldmask, then only non-empty fields will be serialized.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation updateRegionBackendService(UpdateRegionBackendServiceHttpRequest request)
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService backendServiceResource = BackendService.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.setBackendServiceResource(backendServiceResource)
.addAllFieldMask(fieldMask)
.build();
Operation response = regionBackendServiceClient.updateRegionBackendService(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<UpdateRegionBackendServiceHttpRequest,Operation> updateRegionBackendServiceCallable()
Sample code:
try (RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient.create()) {
String formattedBackendService = ProjectRegionBackendServiceName.format("[PROJECT]", "[REGION]", "[BACKEND_SERVICE]");
BackendService backendServiceResource = BackendService.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
UpdateRegionBackendServiceHttpRequest request = UpdateRegionBackendServiceHttpRequest.newBuilder()
.setBackendService(formattedBackendService)
.setBackendServiceResource(backendServiceResource)
.addAllFieldMask(fieldMask)
.build();
ApiFuture<Operation> future = regionBackendServiceClient.updateRegionBackendServiceCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.