use of com.google.cloud.redis.v1beta1.Instance in project gapic-generator-java by googleapis.
the class SyncGetInstanceAuthString method syncGetInstanceAuthString.
public static void syncGetInstanceAuthString() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
GetInstanceAuthStringRequest request = GetInstanceAuthStringRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
InstanceAuthString response = cloudRedisClient.getInstanceAuthString(request);
}
}
use of com.google.cloud.redis.v1beta1.Instance in project gapic-generator-java by googleapis.
the class SyncGetInstanceAuthStringString method syncGetInstanceAuthStringString.
public static void syncGetInstanceAuthStringString() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name);
}
}
use of com.google.cloud.redis.v1beta1.Instance in project gapic-generator-java by googleapis.
the class SyncImportInstanceStringInputconfig method syncImportInstanceStringInputconfig.
public static void syncImportInstanceStringInputconfig() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
String name = "name3373707";
InputConfig inputConfig = InputConfig.newBuilder().build();
Instance response = cloudRedisClient.importInstanceAsync(name, inputConfig).get();
}
}
use of com.google.cloud.redis.v1beta1.Instance in project gapic-generator-java by googleapis.
the class AsyncListInstances method asyncListInstances.
public static void asyncListInstances() 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();
ApiFuture<Instance> future = cloudRedisClient.listInstancesPagedCallable().futureCall(request);
// Do something.
for (Instance element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
}
use of com.google.cloud.redis.v1beta1.Instance in project gapic-generator-java by googleapis.
the class AsyncDeleteInstance method asyncDeleteInstance.
public static void asyncDeleteInstance() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
ApiFuture<Operation> future = cloudRedisClient.deleteInstanceCallable().futureCall(request);
// Do something.
future.get();
}
}
Aggregations