use of com.google.cloud.notebooks.v1beta1.DeleteInstanceRequest in project java-spanner by googleapis.
the class InstanceAdminClient method deleteInstance.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an instance.
*
* <p>Immediately upon completion of the request:
*
* <p>* Billing ceases for all of the instance's reserved resources.
*
* <p>Soon afterward:
*
* <p>* The instance and *all of its databases* immediately and irrevocably disappear
* from the API. All data in the databases is permanently deleted.
*
* <p>Sample code:
*
* <pre>{@code
* try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
* instanceAdminClient.deleteInstance(name);
* }
* }</pre>
*
* @param name Required. The name of the instance to be deleted. Values are of the form
* `projects/<project>/instances/<instance>`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteInstance(InstanceName name) {
DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteInstance(request);
}
use of com.google.cloud.notebooks.v1beta1.DeleteInstanceRequest in project java-bigtable by googleapis.
the class BaseBigtableInstanceAdminClientTest method deleteInstanceTest.
@Test
public void deleteInstanceTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockBigtableInstanceAdmin.addResponse(expectedResponse);
InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
client.deleteInstance(name);
List<AbstractMessage> actualRequests = mockBigtableInstanceAdmin.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.notebooks.v1beta1.DeleteInstanceRequest in project java-bigtable by googleapis.
the class BaseBigtableInstanceAdminClient method deleteInstance.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Delete an instance from a project.
*
* <p>Sample code:
*
* <pre>{@code
* try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
* BaseBigtableInstanceAdminClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
* baseBigtableInstanceAdminClient.deleteInstance(name);
* }
* }</pre>
*
* @param name Required. The unique name of the instance to be deleted. Values are of the form
* `projects/{project}/instances/{instance}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteInstance(InstanceName name) {
DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteInstance(request);
}
use of com.google.cloud.notebooks.v1beta1.DeleteInstanceRequest in project java-notebooks by googleapis.
the class ITNotebookServiceClientTest method tearDown.
@AfterClass
public static void tearDown() throws ExecutionException, InterruptedException {
// Delete Test Environment Instance
DeleteEnvironmentRequest deleteEnvironmentRequest = DeleteEnvironmentRequest.newBuilder().setName(ENVIRONMENT_NAME).build();
client.deleteEnvironmentAsync(deleteEnvironmentRequest).get();
// Delete Test Notebook Instance
DeleteInstanceRequest deleteInstanceRequest = DeleteInstanceRequest.newBuilder().setName(INSTANCE_NAME).build();
client.deleteInstanceAsync(deleteInstanceRequest).get();
client.close();
}
use of com.google.cloud.notebooks.v1beta1.DeleteInstanceRequest in project java-spanner by googleapis.
the class InstanceAdminClient method deleteInstance.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an instance.
*
* <p>Immediately upon completion of the request:
*
* <p>* Billing ceases for all of the instance's reserved resources.
*
* <p>Soon afterward:
*
* <p>* The instance and *all of its databases* immediately and irrevocably disappear
* from the API. All data in the databases is permanently deleted.
*
* <p>Sample code:
*
* <pre>{@code
* try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) {
* String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
* instanceAdminClient.deleteInstance(name);
* }
* }</pre>
*
* @param name Required. The name of the instance to be deleted. Values are of the form
* `projects/<project>/instances/<instance>`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteInstance(String name) {
DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build();
deleteInstance(request);
}
Aggregations