use of com.google.container.v1.DeleteClusterRequest in project java-bigtable by googleapis.
the class BaseBigtableInstanceAdminClientTest method deleteClusterTest.
@Test
public void deleteClusterTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockBigtableInstanceAdmin.addResponse(expectedResponse);
ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
client.deleteCluster(name);
List<AbstractMessage> actualRequests = mockBigtableInstanceAdmin.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteClusterRequest actualRequest = ((DeleteClusterRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.container.v1.DeleteClusterRequest in project java-bigtable by googleapis.
the class BaseBigtableInstanceAdminClient method deleteCluster.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a cluster from an instance.
*
* <p>Sample code:
*
* <pre>{@code
* try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
* BaseBigtableInstanceAdminClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
* baseBigtableInstanceAdminClient.deleteCluster(name);
* }
* }</pre>
*
* @param name Required. The unique name of the cluster to be deleted. Values are of the form
* `projects/{project}/instances/{instance}/clusters/{cluster}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteCluster(ClusterName name) {
DeleteClusterRequest request = DeleteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteCluster(request);
}
Aggregations