use of com.google.bigtable.admin.v2.Snapshot in project gapic-generator-java by googleapis.
the class SyncCreateSnapshotSnapshotnameString method syncCreateSnapshotSnapshotnameString.
public static void syncCreateSnapshotSnapshotnameString() throws Exception {
// It may require modifications to work in your environment.
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
}
}
use of com.google.bigtable.admin.v2.Snapshot in project gapic-generator-java by googleapis.
the class SyncCreateSnapshotSnapshotnameSubscriptionname method syncCreateSnapshotSnapshotnameSubscriptionname.
public static void syncCreateSnapshotSnapshotnameSubscriptionname() throws Exception {
// It may require modifications to work in your environment.
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
}
}
use of com.google.bigtable.admin.v2.Snapshot in project gapic-generator-java by googleapis.
the class SyncGetSnapshotString method syncGetSnapshotString.
public static void syncGetSnapshotString() throws Exception {
// It may require modifications to work in your environment.
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
String snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
}
}
use of com.google.bigtable.admin.v2.Snapshot in project gapic-generator-java by googleapis.
the class AsyncListSnapshots method asyncListSnapshots.
public static void asyncListSnapshots() throws Exception {
// It may require modifications to work in your environment.
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();
ApiFuture<Snapshot> future = subscriptionAdminClient.listSnapshotsPagedCallable().futureCall(request);
// Do something.
for (Snapshot element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
}
use of com.google.bigtable.admin.v2.Snapshot in project gapic-generator-java by googleapis.
the class AsyncListSnapshotsPaged method asyncListSnapshotsPaged.
public static void asyncListSnapshotsPaged() throws Exception {
// It may require modifications to work in your environment.
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();
while (true) {
ListSnapshotsResponse response = subscriptionAdminClient.listSnapshotsCallable().call(request);
for (Snapshot element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
}
Aggregations