@Generated(value="by gapic-generator") @BetaApi public class HttpsHealthCheckClient 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 (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck);
}
Note: close() needs to be called on the httpsHealthCheckClient 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 HttpsHealthCheckSettings to create(). For example:
To customize credentials:
HttpsHealthCheckSettings httpsHealthCheckSettings =
HttpsHealthCheckSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
HttpsHealthCheckClient httpsHealthCheckClient =
HttpsHealthCheckClient.create(httpsHealthCheckSettings);
To customize the endpoint:
HttpsHealthCheckSettings httpsHealthCheckSettings =
HttpsHealthCheckSettings.newBuilder().setEndpoint(myEndpoint).build();
HttpsHealthCheckClient httpsHealthCheckClient =
HttpsHealthCheckClient.create(httpsHealthCheckSettings);
Modifier and Type | Class and Description |
---|---|
static class |
HttpsHealthCheckClient.ListHttpsHealthChecksFixedSizeCollection |
static class |
HttpsHealthCheckClient.ListHttpsHealthChecksPage |
static class |
HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
HttpsHealthCheckClient(HttpsHealthCheckSettings settings)
Constructs an instance of HttpsHealthCheckClient, using the given settings.
|
protected |
HttpsHealthCheckClient(HttpsHealthCheckStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static HttpsHealthCheckClient |
create()
Constructs an instance of HttpsHealthCheckClient with default settings.
|
static HttpsHealthCheckClient |
create(HttpsHealthCheckSettings settings)
Constructs an instance of HttpsHealthCheckClient, using the given settings.
|
static HttpsHealthCheckClient |
create(HttpsHealthCheckStub stub)
Constructs an instance of HttpsHealthCheckClient, using the given stub for making calls.
|
Operation |
deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest request)
Deletes the specified HttpsHealthCheck resource.
|
Operation |
deleteHttpsHealthCheck(ProjectGlobalHttpsHealthCheckName httpsHealthCheck)
Deletes the specified HttpsHealthCheck resource.
|
Operation |
deleteHttpsHealthCheck(String httpsHealthCheck)
Deletes the specified HttpsHealthCheck resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteHttpsHealthCheckHttpRequest,Operation> |
deleteHttpsHealthCheckCallable()
Deletes the specified HttpsHealthCheck resource.
|
HttpsHealthCheck2 |
getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest request)
Returns the specified HttpsHealthCheck resource.
|
HttpsHealthCheck2 |
getHttpsHealthCheck(ProjectGlobalHttpsHealthCheckName httpsHealthCheck)
Returns the specified HttpsHealthCheck resource.
|
HttpsHealthCheck2 |
getHttpsHealthCheck(String httpsHealthCheck)
Returns the specified HttpsHealthCheck resource.
|
com.google.api.gax.rpc.UnaryCallable<GetHttpsHealthCheckHttpRequest,HttpsHealthCheck2> |
getHttpsHealthCheckCallable()
Returns the specified HttpsHealthCheck resource.
|
HttpsHealthCheckSettings |
getSettings() |
HttpsHealthCheckStub |
getStub() |
Operation |
insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest request)
Creates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
insertHttpsHealthCheck(ProjectName project,
HttpsHealthCheck2 httpsHealthCheckResource)
Creates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
insertHttpsHealthCheck(String project,
HttpsHealthCheck2 httpsHealthCheckResource)
Creates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.UnaryCallable<InsertHttpsHealthCheckHttpRequest,Operation> |
insertHttpsHealthCheckCallable()
Creates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse |
listHttpsHealthChecks(ListHttpsHealthChecksHttpRequest request)
Retrieves the list of HttpsHealthCheck resources available to the specified project.
|
HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse |
listHttpsHealthChecks(ProjectName project)
Retrieves the list of HttpsHealthCheck resources available to the specified project.
|
HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse |
listHttpsHealthChecks(String project)
Retrieves the list of HttpsHealthCheck resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListHttpsHealthChecksHttpRequest,HttpsHealthCheckList> |
listHttpsHealthChecksCallable()
Retrieves the list of HttpsHealthCheck resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListHttpsHealthChecksHttpRequest,HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse> |
listHttpsHealthChecksPagedCallable()
Retrieves the list of HttpsHealthCheck resources available to the specified project.
|
Operation |
patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest request)
Updates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
patchHttpsHealthCheck(ProjectGlobalHttpsHealthCheckName httpsHealthCheck,
HttpsHealthCheck2 httpsHealthCheckResource,
List<String> fieldMask)
Updates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
patchHttpsHealthCheck(String httpsHealthCheck,
HttpsHealthCheck2 httpsHealthCheckResource,
List<String> fieldMask)
Updates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.UnaryCallable<PatchHttpsHealthCheckHttpRequest,Operation> |
patchHttpsHealthCheckCallable()
Updates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
void |
shutdown() |
void |
shutdownNow() |
Operation |
updateHttpsHealthCheck(ProjectGlobalHttpsHealthCheckName httpsHealthCheck,
HttpsHealthCheck2 httpsHealthCheckResource,
List<String> fieldMask)
Updates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
updateHttpsHealthCheck(String httpsHealthCheck,
HttpsHealthCheck2 httpsHealthCheckResource,
List<String> fieldMask)
Updates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
Operation |
updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest request)
Updates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.UnaryCallable<UpdateHttpsHealthCheckHttpRequest,Operation> |
updateHttpsHealthCheckCallable()
Updates a HttpsHealthCheck resource in the specified project using the data included in the
request.
|
protected HttpsHealthCheckClient(HttpsHealthCheckSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected HttpsHealthCheckClient(HttpsHealthCheckStub stub)
public static final HttpsHealthCheckClient create() throws IOException
IOException
public static final HttpsHealthCheckClient create(HttpsHealthCheckSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final HttpsHealthCheckClient create(HttpsHealthCheckStub stub)
public final HttpsHealthCheckSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public HttpsHealthCheckStub getStub()
@BetaApi public final Operation deleteHttpsHealthCheck(ProjectGlobalHttpsHealthCheckName httpsHealthCheck)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck);
}
httpsHealthCheck
- Name of the HttpsHealthCheck resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteHttpsHealthCheck(String httpsHealthCheck)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(httpsHealthCheck.toString());
}
httpsHealthCheck
- Name of the HttpsHealthCheck resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteHttpsHealthCheck(DeleteHttpsHealthCheckHttpRequest request)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedHttpsHealthCheck = ProjectGlobalHttpsHealthCheckName.format("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
.setHttpsHealthCheck(formattedHttpsHealthCheck)
.build();
Operation response = httpsHealthCheckClient.deleteHttpsHealthCheck(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<DeleteHttpsHealthCheckHttpRequest,Operation> deleteHttpsHealthCheckCallable()
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedHttpsHealthCheck = ProjectGlobalHttpsHealthCheckName.format("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
DeleteHttpsHealthCheckHttpRequest request = DeleteHttpsHealthCheckHttpRequest.newBuilder()
.setHttpsHealthCheck(formattedHttpsHealthCheck)
.build();
ApiFuture<Operation> future = httpsHealthCheckClient.deleteHttpsHealthCheckCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final HttpsHealthCheck2 getHttpsHealthCheck(ProjectGlobalHttpsHealthCheckName httpsHealthCheck)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck);
}
httpsHealthCheck
- Name of the HttpsHealthCheck resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final HttpsHealthCheck2 getHttpsHealthCheck(String httpsHealthCheck)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(httpsHealthCheck.toString());
}
httpsHealthCheck
- Name of the HttpsHealthCheck resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final HttpsHealthCheck2 getHttpsHealthCheck(GetHttpsHealthCheckHttpRequest request)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedHttpsHealthCheck = ProjectGlobalHttpsHealthCheckName.format("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder()
.setHttpsHealthCheck(formattedHttpsHealthCheck)
.build();
HttpsHealthCheck2 response = httpsHealthCheckClient.getHttpsHealthCheck(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<GetHttpsHealthCheckHttpRequest,HttpsHealthCheck2> getHttpsHealthCheckCallable()
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedHttpsHealthCheck = ProjectGlobalHttpsHealthCheckName.format("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
GetHttpsHealthCheckHttpRequest request = GetHttpsHealthCheckHttpRequest.newBuilder()
.setHttpsHealthCheck(formattedHttpsHealthCheck)
.build();
ApiFuture<HttpsHealthCheck2> future = httpsHealthCheckClient.getHttpsHealthCheckCallable().futureCall(request);
// Do something
HttpsHealthCheck2 response = future.get();
}
@BetaApi public final Operation insertHttpsHealthCheck(ProjectName project, HttpsHealthCheck2 httpsHealthCheckResource)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(project, httpsHealthCheckResource);
}
project
- Project ID for this request.httpsHealthCheckResource
- Represents a legacy HTTPS 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 insertHttpsHealthCheck(String project, HttpsHealthCheck2 httpsHealthCheckResource)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(project.toString(), httpsHealthCheckResource);
}
project
- Project ID for this request.httpsHealthCheckResource
- Represents a legacy HTTPS 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 insertHttpsHealthCheck(InsertHttpsHealthCheckHttpRequest request)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder()
.setProject(formattedProject)
.setHttpsHealthCheckResource(httpsHealthCheckResource)
.build();
Operation response = httpsHealthCheckClient.insertHttpsHealthCheck(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<InsertHttpsHealthCheckHttpRequest,Operation> insertHttpsHealthCheckCallable()
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
InsertHttpsHealthCheckHttpRequest request = InsertHttpsHealthCheckHttpRequest.newBuilder()
.setProject(formattedProject)
.setHttpsHealthCheckResource(httpsHealthCheckResource)
.build();
ApiFuture<Operation> future = httpsHealthCheckClient.insertHttpsHealthCheckCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ProjectName project)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(project).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(String project)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(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 HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse listHttpsHealthChecks(ListHttpsHealthChecksHttpRequest request)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListHttpsHealthChecksHttpRequest request = ListHttpsHealthChecksHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
for (HttpsHealthCheck2 element : httpsHealthCheckClient.listHttpsHealthChecks(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<ListHttpsHealthChecksHttpRequest,HttpsHealthCheckClient.ListHttpsHealthChecksPagedResponse> listHttpsHealthChecksPagedCallable()
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListHttpsHealthChecksHttpRequest request = ListHttpsHealthChecksHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
ApiFuture<ListHttpsHealthChecksPagedResponse> future = httpsHealthCheckClient.listHttpsHealthChecksPagedCallable().futureCall(request);
// Do something
for (HttpsHealthCheck2 element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListHttpsHealthChecksHttpRequest,HttpsHealthCheckList> listHttpsHealthChecksCallable()
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
ListHttpsHealthChecksHttpRequest request = ListHttpsHealthChecksHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
while (true) {
HttpsHealthCheckList response = httpsHealthCheckClient.listHttpsHealthChecksCallable().call(request);
for (HttpsHealthCheck2 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 patchHttpsHealthCheck(ProjectGlobalHttpsHealthCheckName httpsHealthCheck, HttpsHealthCheck2 httpsHealthCheckResource, List<String> fieldMask)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource, fieldMask);
}
httpsHealthCheck
- Name of the HttpsHealthCheck resource to patch.httpsHealthCheckResource
- Represents a legacy HTTPS 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 patchHttpsHealthCheck(String httpsHealthCheck, HttpsHealthCheck2 httpsHealthCheckResource, List<String> fieldMask)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(httpsHealthCheck.toString(), httpsHealthCheckResource, fieldMask);
}
httpsHealthCheck
- Name of the HttpsHealthCheck resource to patch.httpsHealthCheckResource
- Represents a legacy HTTPS 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 patchHttpsHealthCheck(PatchHttpsHealthCheckHttpRequest request)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedHttpsHealthCheck = ProjectGlobalHttpsHealthCheckName.format("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
.setHttpsHealthCheck(formattedHttpsHealthCheck)
.setHttpsHealthCheckResource(httpsHealthCheckResource)
.addAllFieldMask(fieldMask)
.build();
Operation response = httpsHealthCheckClient.patchHttpsHealthCheck(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<PatchHttpsHealthCheckHttpRequest,Operation> patchHttpsHealthCheckCallable()
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedHttpsHealthCheck = ProjectGlobalHttpsHealthCheckName.format("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchHttpsHealthCheckHttpRequest request = PatchHttpsHealthCheckHttpRequest.newBuilder()
.setHttpsHealthCheck(formattedHttpsHealthCheck)
.setHttpsHealthCheckResource(httpsHealthCheckResource)
.addAllFieldMask(fieldMask)
.build();
ApiFuture<Operation> future = httpsHealthCheckClient.patchHttpsHealthCheckCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation updateHttpsHealthCheck(ProjectGlobalHttpsHealthCheckName httpsHealthCheck, HttpsHealthCheck2 httpsHealthCheckResource, List<String> fieldMask)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck, httpsHealthCheckResource, fieldMask);
}
httpsHealthCheck
- Name of the HttpsHealthCheck resource to update.httpsHealthCheckResource
- Represents a legacy HTTPS 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 updateHttpsHealthCheck(String httpsHealthCheck, HttpsHealthCheck2 httpsHealthCheckResource, List<String> fieldMask)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
ProjectGlobalHttpsHealthCheckName httpsHealthCheck = ProjectGlobalHttpsHealthCheckName.of("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(httpsHealthCheck.toString(), httpsHealthCheckResource, fieldMask);
}
httpsHealthCheck
- Name of the HttpsHealthCheck resource to update.httpsHealthCheckResource
- Represents a legacy HTTPS 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 updateHttpsHealthCheck(UpdateHttpsHealthCheckHttpRequest request)
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedHttpsHealthCheck = ProjectGlobalHttpsHealthCheckName.format("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
.setHttpsHealthCheck(formattedHttpsHealthCheck)
.setHttpsHealthCheckResource(httpsHealthCheckResource)
.addAllFieldMask(fieldMask)
.build();
Operation response = httpsHealthCheckClient.updateHttpsHealthCheck(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<UpdateHttpsHealthCheckHttpRequest,Operation> updateHttpsHealthCheckCallable()
Sample code:
try (HttpsHealthCheckClient httpsHealthCheckClient = HttpsHealthCheckClient.create()) {
String formattedHttpsHealthCheck = ProjectGlobalHttpsHealthCheckName.format("[PROJECT]", "[HTTPS_HEALTH_CHECK]");
HttpsHealthCheck2 httpsHealthCheckResource = HttpsHealthCheck2.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
UpdateHttpsHealthCheckHttpRequest request = UpdateHttpsHealthCheckHttpRequest.newBuilder()
.setHttpsHealthCheck(formattedHttpsHealthCheck)
.setHttpsHealthCheckResource(httpsHealthCheckResource)
.addAllFieldMask(fieldMask)
.build();
ApiFuture<Operation> future = httpsHealthCheckClient.updateHttpsHealthCheckCallable().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.