Search in sources :

Example 11 with Instance

use of com.google.bigtable.admin.v2.Instance in project java-bigtable by googleapis.

the class BaseBigtableTableAdminClient method deleteTable.

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
 * Permanently deletes a specified table and all of its data.
 *
 * <p>Sample code:
 *
 * <pre>{@code
 * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
 *     BaseBigtableTableAdminClient.create()) {
 *   String name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
 *   baseBigtableTableAdminClient.deleteTable(name);
 * }
 * }</pre>
 *
 * @param name Required. The unique name of the table to be deleted. Values are of the form
 *     `projects/{project}/instances/{instance}/tables/{table}`.
 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
 */
public final void deleteTable(String name) {
    DeleteTableRequest request = DeleteTableRequest.newBuilder().setName(name).build();
    deleteTable(request);
}
Also used : DeleteTableRequest(com.google.bigtable.admin.v2.DeleteTableRequest)

Example 12 with Instance

use of com.google.bigtable.admin.v2.Instance in project java-bigtable by googleapis.

the class BaseBigtableTableAdminClient method deleteBackup.

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
 * Deletes a pending or completed Cloud Bigtable backup.
 *
 * <p>Sample code:
 *
 * <pre>{@code
 * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
 *     BaseBigtableTableAdminClient.create()) {
 *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
 *   baseBigtableTableAdminClient.deleteBackup(name);
 * }
 * }</pre>
 *
 * @param name Required. Name of the backup to delete. Values are of the form
 *     `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
 */
public final void deleteBackup(BackupName name) {
    DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build();
    deleteBackup(request);
}
Also used : DeleteBackupRequest(com.google.bigtable.admin.v2.DeleteBackupRequest)

Example 13 with Instance

use of com.google.bigtable.admin.v2.Instance in project java-bigtable by googleapis.

the class BaseBigtableTableAdminClient method deleteSnapshot.

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
 * Permanently deletes the specified snapshot.
 *
 * <p>Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not
 * currently available to most Cloud Bigtable customers. This feature might be changed in
 * backward-incompatible ways and is not recommended for production use. It is not subject to any
 * SLA or deprecation policy.
 *
 * <p>Sample code:
 *
 * <pre>{@code
 * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
 *     BaseBigtableTableAdminClient.create()) {
 *   SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
 *   baseBigtableTableAdminClient.deleteSnapshot(name);
 * }
 * }</pre>
 *
 * @param name Required. The unique name of the snapshot to be deleted. Values are of the form
 *     `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
 */
public final void deleteSnapshot(SnapshotName name) {
    DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build();
    deleteSnapshot(request);
}
Also used : DeleteSnapshotRequest(com.google.bigtable.admin.v2.DeleteSnapshotRequest)

Example 14 with Instance

use of com.google.bigtable.admin.v2.Instance in project java-bigtable by googleapis.

the class BaseBigtableTableAdminClient method deleteSnapshot.

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
 * Permanently deletes the specified snapshot.
 *
 * <p>Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not
 * currently available to most Cloud Bigtable customers. This feature might be changed in
 * backward-incompatible ways and is not recommended for production use. It is not subject to any
 * SLA or deprecation policy.
 *
 * <p>Sample code:
 *
 * <pre>{@code
 * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
 *     BaseBigtableTableAdminClient.create()) {
 *   String name =
 *       SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString();
 *   baseBigtableTableAdminClient.deleteSnapshot(name);
 * }
 * }</pre>
 *
 * @param name Required. The unique name of the snapshot to be deleted. Values are of the form
 *     `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
 */
public final void deleteSnapshot(String name) {
    DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder().setName(name).build();
    deleteSnapshot(request);
}
Also used : DeleteSnapshotRequest(com.google.bigtable.admin.v2.DeleteSnapshotRequest)

Example 15 with Instance

use of com.google.bigtable.admin.v2.Instance in project java-bigtable by googleapis.

the class BaseBigtableTableAdminClient method deleteBackup.

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
 * Deletes a pending or completed Cloud Bigtable backup.
 *
 * <p>Sample code:
 *
 * <pre>{@code
 * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
 *     BaseBigtableTableAdminClient.create()) {
 *   String name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
 *   baseBigtableTableAdminClient.deleteBackup(name);
 * }
 * }</pre>
 *
 * @param name Required. Name of the backup to delete. Values are of the form
 *     `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
 */
public final void deleteBackup(String name) {
    DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build();
    deleteBackup(request);
}
Also used : DeleteBackupRequest(com.google.bigtable.admin.v2.DeleteBackupRequest)

Aggregations

Test (org.junit.Test)108 AbstractMessage (com.google.protobuf.AbstractMessage)55 ByteString (com.google.protobuf.ByteString)49 InvalidArgumentException (com.google.api.gax.rpc.InvalidArgumentException)37 StatusRuntimeException (io.grpc.StatusRuntimeException)37 InstanceName (com.google.bigtable.admin.v2.InstanceName)20 Operation (com.google.longrunning.Operation)19 HashMap (java.util.HashMap)16 Table (com.google.bigtable.admin.v2.Table)15 TableName (com.google.bigtable.admin.v2.TableName)15 ClusterName (com.google.bigtable.admin.v2.ClusterName)14 Cluster (com.google.bigtable.admin.v2.Cluster)13 ColumnFamily (com.google.bigtable.admin.v2.ColumnFamily)13 ExecutionException (java.util.concurrent.ExecutionException)13 Instance (com.google.cloud.compute.v1.Instance)11 InstancesClient (com.google.cloud.compute.v1.InstancesClient)11 Instance (com.google.bigtable.admin.v2.Instance)10 SnapshotName (com.google.bigtable.admin.v2.SnapshotName)8 Empty (com.google.protobuf.Empty)8 Backup (com.google.bigtable.admin.v2.Backup)7