Search in sources :

Example 1 with CloudRedisSettings

use of com.google.cloud.redis.v1beta1.CloudRedisSettings in project gapic-generator-java by googleapis.

the class SyncCreateSetCredentialsProvider method syncCreateSetCredentialsProvider.

public static void syncCreateSetCredentialsProvider() throws Exception {
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    CloudRedisSettings cloudRedisSettings = CloudRedisSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)).build();
    CloudRedisClient cloudRedisClient = CloudRedisClient.create(cloudRedisSettings);
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) CloudRedisSettings(com.google.cloud.redis.v1beta1.CloudRedisSettings)

Example 2 with CloudRedisSettings

use of com.google.cloud.redis.v1beta1.CloudRedisSettings in project java-redis by googleapis.

the class ITSystemTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    CloudRedisSettings.Builder cloudRedisSettingsBuilder = CloudRedisSettings.newBuilder();
    cloudRedisSettingsBuilder.getInstanceSettings().setRetrySettings(cloudRedisSettingsBuilder.getInstanceSettings().getRetrySettings().toBuilder().setTotalTimeout(Duration.ofSeconds(900)).build());
    CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
    client = CloudRedisClient.create(cloudRedisSettings);
    /* Creates a Redis instance based on the specified tier and memory size. */
    Instance instance = Instance.newBuilder().setTier(TIER).setMemorySizeGb(1).setAuthorizedNetwork(AUTHORIZED_NETWORK).build();
    client.createInstanceAsync(PARENT, INSTANCE, instance).get();
    LOG.info("redis instance created successfully.");
}
Also used : Instance(com.google.cloud.redis.v1beta1.Instance) CloudRedisSettings(com.google.cloud.redis.v1beta1.CloudRedisSettings) BeforeClass(org.junit.BeforeClass)

Example 3 with CloudRedisSettings

use of com.google.cloud.redis.v1beta1.CloudRedisSettings in project java-redis by googleapis.

the class ITSystemTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    CloudRedisSettings.Builder cloudRedisSettingsBuilder = CloudRedisSettings.newBuilder();
    cloudRedisSettingsBuilder.getInstanceSettings().setRetrySettings(cloudRedisSettingsBuilder.getInstanceSettings().getRetrySettings().toBuilder().setTotalTimeout(Duration.ofSeconds(900)).build());
    CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
    client = CloudRedisClient.create(cloudRedisSettings);
    /* Clean up old instances that were not deleted. */
    cleanUpOldInstances();
    /* Creates a Redis instance based on the specified tier and memory size. */
    Instance instance = Instance.newBuilder().setTier(TIER).setMemorySizeGb(1).setAuthorizedNetwork(AUTHORIZED_NETWORK).build();
    client.createInstanceAsync(PARENT, INSTANCE, instance).get();
    LOG.info("redis instance created successfully.");
}
Also used : Instance(com.google.cloud.redis.v1.Instance) CloudRedisSettings(com.google.cloud.redis.v1.CloudRedisSettings) BeforeClass(org.junit.BeforeClass)

Example 4 with CloudRedisSettings

use of com.google.cloud.redis.v1beta1.CloudRedisSettings in project gapic-generator-java by googleapis.

the class SyncGetInstance method syncGetInstance.

public static void syncGetInstance() throws Exception {
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    CloudRedisSettings.Builder cloudRedisSettingsBuilder = CloudRedisSettings.newBuilder();
    cloudRedisSettingsBuilder.getInstanceSettings().setRetrySettings(cloudRedisSettingsBuilder.getInstanceSettings().getRetrySettings().toBuilder().setTotalTimeout(Duration.ofSeconds(30)).build());
    CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
}
Also used : CloudRedisSettings(com.google.cloud.redis.v1beta1.CloudRedisSettings)

Example 5 with CloudRedisSettings

use of com.google.cloud.redis.v1beta1.CloudRedisSettings in project gapic-generator-java by googleapis.

the class SyncGetInstance method syncGetInstance.

public static void syncGetInstance() throws Exception {
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    CloudRedisStubSettings.Builder cloudRedisSettingsBuilder = CloudRedisStubSettings.newBuilder();
    cloudRedisSettingsBuilder.getInstanceSettings().setRetrySettings(cloudRedisSettingsBuilder.getInstanceSettings().getRetrySettings().toBuilder().setTotalTimeout(Duration.ofSeconds(30)).build());
    CloudRedisStubSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
}
Also used : CloudRedisStubSettings(com.google.cloud.redis.v1beta1.stub.CloudRedisStubSettings)

Aggregations

CloudRedisSettings (com.google.cloud.redis.v1beta1.CloudRedisSettings)4 CloudRedisClient (com.google.cloud.redis.v1beta1.CloudRedisClient)2 BeforeClass (org.junit.BeforeClass)2 CloudRedisSettings (com.google.cloud.redis.v1.CloudRedisSettings)1 Instance (com.google.cloud.redis.v1.Instance)1 Instance (com.google.cloud.redis.v1beta1.Instance)1 CloudRedisStubSettings (com.google.cloud.redis.v1beta1.stub.CloudRedisStubSettings)1