@Generated(value="by gapic-generator") @BetaApi public class RegionSslCertificateClient 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 (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
ProjectRegionSslCertificateName sslCertificate = ProjectRegionSslCertificateName.of("[PROJECT]", "[REGION]", "[SSL_CERTIFICATE]");
Operation response = regionSslCertificateClient.deleteRegionSslCertificate(sslCertificate);
}
Note: close() needs to be called on the regionSslCertificateClient 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 RegionSslCertificateSettings to create(). For example:
To customize credentials:
RegionSslCertificateSettings regionSslCertificateSettings =
RegionSslCertificateSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RegionSslCertificateClient regionSslCertificateClient =
RegionSslCertificateClient.create(regionSslCertificateSettings);
To customize the endpoint:
RegionSslCertificateSettings regionSslCertificateSettings =
RegionSslCertificateSettings.newBuilder().setEndpoint(myEndpoint).build();
RegionSslCertificateClient regionSslCertificateClient =
RegionSslCertificateClient.create(regionSslCertificateSettings);
Modifier and Type | Class and Description |
---|---|
static class |
RegionSslCertificateClient.ListRegionSslCertificatesFixedSizeCollection |
static class |
RegionSslCertificateClient.ListRegionSslCertificatesPage |
static class |
RegionSslCertificateClient.ListRegionSslCertificatesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
RegionSslCertificateClient(RegionSslCertificateSettings settings)
Constructs an instance of RegionSslCertificateClient, using the given settings.
|
protected |
RegionSslCertificateClient(RegionSslCertificateStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static RegionSslCertificateClient |
create()
Constructs an instance of RegionSslCertificateClient with default settings.
|
static RegionSslCertificateClient |
create(RegionSslCertificateSettings settings)
Constructs an instance of RegionSslCertificateClient, using the given settings.
|
static RegionSslCertificateClient |
create(RegionSslCertificateStub stub)
Constructs an instance of RegionSslCertificateClient, using the given stub for making calls.
|
Operation |
deleteRegionSslCertificate(DeleteRegionSslCertificateHttpRequest request)
Deletes the specified SslCertificate resource in the region.
|
Operation |
deleteRegionSslCertificate(ProjectRegionSslCertificateName sslCertificate)
Deletes the specified SslCertificate resource in the region.
|
Operation |
deleteRegionSslCertificate(String sslCertificate)
Deletes the specified SslCertificate resource in the region.
|
com.google.api.gax.rpc.UnaryCallable<DeleteRegionSslCertificateHttpRequest,Operation> |
deleteRegionSslCertificateCallable()
Deletes the specified SslCertificate resource in the region.
|
SslCertificate |
getRegionSslCertificate(GetRegionSslCertificateHttpRequest request)
Returns the specified SslCertificate resource in the specified region.
|
SslCertificate |
getRegionSslCertificate(ProjectRegionSslCertificateName sslCertificate)
Returns the specified SslCertificate resource in the specified region.
|
SslCertificate |
getRegionSslCertificate(String sslCertificate)
Returns the specified SslCertificate resource in the specified region.
|
com.google.api.gax.rpc.UnaryCallable<GetRegionSslCertificateHttpRequest,SslCertificate> |
getRegionSslCertificateCallable()
Returns the specified SslCertificate resource in the specified region.
|
RegionSslCertificateSettings |
getSettings() |
RegionSslCertificateStub |
getStub() |
Operation |
insertRegionSslCertificate(InsertRegionSslCertificateHttpRequest request)
Creates a SslCertificate resource in the specified project and region using the data included
in the request
|
Operation |
insertRegionSslCertificate(ProjectRegionName region,
SslCertificate sslCertificateResource)
Creates a SslCertificate resource in the specified project and region using the data included
in the request
|
Operation |
insertRegionSslCertificate(String region,
SslCertificate sslCertificateResource)
Creates a SslCertificate resource in the specified project and region using the data included
in the request
|
com.google.api.gax.rpc.UnaryCallable<InsertRegionSslCertificateHttpRequest,Operation> |
insertRegionSslCertificateCallable()
Creates a SslCertificate resource in the specified project and region using the data included
in the request
|
boolean |
isShutdown() |
boolean |
isTerminated() |
RegionSslCertificateClient.ListRegionSslCertificatesPagedResponse |
listRegionSslCertificates(ListRegionSslCertificatesHttpRequest request)
Retrieves the list of SslCertificate resources available to the specified project in the
specified region.
|
RegionSslCertificateClient.ListRegionSslCertificatesPagedResponse |
listRegionSslCertificates(ProjectRegionName region)
Retrieves the list of SslCertificate resources available to the specified project in the
specified region.
|
RegionSslCertificateClient.ListRegionSslCertificatesPagedResponse |
listRegionSslCertificates(String region)
Retrieves the list of SslCertificate resources available to the specified project in the
specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListRegionSslCertificatesHttpRequest,SslCertificateList> |
listRegionSslCertificatesCallable()
Retrieves the list of SslCertificate resources available to the specified project in the
specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListRegionSslCertificatesHttpRequest,RegionSslCertificateClient.ListRegionSslCertificatesPagedResponse> |
listRegionSslCertificatesPagedCallable()
Retrieves the list of SslCertificate resources available to the specified project in the
specified region.
|
void |
shutdown() |
void |
shutdownNow() |
protected RegionSslCertificateClient(RegionSslCertificateSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected RegionSslCertificateClient(RegionSslCertificateStub stub)
public static final RegionSslCertificateClient create() throws IOException
IOException
public static final RegionSslCertificateClient create(RegionSslCertificateSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final RegionSslCertificateClient create(RegionSslCertificateStub stub)
public final RegionSslCertificateSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public RegionSslCertificateStub getStub()
@BetaApi public final Operation deleteRegionSslCertificate(ProjectRegionSslCertificateName sslCertificate)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
ProjectRegionSslCertificateName sslCertificate = ProjectRegionSslCertificateName.of("[PROJECT]", "[REGION]", "[SSL_CERTIFICATE]");
Operation response = regionSslCertificateClient.deleteRegionSslCertificate(sslCertificate);
}
sslCertificate
- Name of the SslCertificate resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteRegionSslCertificate(String sslCertificate)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
ProjectRegionSslCertificateName sslCertificate = ProjectRegionSslCertificateName.of("[PROJECT]", "[REGION]", "[SSL_CERTIFICATE]");
Operation response = regionSslCertificateClient.deleteRegionSslCertificate(sslCertificate.toString());
}
sslCertificate
- Name of the SslCertificate resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteRegionSslCertificate(DeleteRegionSslCertificateHttpRequest request)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
String formattedSslCertificate = ProjectRegionSslCertificateName.format("[PROJECT]", "[REGION]", "[SSL_CERTIFICATE]");
DeleteRegionSslCertificateHttpRequest request = DeleteRegionSslCertificateHttpRequest.newBuilder()
.setSslCertificate(formattedSslCertificate)
.build();
Operation response = regionSslCertificateClient.deleteRegionSslCertificate(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<DeleteRegionSslCertificateHttpRequest,Operation> deleteRegionSslCertificateCallable()
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
String formattedSslCertificate = ProjectRegionSslCertificateName.format("[PROJECT]", "[REGION]", "[SSL_CERTIFICATE]");
DeleteRegionSslCertificateHttpRequest request = DeleteRegionSslCertificateHttpRequest.newBuilder()
.setSslCertificate(formattedSslCertificate)
.build();
ApiFuture<Operation> future = regionSslCertificateClient.deleteRegionSslCertificateCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final SslCertificate getRegionSslCertificate(ProjectRegionSslCertificateName sslCertificate)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
ProjectRegionSslCertificateName sslCertificate = ProjectRegionSslCertificateName.of("[PROJECT]", "[REGION]", "[SSL_CERTIFICATE]");
SslCertificate response = regionSslCertificateClient.getRegionSslCertificate(sslCertificate);
}
sslCertificate
- Name of the SslCertificate resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final SslCertificate getRegionSslCertificate(String sslCertificate)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
ProjectRegionSslCertificateName sslCertificate = ProjectRegionSslCertificateName.of("[PROJECT]", "[REGION]", "[SSL_CERTIFICATE]");
SslCertificate response = regionSslCertificateClient.getRegionSslCertificate(sslCertificate.toString());
}
sslCertificate
- Name of the SslCertificate resource to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final SslCertificate getRegionSslCertificate(GetRegionSslCertificateHttpRequest request)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
String formattedSslCertificate = ProjectRegionSslCertificateName.format("[PROJECT]", "[REGION]", "[SSL_CERTIFICATE]");
GetRegionSslCertificateHttpRequest request = GetRegionSslCertificateHttpRequest.newBuilder()
.setSslCertificate(formattedSslCertificate)
.build();
SslCertificate response = regionSslCertificateClient.getRegionSslCertificate(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<GetRegionSslCertificateHttpRequest,SslCertificate> getRegionSslCertificateCallable()
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
String formattedSslCertificate = ProjectRegionSslCertificateName.format("[PROJECT]", "[REGION]", "[SSL_CERTIFICATE]");
GetRegionSslCertificateHttpRequest request = GetRegionSslCertificateHttpRequest.newBuilder()
.setSslCertificate(formattedSslCertificate)
.build();
ApiFuture<SslCertificate> future = regionSslCertificateClient.getRegionSslCertificateCallable().futureCall(request);
// Do something
SslCertificate response = future.get();
}
@BetaApi public final Operation insertRegionSslCertificate(ProjectRegionName region, SslCertificate sslCertificateResource)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
Operation response = regionSslCertificateClient.insertRegionSslCertificate(region, sslCertificateResource);
}
region
- Name of the region scoping this request.sslCertificateResource
- Represents an SSL Certificate resource.
This SSL certificate resource also contains a private key. You can use SSL keys and certificates to secure connections to a load balancer. For more information, read Creating and Using SSL Certificates. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertRegionSslCertificate(String region, SslCertificate sslCertificateResource)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
Operation response = regionSslCertificateClient.insertRegionSslCertificate(region.toString(), sslCertificateResource);
}
region
- Name of the region scoping this request.sslCertificateResource
- Represents an SSL Certificate resource.
This SSL certificate resource also contains a private key. You can use SSL keys and certificates to secure connections to a load balancer. For more information, read Creating and Using SSL Certificates. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertRegionSslCertificate(InsertRegionSslCertificateHttpRequest request)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
InsertRegionSslCertificateHttpRequest request = InsertRegionSslCertificateHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setSslCertificateResource(sslCertificateResource)
.build();
Operation response = regionSslCertificateClient.insertRegionSslCertificate(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<InsertRegionSslCertificateHttpRequest,Operation> insertRegionSslCertificateCallable()
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
SslCertificate sslCertificateResource = SslCertificate.newBuilder().build();
InsertRegionSslCertificateHttpRequest request = InsertRegionSslCertificateHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setSslCertificateResource(sslCertificateResource)
.build();
ApiFuture<Operation> future = regionSslCertificateClient.insertRegionSslCertificateCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final RegionSslCertificateClient.ListRegionSslCertificatesPagedResponse listRegionSslCertificates(ProjectRegionName region)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (SslCertificate element : regionSslCertificateClient.listRegionSslCertificates(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 RegionSslCertificateClient.ListRegionSslCertificatesPagedResponse listRegionSslCertificates(String region)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (SslCertificate element : regionSslCertificateClient.listRegionSslCertificates(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 RegionSslCertificateClient.ListRegionSslCertificatesPagedResponse listRegionSslCertificates(ListRegionSslCertificatesHttpRequest request)
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionSslCertificatesHttpRequest request = ListRegionSslCertificatesHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
for (SslCertificate element : regionSslCertificateClient.listRegionSslCertificates(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<ListRegionSslCertificatesHttpRequest,RegionSslCertificateClient.ListRegionSslCertificatesPagedResponse> listRegionSslCertificatesPagedCallable()
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionSslCertificatesHttpRequest request = ListRegionSslCertificatesHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
ApiFuture<ListRegionSslCertificatesPagedResponse> future = regionSslCertificateClient.listRegionSslCertificatesPagedCallable().futureCall(request);
// Do something
for (SslCertificate element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListRegionSslCertificatesHttpRequest,SslCertificateList> listRegionSslCertificatesCallable()
Sample code:
try (RegionSslCertificateClient regionSslCertificateClient = RegionSslCertificateClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListRegionSslCertificatesHttpRequest request = ListRegionSslCertificatesHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
while (true) {
SslCertificateList response = regionSslCertificateClient.listRegionSslCertificatesCallable().call(request);
for (SslCertificate element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
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.