Class ReachabilityServiceClient
- java.lang.Object
-
- com.google.cloud.networkmanagement.v1.ReachabilityServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class ReachabilityServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: The Reachability service in the Google Cloud Network Management API provides services that analyze the reachability within a single Google Virtual Private Cloud (VPC) network, between peered VPC networks, between VPC and on-premises networks, or between VPC networks and internet hosts. A reachability analysis is based on Google Cloud network configurations.You can use the analysis results to verify these configurations and to troubleshoot connectivity issues.
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:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { String name = "name3373707"; ConnectivityTest response = reachabilityServiceClient.getConnectivityTest(name); }
Note: close() needs to be called on the ReachabilityServiceClient 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:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of ReachabilityServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library ReachabilityServiceSettings reachabilityServiceSettings = ReachabilityServiceSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create(reachabilityServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library ReachabilityServiceSettings reachabilityServiceSettings = ReachabilityServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create(reachabilityServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library ReachabilityServiceSettings reachabilityServiceSettings = ReachabilityServiceSettings.newHttpJsonBuilder().build(); ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create(reachabilityServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReachabilityServiceClient.ListConnectivityTestsFixedSizeCollection
static class
ReachabilityServiceClient.ListConnectivityTestsPage
static class
ReachabilityServiceClient.ListConnectivityTestsPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReachabilityServiceClient(ReachabilityServiceSettings settings)
Constructs an instance of ReachabilityServiceClient, using the given settings.protected
ReachabilityServiceClient(ReachabilityServiceStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static ReachabilityServiceClient
create()
Constructs an instance of ReachabilityServiceClient with default settings.static ReachabilityServiceClient
create(ReachabilityServiceSettings settings)
Constructs an instance of ReachabilityServiceClient, using the given settings.static ReachabilityServiceClient
create(ReachabilityServiceStub stub)
Constructs an instance of ReachabilityServiceClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata>
createConnectivityTestAsync(CreateConnectivityTestRequest request)
Creates a new Connectivity Test.com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata>
createConnectivityTestAsync(String parent, String testId, ConnectivityTest resource)
Creates a new Connectivity Test.com.google.api.gax.rpc.UnaryCallable<CreateConnectivityTestRequest,com.google.longrunning.Operation>
createConnectivityTestCallable()
Creates a new Connectivity Test.com.google.api.gax.rpc.OperationCallable<CreateConnectivityTestRequest,ConnectivityTest,OperationMetadata>
createConnectivityTestOperationCallable()
Creates a new Connectivity Test.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteConnectivityTestAsync(DeleteConnectivityTestRequest request)
Deletes a specific `ConnectivityTest`.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteConnectivityTestAsync(String name)
Deletes a specific `ConnectivityTest`.com.google.api.gax.rpc.UnaryCallable<DeleteConnectivityTestRequest,com.google.longrunning.Operation>
deleteConnectivityTestCallable()
Deletes a specific `ConnectivityTest`.com.google.api.gax.rpc.OperationCallable<DeleteConnectivityTestRequest,com.google.protobuf.Empty,OperationMetadata>
deleteConnectivityTestOperationCallable()
Deletes a specific `ConnectivityTest`.ConnectivityTest
getConnectivityTest(GetConnectivityTestRequest request)
Gets the details of a specific Connectivity Test.ConnectivityTest
getConnectivityTest(String name)
Gets the details of a specific Connectivity Test.com.google.api.gax.rpc.UnaryCallable<GetConnectivityTestRequest,ConnectivityTest>
getConnectivityTestCallable()
Gets the details of a specific Connectivity Test.com.google.api.gax.httpjson.longrunning.OperationsClient
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.ReachabilityServiceSettings
getSettings()
ReachabilityServiceStub
getStub()
boolean
isShutdown()
boolean
isTerminated()
ReachabilityServiceClient.ListConnectivityTestsPagedResponse
listConnectivityTests(ListConnectivityTestsRequest request)
Lists all Connectivity Tests owned by a project.ReachabilityServiceClient.ListConnectivityTestsPagedResponse
listConnectivityTests(String parent)
Lists all Connectivity Tests owned by a project.com.google.api.gax.rpc.UnaryCallable<ListConnectivityTestsRequest,ListConnectivityTestsResponse>
listConnectivityTestsCallable()
Lists all Connectivity Tests owned by a project.com.google.api.gax.rpc.UnaryCallable<ListConnectivityTestsRequest,ReachabilityServiceClient.ListConnectivityTestsPagedResponse>
listConnectivityTestsPagedCallable()
Lists all Connectivity Tests owned by a project.com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata>
rerunConnectivityTestAsync(RerunConnectivityTestRequest request)
Rerun an existing `ConnectivityTest`.com.google.api.gax.rpc.UnaryCallable<RerunConnectivityTestRequest,com.google.longrunning.Operation>
rerunConnectivityTestCallable()
Rerun an existing `ConnectivityTest`.com.google.api.gax.rpc.OperationCallable<RerunConnectivityTestRequest,ConnectivityTest,OperationMetadata>
rerunConnectivityTestOperationCallable()
Rerun an existing `ConnectivityTest`.void
shutdown()
void
shutdownNow()
com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata>
updateConnectivityTestAsync(UpdateConnectivityTestRequest request)
Updates the configuration of an existing `ConnectivityTest`.com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata>
updateConnectivityTestAsync(com.google.protobuf.FieldMask updateMask, ConnectivityTest resource)
Updates the configuration of an existing `ConnectivityTest`.com.google.api.gax.rpc.UnaryCallable<UpdateConnectivityTestRequest,com.google.longrunning.Operation>
updateConnectivityTestCallable()
Updates the configuration of an existing `ConnectivityTest`.com.google.api.gax.rpc.OperationCallable<UpdateConnectivityTestRequest,ConnectivityTest,OperationMetadata>
updateConnectivityTestOperationCallable()
Updates the configuration of an existing `ConnectivityTest`.
-
-
-
Constructor Detail
-
ReachabilityServiceClient
protected ReachabilityServiceClient(ReachabilityServiceSettings settings) throws IOException
Constructs an instance of ReachabilityServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
ReachabilityServiceClient
protected ReachabilityServiceClient(ReachabilityServiceStub stub)
-
-
Method Detail
-
create
public static final ReachabilityServiceClient create() throws IOException
Constructs an instance of ReachabilityServiceClient with default settings.- Throws:
IOException
-
create
public static final ReachabilityServiceClient create(ReachabilityServiceSettings settings) throws IOException
Constructs an instance of ReachabilityServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final ReachabilityServiceClient create(ReachabilityServiceStub stub)
Constructs an instance of ReachabilityServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(ReachabilityServiceSettings).
-
getSettings
public final ReachabilityServiceSettings getSettings()
-
getStub
public ReachabilityServiceStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
getHttpJsonOperationsClient
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
listConnectivityTests
public final ReachabilityServiceClient.ListConnectivityTestsPagedResponse listConnectivityTests(String parent)
Lists all Connectivity Tests owned by a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { String parent = "parent-995424086"; for (ConnectivityTest element : reachabilityServiceClient.listConnectivityTests(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The parent resource of the Connectivity Tests: `projects/{project_id}/locations/global`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listConnectivityTests
public final ReachabilityServiceClient.ListConnectivityTestsPagedResponse listConnectivityTests(ListConnectivityTestsRequest request)
Lists all Connectivity Tests owned by a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { ListConnectivityTestsRequest request = ListConnectivityTestsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ConnectivityTest element : reachabilityServiceClient.listConnectivityTests(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listConnectivityTestsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListConnectivityTestsRequest,ReachabilityServiceClient.ListConnectivityTestsPagedResponse> listConnectivityTestsPagedCallable()
Lists all Connectivity Tests owned by a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { ListConnectivityTestsRequest request = ListConnectivityTestsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ConnectivityTest> future = reachabilityServiceClient.listConnectivityTestsPagedCallable().futureCall(request); // Do something. for (ConnectivityTest element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listConnectivityTestsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListConnectivityTestsRequest,ListConnectivityTestsResponse> listConnectivityTestsCallable()
Lists all Connectivity Tests owned by a project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { ListConnectivityTestsRequest request = ListConnectivityTestsRequest.newBuilder() .setParent("parent-995424086") .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListConnectivityTestsResponse response = reachabilityServiceClient.listConnectivityTestsCallable().call(request); for (ConnectivityTest element : response.getResourcesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getConnectivityTest
public final ConnectivityTest getConnectivityTest(String name)
Gets the details of a specific Connectivity Test.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { String name = "name3373707"; ConnectivityTest response = reachabilityServiceClient.getConnectivityTest(name); }
- Parameters:
name
- Required. `ConnectivityTest` resource name using the form: `projects/{project_id}/locations/global/connectivityTests/{test_id}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getConnectivityTest
public final ConnectivityTest getConnectivityTest(GetConnectivityTestRequest request)
Gets the details of a specific Connectivity Test.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { GetConnectivityTestRequest request = GetConnectivityTestRequest.newBuilder().setName("name3373707").build(); ConnectivityTest response = reachabilityServiceClient.getConnectivityTest(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getConnectivityTestCallable
public final com.google.api.gax.rpc.UnaryCallable<GetConnectivityTestRequest,ConnectivityTest> getConnectivityTestCallable()
Gets the details of a specific Connectivity Test.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { GetConnectivityTestRequest request = GetConnectivityTestRequest.newBuilder().setName("name3373707").build(); ApiFuture<ConnectivityTest> future = reachabilityServiceClient.getConnectivityTestCallable().futureCall(request); // Do something. ConnectivityTest response = future.get(); }
-
createConnectivityTestAsync
public final com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata> createConnectivityTestAsync(String parent, String testId, ConnectivityTest resource)
Creates a new Connectivity Test. After you create a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes.If the endpoint specifications in `ConnectivityTest` are invalid (for example, containing non-existent resources in the network, or you don't have read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`.
If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of <code>AMBIGUOUS</code>. For more information, see the Connectivity Test documentation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { String parent = "parent-995424086"; String testId = "testId-877170355"; ConnectivityTest resource = ConnectivityTest.newBuilder().build(); ConnectivityTest response = reachabilityServiceClient.createConnectivityTestAsync(parent, testId, resource).get(); }
- Parameters:
parent
- Required. The parent resource of the Connectivity Test to create: `projects/{project_id}/locations/global`testId
- Required. The logical name of the Connectivity Test in your project with the following restrictions:- Must contain only lowercase letters, numbers, and hyphens.
- Must start with a letter.
- Must be between 1-40 characters.
- Must end with a number or a letter.
- Must be unique within the customer project
resource
- Required. A `ConnectivityTest` resource- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createConnectivityTestAsync
public final com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata> createConnectivityTestAsync(CreateConnectivityTestRequest request)
Creates a new Connectivity Test. After you create a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes.If the endpoint specifications in `ConnectivityTest` are invalid (for example, containing non-existent resources in the network, or you don't have read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`.
If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of <code>AMBIGUOUS</code>. For more information, see the Connectivity Test documentation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { CreateConnectivityTestRequest request = CreateConnectivityTestRequest.newBuilder() .setParent("parent-995424086") .setTestId("testId-877170355") .setResource(ConnectivityTest.newBuilder().build()) .build(); ConnectivityTest response = reachabilityServiceClient.createConnectivityTestAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createConnectivityTestOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateConnectivityTestRequest,ConnectivityTest,OperationMetadata> createConnectivityTestOperationCallable()
Creates a new Connectivity Test. After you create a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes.If the endpoint specifications in `ConnectivityTest` are invalid (for example, containing non-existent resources in the network, or you don't have read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`.
If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of <code>AMBIGUOUS</code>. For more information, see the Connectivity Test documentation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { CreateConnectivityTestRequest request = CreateConnectivityTestRequest.newBuilder() .setParent("parent-995424086") .setTestId("testId-877170355") .setResource(ConnectivityTest.newBuilder().build()) .build(); OperationFuture<ConnectivityTest, OperationMetadata> future = reachabilityServiceClient.createConnectivityTestOperationCallable().futureCall(request); // Do something. ConnectivityTest response = future.get(); }
-
createConnectivityTestCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateConnectivityTestRequest,com.google.longrunning.Operation> createConnectivityTestCallable()
Creates a new Connectivity Test. After you create a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes.If the endpoint specifications in `ConnectivityTest` are invalid (for example, containing non-existent resources in the network, or you don't have read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`.
If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of <code>AMBIGUOUS</code>. For more information, see the Connectivity Test documentation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { CreateConnectivityTestRequest request = CreateConnectivityTestRequest.newBuilder() .setParent("parent-995424086") .setTestId("testId-877170355") .setResource(ConnectivityTest.newBuilder().build()) .build(); ApiFuture<Operation> future = reachabilityServiceClient.createConnectivityTestCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
updateConnectivityTestAsync
public final com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata> updateConnectivityTestAsync(com.google.protobuf.FieldMask updateMask, ConnectivityTest resource)
Updates the configuration of an existing `ConnectivityTest`. After you update a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. The Reachability state in the test resource is updated with the new result.If the endpoint specifications in `ConnectivityTest` are invalid (for example, they contain non-existent resources in the network, or the user does not have read permissions to the network configurations of listed projects), then the reachability result returns a value of <code>UNKNOWN</code>.
If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of `AMBIGUOUS`. See the documentation in `ConnectivityTest` for for more details.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { FieldMask updateMask = FieldMask.newBuilder().build(); ConnectivityTest resource = ConnectivityTest.newBuilder().build(); ConnectivityTest response = reachabilityServiceClient.updateConnectivityTestAsync(updateMask, resource).get(); }
- Parameters:
updateMask
- Required. Mask of fields to update. At least one path must be supplied in this field.resource
- Required. Only fields specified in update_mask are updated.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateConnectivityTestAsync
public final com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata> updateConnectivityTestAsync(UpdateConnectivityTestRequest request)
Updates the configuration of an existing `ConnectivityTest`. After you update a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. The Reachability state in the test resource is updated with the new result.If the endpoint specifications in `ConnectivityTest` are invalid (for example, they contain non-existent resources in the network, or the user does not have read permissions to the network configurations of listed projects), then the reachability result returns a value of <code>UNKNOWN</code>.
If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of `AMBIGUOUS`. See the documentation in `ConnectivityTest` for for more details.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { UpdateConnectivityTestRequest request = UpdateConnectivityTestRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setResource(ConnectivityTest.newBuilder().build()) .build(); ConnectivityTest response = reachabilityServiceClient.updateConnectivityTestAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateConnectivityTestOperationCallable
public final com.google.api.gax.rpc.OperationCallable<UpdateConnectivityTestRequest,ConnectivityTest,OperationMetadata> updateConnectivityTestOperationCallable()
Updates the configuration of an existing `ConnectivityTest`. After you update a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. The Reachability state in the test resource is updated with the new result.If the endpoint specifications in `ConnectivityTest` are invalid (for example, they contain non-existent resources in the network, or the user does not have read permissions to the network configurations of listed projects), then the reachability result returns a value of <code>UNKNOWN</code>.
If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of `AMBIGUOUS`. See the documentation in `ConnectivityTest` for for more details.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { UpdateConnectivityTestRequest request = UpdateConnectivityTestRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setResource(ConnectivityTest.newBuilder().build()) .build(); OperationFuture<ConnectivityTest, OperationMetadata> future = reachabilityServiceClient.updateConnectivityTestOperationCallable().futureCall(request); // Do something. ConnectivityTest response = future.get(); }
-
updateConnectivityTestCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateConnectivityTestRequest,com.google.longrunning.Operation> updateConnectivityTestCallable()
Updates the configuration of an existing `ConnectivityTest`. After you update a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. The Reachability state in the test resource is updated with the new result.If the endpoint specifications in `ConnectivityTest` are invalid (for example, they contain non-existent resources in the network, or the user does not have read permissions to the network configurations of listed projects), then the reachability result returns a value of <code>UNKNOWN</code>.
If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of `AMBIGUOUS`. See the documentation in `ConnectivityTest` for for more details.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { UpdateConnectivityTestRequest request = UpdateConnectivityTestRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setResource(ConnectivityTest.newBuilder().build()) .build(); ApiFuture<Operation> future = reachabilityServiceClient.updateConnectivityTestCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
rerunConnectivityTestAsync
public final com.google.api.gax.longrunning.OperationFuture<ConnectivityTest,OperationMetadata> rerunConnectivityTestAsync(RerunConnectivityTestRequest request)
Rerun an existing `ConnectivityTest`. After the user triggers the rerun, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes.Even though the test configuration remains the same, the reachability result may change due to underlying network configuration changes.
If the endpoint specifications in `ConnectivityTest` become invalid (for example, specified resources are deleted in the network, or you lost read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { RerunConnectivityTestRequest request = RerunConnectivityTestRequest.newBuilder().setName("name3373707").build(); ConnectivityTest response = reachabilityServiceClient.rerunConnectivityTestAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
rerunConnectivityTestOperationCallable
public final com.google.api.gax.rpc.OperationCallable<RerunConnectivityTestRequest,ConnectivityTest,OperationMetadata> rerunConnectivityTestOperationCallable()
Rerun an existing `ConnectivityTest`. After the user triggers the rerun, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes.Even though the test configuration remains the same, the reachability result may change due to underlying network configuration changes.
If the endpoint specifications in `ConnectivityTest` become invalid (for example, specified resources are deleted in the network, or you lost read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { RerunConnectivityTestRequest request = RerunConnectivityTestRequest.newBuilder().setName("name3373707").build(); OperationFuture<ConnectivityTest, OperationMetadata> future = reachabilityServiceClient.rerunConnectivityTestOperationCallable().futureCall(request); // Do something. ConnectivityTest response = future.get(); }
-
rerunConnectivityTestCallable
public final com.google.api.gax.rpc.UnaryCallable<RerunConnectivityTestRequest,com.google.longrunning.Operation> rerunConnectivityTestCallable()
Rerun an existing `ConnectivityTest`. After the user triggers the rerun, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes.Even though the test configuration remains the same, the reachability result may change due to underlying network configuration changes.
If the endpoint specifications in `ConnectivityTest` become invalid (for example, specified resources are deleted in the network, or you lost read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { RerunConnectivityTestRequest request = RerunConnectivityTestRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = reachabilityServiceClient.rerunConnectivityTestCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteConnectivityTestAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectivityTestAsync(String name)
Deletes a specific `ConnectivityTest`.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { String name = "name3373707"; reachabilityServiceClient.deleteConnectivityTestAsync(name).get(); }
- Parameters:
name
- Required. Connectivity Test resource name using the form: `projects/{project_id}/locations/global/connectivityTests/{test_id}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteConnectivityTestAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectivityTestAsync(DeleteConnectivityTestRequest request)
Deletes a specific `ConnectivityTest`.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { DeleteConnectivityTestRequest request = DeleteConnectivityTestRequest.newBuilder().setName("name3373707").build(); reachabilityServiceClient.deleteConnectivityTestAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteConnectivityTestOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteConnectivityTestRequest,com.google.protobuf.Empty,OperationMetadata> deleteConnectivityTestOperationCallable()
Deletes a specific `ConnectivityTest`.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { DeleteConnectivityTestRequest request = DeleteConnectivityTestRequest.newBuilder().setName("name3373707").build(); OperationFuture<Empty, OperationMetadata> future = reachabilityServiceClient.deleteConnectivityTestOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteConnectivityTestCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteConnectivityTestRequest,com.google.longrunning.Operation> deleteConnectivityTestCallable()
Deletes a specific `ConnectivityTest`.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { DeleteConnectivityTestRequest request = DeleteConnectivityTestRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = reachabilityServiceClient.deleteConnectivityTestCallable().futureCall(request); // Do something. future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-