@Generated(value="by gapic-generator") @BetaApi public class HttpHealthCheckClient 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 (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
}
Note: close() needs to be called on the httpHealthCheckClient 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 HttpHealthCheckSettings to create(). For example:
To customize credentials:
HttpHealthCheckSettings httpHealthCheckSettings =
HttpHealthCheckSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
HttpHealthCheckClient httpHealthCheckClient =
HttpHealthCheckClient.create(httpHealthCheckSettings);
To customize the endpoint:
HttpHealthCheckSettings httpHealthCheckSettings =
HttpHealthCheckSettings.newBuilder().setEndpoint(myEndpoint).build();
HttpHealthCheckClient httpHealthCheckClient =
HttpHealthCheckClient.create(httpHealthCheckSettings);
Modifier and Type | Class and Description |
---|---|
static class |
HttpHealthCheckClient.ListHttpHealthChecksFixedSizeCollection |
static class |
HttpHealthCheckClient.ListHttpHealthChecksPage |
static class |
HttpHealthCheckClient.ListHttpHealthChecksPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
HttpHealthCheckClient(HttpHealthCheckSettings settings)
Constructs an instance of HttpHealthCheckClient, using the given settings.
|
protected |
HttpHealthCheckClient(HttpHealthCheckStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static HttpHealthCheckClient |
create()
Constructs an instance of HttpHealthCheckClient with default settings.
|
static HttpHealthCheckClient |
create(HttpHealthCheckSettings settings)
Constructs an instance of HttpHealthCheckClient, using the given settings.
|
static HttpHealthCheckClient |
create(HttpHealthCheckStub stub)
Constructs an instance of HttpHealthCheckClient, using the given stub for making calls.
|
Operation |
deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest request)
Deletes the specified HttpHealthCheck resource.
|
Operation |
deleteHttpHealthCheck(ProjectGlobalHttpHealthCheckName httpHealthCheck)
Deletes the specified HttpHealthCheck resource.
|
Operation |
deleteHttpHealthCheck(String httpHealthCheck)
Deletes the specified HttpHealthCheck resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteHttpHealthCheckHttpRequest,Operation> |
deleteHttpHealthCheckCallable()
Deletes the specified HttpHealthCheck resource.
|
HttpHealthCheck2 |
getHttpHealthCheck(GetHttpHealthCheckHttpRequest request)
Returns the specified HttpHealthCheck resource.
|
HttpHealthCheck2 |
getHttpHealthCheck(ProjectGlobalHttpHealthCheckName httpHealthCheck)
Returns the specified HttpHealthCheck resource.
|
HttpHealthCheck2 |
getHttpHealthCheck(String httpHealthCheck)
Returns the specified HttpHealthCheck resource.
|
com.google.api.gax.rpc.UnaryCallable<GetHttpHealthCheckHttpRequest,HttpHealthCheck2> |
getHttpHealthCheckCallable()
Returns the specified HttpHealthCheck resource.
|
HttpHealthCheckSettings |
getSettings() |
HttpHealthCheckStub |
getStub() |
Operation |
insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest request)
Creates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
insertHttpHealthCheck(ProjectName project,
HttpHealthCheck2 httpHealthCheckResource)
Creates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
insertHttpHealthCheck(String project,
HttpHealthCheck2 httpHealthCheckResource)
Creates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.UnaryCallable<InsertHttpHealthCheckHttpRequest,Operation> |
insertHttpHealthCheckCallable()
Creates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
HttpHealthCheckClient.ListHttpHealthChecksPagedResponse |
listHttpHealthChecks(ListHttpHealthChecksHttpRequest request)
Retrieves the list of HttpHealthCheck resources available to the specified project.
|
HttpHealthCheckClient.ListHttpHealthChecksPagedResponse |
listHttpHealthChecks(ProjectName project)
Retrieves the list of HttpHealthCheck resources available to the specified project.
|
HttpHealthCheckClient.ListHttpHealthChecksPagedResponse |
listHttpHealthChecks(String project)
Retrieves the list of HttpHealthCheck resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListHttpHealthChecksHttpRequest,HttpHealthCheckList> |
listHttpHealthChecksCallable()
Retrieves the list of HttpHealthCheck resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListHttpHealthChecksHttpRequest,HttpHealthCheckClient.ListHttpHealthChecksPagedResponse> |
listHttpHealthChecksPagedCallable()
Retrieves the list of HttpHealthCheck resources available to the specified project.
|
Operation |
patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest request)
Updates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
patchHttpHealthCheck(ProjectGlobalHttpHealthCheckName httpHealthCheck,
HttpHealthCheck2 httpHealthCheckResource,
List<String> fieldMask)
Updates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
patchHttpHealthCheck(String httpHealthCheck,
HttpHealthCheck2 httpHealthCheckResource,
List<String> fieldMask)
Updates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.UnaryCallable<PatchHttpHealthCheckHttpRequest,Operation> |
patchHttpHealthCheckCallable()
Updates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
void |
shutdown() |
void |
shutdownNow() |
Operation |
updateHttpHealthCheck(ProjectGlobalHttpHealthCheckName httpHealthCheck,
HttpHealthCheck2 httpHealthCheckResource,
List<String> fieldMask)
Updates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
updateHttpHealthCheck(String httpHealthCheck,
HttpHealthCheck2 httpHealthCheckResource,
List<String> fieldMask)
Updates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest request)
Updates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.UnaryCallable<UpdateHttpHealthCheckHttpRequest,Operation> |
updateHttpHealthCheckCallable()
Updates a HttpHealthCheck resource in the specified project using the data included in the
request.
|
protected HttpHealthCheckClient(HttpHealthCheckSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected HttpHealthCheckClient(HttpHealthCheckStub stub)
public static final HttpHealthCheckClient create() throws IOException
IOException
public static final HttpHealthCheckClient create(HttpHealthCheckSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final HttpHealthCheckClient create(HttpHealthCheckStub stub)
public final HttpHealthCheckSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public HttpHealthCheckStub getStub()
@BetaApi public final Operation deleteHttpHealthCheck(ProjectGlobalHttpHealthCheckName httpHealthCheck)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck);
}
httpHealthCheck
- Name of the HttpHealthCheck resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteHttpHealthCheck(String httpHealthCheck)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
Operation response = httpHealthCheckClient.deleteHttpHealthCheck(httpHealthCheck.toString());
}
httpHealthCheck
- Name of the HttpHealthCheck resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteHttpHealthCheck(DeleteHttpHealthCheckHttpRequest request)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedHttpHealthCheck = ProjectGlobalHttpHealthCheckName.format("[PROJECT]", "[HTTP_HEALTH_CHECK]");
DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
.setHttpHealthCheck(formattedHttpHealthCheck)
.build();
Operation response = httpHealthCheckClient.deleteHttpHealthCheck(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<DeleteHttpHealthCheckHttpRequest,Operation> deleteHttpHealthCheckCallable()
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedHttpHealthCheck = ProjectGlobalHttpHealthCheckName.format("[PROJECT]", "[HTTP_HEALTH_CHECK]");
DeleteHttpHealthCheckHttpRequest request = DeleteHttpHealthCheckHttpRequest.newBuilder()
.setHttpHealthCheck(formattedHttpHealthCheck)
.build();
ApiFuture<Operation> future = httpHealthCheckClient.deleteHttpHealthCheckCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final HttpHealthCheck2 getHttpHealthCheck(ProjectGlobalHttpHealthCheckName httpHealthCheck)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck);
}
httpHealthCheck
- Name of the HttpHealthCheck resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final HttpHealthCheck2 getHttpHealthCheck(String httpHealthCheck)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(httpHealthCheck.toString());
}
httpHealthCheck
- Name of the HttpHealthCheck resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final HttpHealthCheck2 getHttpHealthCheck(GetHttpHealthCheckHttpRequest request)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedHttpHealthCheck = ProjectGlobalHttpHealthCheckName.format("[PROJECT]", "[HTTP_HEALTH_CHECK]");
GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder()
.setHttpHealthCheck(formattedHttpHealthCheck)
.build();
HttpHealthCheck2 response = httpHealthCheckClient.getHttpHealthCheck(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<GetHttpHealthCheckHttpRequest,HttpHealthCheck2> getHttpHealthCheckCallable()
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedHttpHealthCheck = ProjectGlobalHttpHealthCheckName.format("[PROJECT]", "[HTTP_HEALTH_CHECK]");
GetHttpHealthCheckHttpRequest request = GetHttpHealthCheckHttpRequest.newBuilder()
.setHttpHealthCheck(formattedHttpHealthCheck)
.build();
ApiFuture<HttpHealthCheck2> future = httpHealthCheckClient.getHttpHealthCheckCallable().futureCall(request);
// Do something
HttpHealthCheck2 response = future.get();
}
@BetaApi public final Operation insertHttpHealthCheck(ProjectName project, HttpHealthCheck2 httpHealthCheckResource)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
Operation response = httpHealthCheckClient.insertHttpHealthCheck(project, httpHealthCheckResource);
}
project
- Project ID for this request.httpHealthCheckResource
- Represents a legacy HTTP Health Check resource.
Legacy health checks are required by network load balancers. For more information, read Health Check Concepts.
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertHttpHealthCheck(String project, HttpHealthCheck2 httpHealthCheckResource)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
Operation response = httpHealthCheckClient.insertHttpHealthCheck(project.toString(), httpHealthCheckResource);
}
project
- Project ID for this request.httpHealthCheckResource
- Represents a legacy HTTP Health Check resource.
Legacy health checks are required by network load balancers. For more information, read Health Check Concepts.
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertHttpHealthCheck(InsertHttpHealthCheckHttpRequest request)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder()
.setProject(formattedProject)
.setHttpHealthCheckResource(httpHealthCheckResource)
.build();
Operation response = httpHealthCheckClient.insertHttpHealthCheck(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<InsertHttpHealthCheckHttpRequest,Operation> insertHttpHealthCheckCallable()
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
InsertHttpHealthCheckHttpRequest request = InsertHttpHealthCheckHttpRequest.newBuilder()
.setProject(formattedProject)
.setHttpHealthCheckResource(httpHealthCheckResource)
.build();
ApiFuture<Operation> future = httpHealthCheckClient.insertHttpHealthCheckCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final HttpHealthCheckClient.ListHttpHealthChecksPagedResponse listHttpHealthChecks(ProjectName project)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(project).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final HttpHealthCheckClient.ListHttpHealthChecksPagedResponse listHttpHealthChecks(String project)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(project.toString()).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final HttpHealthCheckClient.ListHttpHealthChecksPagedResponse listHttpHealthChecks(ListHttpHealthChecksHttpRequest request)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListHttpHealthChecksHttpRequest request = ListHttpHealthChecksHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
for (HttpHealthCheck2 element : httpHealthCheckClient.listHttpHealthChecks(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<ListHttpHealthChecksHttpRequest,HttpHealthCheckClient.ListHttpHealthChecksPagedResponse> listHttpHealthChecksPagedCallable()
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListHttpHealthChecksHttpRequest request = ListHttpHealthChecksHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
ApiFuture<ListHttpHealthChecksPagedResponse> future = httpHealthCheckClient.listHttpHealthChecksPagedCallable().futureCall(request);
// Do something
for (HttpHealthCheck2 element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListHttpHealthChecksHttpRequest,HttpHealthCheckList> listHttpHealthChecksCallable()
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListHttpHealthChecksHttpRequest request = ListHttpHealthChecksHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
while (true) {
HttpHealthCheckList response = httpHealthCheckClient.listHttpHealthChecksCallable().call(request);
for (HttpHealthCheck2 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 patchHttpHealthCheck(ProjectGlobalHttpHealthCheckName httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource, List<String> fieldMask)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = httpHealthCheckClient.patchHttpHealthCheck(httpHealthCheck, httpHealthCheckResource, fieldMask);
}
httpHealthCheck
- Name of the HttpHealthCheck resource to patch.httpHealthCheckResource
- Represents a legacy HTTP Health Check resource.
Legacy health checks are required by network load balancers. For more information, read Health Check Concepts.
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 patchHttpHealthCheck(String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource, List<String> fieldMask)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = httpHealthCheckClient.patchHttpHealthCheck(httpHealthCheck.toString(), httpHealthCheckResource, fieldMask);
}
httpHealthCheck
- Name of the HttpHealthCheck resource to patch.httpHealthCheckResource
- Represents a legacy HTTP Health Check resource.
Legacy health checks are required by network load balancers. For more information, read Health Check Concepts.
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 patchHttpHealthCheck(PatchHttpHealthCheckHttpRequest request)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedHttpHealthCheck = ProjectGlobalHttpHealthCheckName.format("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
.setHttpHealthCheck(formattedHttpHealthCheck)
.setHttpHealthCheckResource(httpHealthCheckResource)
.addAllFieldMask(fieldMask)
.build();
Operation response = httpHealthCheckClient.patchHttpHealthCheck(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<PatchHttpHealthCheckHttpRequest,Operation> patchHttpHealthCheckCallable()
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedHttpHealthCheck = ProjectGlobalHttpHealthCheckName.format("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchHttpHealthCheckHttpRequest request = PatchHttpHealthCheckHttpRequest.newBuilder()
.setHttpHealthCheck(formattedHttpHealthCheck)
.setHttpHealthCheckResource(httpHealthCheckResource)
.addAllFieldMask(fieldMask)
.build();
ApiFuture<Operation> future = httpHealthCheckClient.patchHttpHealthCheckCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation updateHttpHealthCheck(ProjectGlobalHttpHealthCheckName httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource, List<String> fieldMask)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = httpHealthCheckClient.updateHttpHealthCheck(httpHealthCheck, httpHealthCheckResource, fieldMask);
}
httpHealthCheck
- Name of the HttpHealthCheck resource to update.httpHealthCheckResource
- Represents a legacy HTTP Health Check resource.
Legacy health checks are required by network load balancers. For more information, read Health Check Concepts.
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 updateHttpHealthCheck(String httpHealthCheck, HttpHealthCheck2 httpHealthCheckResource, List<String> fieldMask)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
ProjectGlobalHttpHealthCheckName httpHealthCheck = ProjectGlobalHttpHealthCheckName.of("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = httpHealthCheckClient.updateHttpHealthCheck(httpHealthCheck.toString(), httpHealthCheckResource, fieldMask);
}
httpHealthCheck
- Name of the HttpHealthCheck resource to update.httpHealthCheckResource
- Represents a legacy HTTP Health Check resource.
Legacy health checks are required by network load balancers. For more information, read Health Check Concepts.
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 updateHttpHealthCheck(UpdateHttpHealthCheckHttpRequest request)
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedHttpHealthCheck = ProjectGlobalHttpHealthCheckName.format("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
.setHttpHealthCheck(formattedHttpHealthCheck)
.setHttpHealthCheckResource(httpHealthCheckResource)
.addAllFieldMask(fieldMask)
.build();
Operation response = httpHealthCheckClient.updateHttpHealthCheck(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<UpdateHttpHealthCheckHttpRequest,Operation> updateHttpHealthCheckCallable()
Sample code:
try (HttpHealthCheckClient httpHealthCheckClient = HttpHealthCheckClient.create()) {
String formattedHttpHealthCheck = ProjectGlobalHttpHealthCheckName.format("[PROJECT]", "[HTTP_HEALTH_CHECK]");
HttpHealthCheck2 httpHealthCheckResource = HttpHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
UpdateHttpHealthCheckHttpRequest request = UpdateHttpHealthCheckHttpRequest.newBuilder()
.setHttpHealthCheck(formattedHttpHealthCheck)
.setHttpHealthCheckResource(httpHealthCheckResource)
.addAllFieldMask(fieldMask)
.build();
ApiFuture<Operation> future = httpHealthCheckClient.updateHttpHealthCheckCallable().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.