use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.
the class SyncUpgradeInstanceInstancenameString method syncUpgradeInstanceInstancenameString.
public static void syncUpgradeInstanceInstancenameString() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
String redisVersion = "redisVersion-1972584739";
Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get();
}
}
use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.
the class AsyncCreateInstanceLRO method asyncCreateInstanceLRO.
public static void asyncCreateInstanceLRO() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
CreateInstanceRequest request = CreateInstanceRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setInstanceId("instanceId902024336").setInstance(Instance.newBuilder().build()).build();
OperationFuture<Instance, Any> future = cloudRedisClient.createInstanceOperationCallable().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 SyncCreateInstance method syncCreateInstance.
public static void syncCreateInstance() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
CreateInstanceRequest request = CreateInstanceRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setInstanceId("instanceId902024336").setInstance(Instance.newBuilder().build()).build();
Instance response = cloudRedisClient.createInstanceAsync(request).get();
}
}
use of com.google.cloud.compute.v1.Instance in project gapic-generator-java by googleapis.
the class SyncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp method syncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp.
public static void syncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
RescheduleMaintenanceRequest.RescheduleType rescheduleType = RescheduleMaintenanceRequest.RescheduleType.forNumber(0);
Timestamp scheduleTime = Timestamp.newBuilder().build();
Instance response = cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get();
}
}
use of com.google.cloud.compute.v1.Instance in project java-compute by googleapis.
the class ITSmokeInstancesTest method testInsertInstance.
@Test
public void testInsertInstance() throws ExecutionException, InterruptedException {
Instance resultInstance = insertInstance();
assertInstanceDetails(resultInstance);
}
Aggregations