use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.
the class AsyncImportInstanceLRO method asyncImportInstanceLRO.
public static void asyncImportInstanceLRO() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
ImportInstanceRequest request = ImportInstanceRequest.newBuilder().setName("name3373707").setInputConfig(InputConfig.newBuilder().build()).build();
OperationFuture<Instance, Any> future = cloudRedisClient.importInstanceOperationCallable().futureCall(request);
// Do something.
Instance response = future.get();
}
}
use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.
the class SyncImportInstance method syncImportInstance.
public static void syncImportInstance() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
ImportInstanceRequest request = ImportInstanceRequest.newBuilder().setName("name3373707").setInputConfig(InputConfig.newBuilder().build()).build();
Instance response = cloudRedisClient.importInstanceAsync(request).get();
}
}
use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.
the class AsyncListInstancesPaged method asyncListInstancesPaged.
public static void asyncListInstancesPaged() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").build();
while (true) {
ListInstancesResponse response = cloudRedisClient.listInstancesCallable().call(request);
for (Instance element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
}
use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.
the class AsyncUpgradeInstanceLRO method asyncUpgradeInstanceLRO.
public static void asyncUpgradeInstanceLRO() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).setRedisVersion("redisVersion-1972584739").build();
OperationFuture<Instance, Any> future = cloudRedisClient.upgradeInstanceOperationCallable().futureCall(request);
// Do something.
Instance response = future.get();
}
}
use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.
the class SyncUpgradeInstance method syncUpgradeInstance.
public static void syncUpgradeInstance() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).setRedisVersion("redisVersion-1972584739").build();
Instance response = cloudRedisClient.upgradeInstanceAsync(request).get();
}
}
Aggregations