Package com.google.cloud.redis.v1 (2.6.0)

A client to Google Cloud Memorystore for Redis API

The interfaces provided are listed below, along with usage samples.

CloudRedisClient

Service Description: Configures and manages Cloud Memorystore for Redis instances

Google Cloud Memorystore for Redis v1

The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis instances:

  • The service works with a collection of cloud projects, named: /projects/*
  • Each project has a collection of available locations, named: /locations/*
  • Each location has a collection of Redis instances, named: /instances/*
  • As such, Redis instances are resources of the form: /projects/{project_id}/locations/{location_id}/instances/{instance_id}

Note that location_id must be referring to a GCP region; for example:

  • projects/redpepper-1290/locations/us-central1/instances/my-redis

Sample for CloudRedisClient:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   Instance response = cloudRedisClient.getInstance(name);
 }
 

Classes

CloudRedisClient

Service Description: Configures and manages Cloud Memorystore for Redis instances

Google Cloud Memorystore for Redis v1

The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis instances:

  • The service works with a collection of cloud projects, named: /projects/*
  • Each project has a collection of available locations, named: /locations/*
  • Each location has a collection of Redis instances, named: /instances/*
  • As such, Redis instances are resources of the form: /projects/{project_id}/locations/{location_id}/instances/{instance_id}

Note that location_id must be referring to a GCP region; for example:

  • projects/redpepper-1290/locations/us-central1/instances/my-redis

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   Instance response = cloudRedisClient.getInstance(name);
 }
 

Note: close() needs to be called on the CloudRedisClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of CloudRedisSettings to create(). For example:

To customize credentials:


 // 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);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CloudRedisSettings cloudRedisSettings =
     CloudRedisSettings.newBuilder().setEndpoint(myEndpoint).build();
 CloudRedisClient cloudRedisClient = CloudRedisClient.create(cloudRedisSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 CloudRedisSettings cloudRedisSettings =
     CloudRedisSettings.newBuilder()
         .setTransportChannelProvider(
             CloudRedisSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 CloudRedisClient cloudRedisClient = CloudRedisClient.create(cloudRedisSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

CloudRedisClient.ListInstancesFixedSizeCollection

CloudRedisClient.ListInstancesPage

CloudRedisClient.ListInstancesPagedResponse

CloudRedisGrpc

Configures and manages Cloud Memorystore for Redis instances Google Cloud Memorystore for Redis v1 The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis instances:

  • The service works with a collection of cloud projects, named: /projects/*
  • Each project has a collection of available locations, named: /locations/*
  • Each location has a collection of Redis instances, named: /instances/*
  • As such, Redis instances are resources of the form: /projects/{project_id}/locations/{location_id}/instances/{instance_id} Note that location_id must be referring to a GCP region; for example:
  • projects/redpepper-1290/locations/us-central1/instances/my-redis

CloudRedisGrpc.CloudRedisBlockingStub

Configures and manages Cloud Memorystore for Redis instances Google Cloud Memorystore for Redis v1 The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis instances:

  • The service works with a collection of cloud projects, named: /projects/*
  • Each project has a collection of available locations, named: /locations/*
  • Each location has a collection of Redis instances, named: /instances/*
  • As such, Redis instances are resources of the form: /projects/{project_id}/locations/{location_id}/instances/{instance_id} Note that location_id must be referring to a GCP region; for example:
  • projects/redpepper-1290/locations/us-central1/instances/my-redis

CloudRedisGrpc.CloudRedisFutureStub

Configures and manages Cloud Memorystore for Redis instances Google Cloud Memorystore for Redis v1 The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis instances:

  • The service works with a collection of cloud projects, named: /projects/*
  • Each project has a collection of available locations, named: /locations/*
  • Each location has a collection of Redis instances, named: /instances/*
  • As such, Redis instances are resources of the form: /projects/{project_id}/locations/{location_id}/instances/{instance_id} Note that location_id must be referring to a GCP region; for example:
  • projects/redpepper-1290/locations/us-central1/instances/my-redis

CloudRedisGrpc.CloudRedisImplBase

Configures and manages Cloud Memorystore for Redis instances Google Cloud Memorystore for Redis v1 The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis instances:

  • The service works with a collection of cloud projects, named: /projects/*
  • Each project has a collection of available locations, named: /locations/*
  • Each location has a collection of Redis instances, named: /instances/*
  • As such, Redis instances are resources of the form: /projects/{project_id}/locations/{location_id}/instances/{instance_id} Note that location_id must be referring to a GCP region; for example:
  • projects/redpepper-1290/locations/us-central1/instances/my-redis

CloudRedisGrpc.CloudRedisStub

Configures and manages Cloud Memorystore for Redis instances Google Cloud Memorystore for Redis v1 The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis instances:

  • The service works with a collection of cloud projects, named: /projects/*
  • Each project has a collection of available locations, named: /locations/*
  • Each location has a collection of Redis instances, named: /instances/*
  • As such, Redis instances are resources of the form: /projects/{project_id}/locations/{location_id}/instances/{instance_id} Note that location_id must be referring to a GCP region; for example:
  • projects/redpepper-1290/locations/us-central1/instances/my-redis

CloudRedisServiceV1Proto

CloudRedisSettings

Settings class to configure an instance of CloudRedisClient.

The default instance has everything set to sensible defaults:

  • The default service address (redis.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of getInstance to 30 seconds:


 // 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();
 

CloudRedisSettings.Builder

Builder for CloudRedisSettings.

CreateInstanceRequest

Request for CreateInstance.

Protobuf type google.cloud.redis.v1.CreateInstanceRequest

CreateInstanceRequest.Builder

Request for CreateInstance.

Protobuf type google.cloud.redis.v1.CreateInstanceRequest

DeleteInstanceRequest

Request for DeleteInstance.

Protobuf type google.cloud.redis.v1.DeleteInstanceRequest

DeleteInstanceRequest.Builder

Request for DeleteInstance.

Protobuf type google.cloud.redis.v1.DeleteInstanceRequest

ExportInstanceRequest

Request for Export.

Protobuf type google.cloud.redis.v1.ExportInstanceRequest

ExportInstanceRequest.Builder

Request for Export.

Protobuf type google.cloud.redis.v1.ExportInstanceRequest

FailoverInstanceRequest

Request for Failover.

Protobuf type google.cloud.redis.v1.FailoverInstanceRequest

FailoverInstanceRequest.Builder

Request for Failover.

Protobuf type google.cloud.redis.v1.FailoverInstanceRequest

GcsDestination

The Cloud Storage location for the output content

Protobuf type google.cloud.redis.v1.GcsDestination

GcsDestination.Builder

The Cloud Storage location for the output content

Protobuf type google.cloud.redis.v1.GcsDestination

GcsSource

The Cloud Storage location for the input content

Protobuf type google.cloud.redis.v1.GcsSource

GcsSource.Builder

The Cloud Storage location for the input content

Protobuf type google.cloud.redis.v1.GcsSource

GetInstanceAuthStringRequest

Request for GetInstanceAuthString.

Protobuf type google.cloud.redis.v1.GetInstanceAuthStringRequest

GetInstanceAuthStringRequest.Builder

Request for GetInstanceAuthString.

Protobuf type google.cloud.redis.v1.GetInstanceAuthStringRequest

GetInstanceRequest

Request for GetInstance.

Protobuf type google.cloud.redis.v1.GetInstanceRequest

GetInstanceRequest.Builder

Request for GetInstance.

Protobuf type google.cloud.redis.v1.GetInstanceRequest

ImportInstanceRequest

Request for Import.

Protobuf type google.cloud.redis.v1.ImportInstanceRequest

ImportInstanceRequest.Builder

Request for Import.

Protobuf type google.cloud.redis.v1.ImportInstanceRequest

InputConfig

The input content

Protobuf type google.cloud.redis.v1.InputConfig

InputConfig.Builder

The input content

Protobuf type google.cloud.redis.v1.InputConfig

Instance

A Memorystore for Redis instance.

Protobuf type google.cloud.redis.v1.Instance

Instance.Builder

A Memorystore for Redis instance.

Protobuf type google.cloud.redis.v1.Instance

InstanceAuthString

Instance AUTH string details.

Protobuf type google.cloud.redis.v1.InstanceAuthString

InstanceAuthString.Builder

Instance AUTH string details.

Protobuf type google.cloud.redis.v1.InstanceAuthString

InstanceName

InstanceName.Builder

Builder for projects/{project}/locations/{location}/instances/{instance}.

ListInstancesRequest

Request for ListInstances.

Protobuf type google.cloud.redis.v1.ListInstancesRequest

ListInstancesRequest.Builder

Request for ListInstances.

Protobuf type google.cloud.redis.v1.ListInstancesRequest

ListInstancesResponse

Response for ListInstances.

Protobuf type google.cloud.redis.v1.ListInstancesResponse

ListInstancesResponse.Builder

Response for ListInstances.

Protobuf type google.cloud.redis.v1.ListInstancesResponse

LocationMetadata

This location metadata represents additional configuration options for a given location where a Redis instance may be created. All fields are output only. It is returned as content of the google.cloud.location.Location.metadata field.

Protobuf type google.cloud.redis.v1.LocationMetadata

LocationMetadata.Builder

This location metadata represents additional configuration options for a given location where a Redis instance may be created. All fields are output only. It is returned as content of the google.cloud.location.Location.metadata field.

Protobuf type google.cloud.redis.v1.LocationMetadata

LocationName

LocationName.Builder

Builder for projects/{project}/locations/{location}.

MaintenancePolicy

Maintenance policy for an instance.

Protobuf type google.cloud.redis.v1.MaintenancePolicy

MaintenancePolicy.Builder

Maintenance policy for an instance.

Protobuf type google.cloud.redis.v1.MaintenancePolicy

MaintenanceSchedule

Upcoming maintenance schedule. If no maintenance is scheduled, fields are not populated.

Protobuf type google.cloud.redis.v1.MaintenanceSchedule

MaintenanceSchedule.Builder

Upcoming maintenance schedule. If no maintenance is scheduled, fields are not populated.

Protobuf type google.cloud.redis.v1.MaintenanceSchedule

NodeInfo

Node specific properties.

Protobuf type google.cloud.redis.v1.NodeInfo

NodeInfo.Builder

Node specific properties.

Protobuf type google.cloud.redis.v1.NodeInfo

OperationMetadata

Represents the v1 metadata of the long-running operation.

Protobuf type google.cloud.redis.v1.OperationMetadata

OperationMetadata.Builder

Represents the v1 metadata of the long-running operation.

Protobuf type google.cloud.redis.v1.OperationMetadata

OutputConfig

The output content

Protobuf type google.cloud.redis.v1.OutputConfig

OutputConfig.Builder

The output content

Protobuf type google.cloud.redis.v1.OutputConfig

RescheduleMaintenanceRequest

Request for RescheduleMaintenance.

Protobuf type google.cloud.redis.v1.RescheduleMaintenanceRequest

RescheduleMaintenanceRequest.Builder

Request for RescheduleMaintenance.

Protobuf type google.cloud.redis.v1.RescheduleMaintenanceRequest

TlsCertificate

TlsCertificate Resource

Protobuf type google.cloud.redis.v1.TlsCertificate

TlsCertificate.Builder

TlsCertificate Resource

Protobuf type google.cloud.redis.v1.TlsCertificate

UpdateInstanceRequest

Request for UpdateInstance.

Protobuf type google.cloud.redis.v1.UpdateInstanceRequest

UpdateInstanceRequest.Builder

Request for UpdateInstance.

Protobuf type google.cloud.redis.v1.UpdateInstanceRequest

UpgradeInstanceRequest

Request for UpgradeInstance.

Protobuf type google.cloud.redis.v1.UpgradeInstanceRequest

UpgradeInstanceRequest.Builder

Request for UpgradeInstance.

Protobuf type google.cloud.redis.v1.UpgradeInstanceRequest

WeeklyMaintenanceWindow

Time window in which disruptive maintenance updates occur. Non-disruptive updates can occur inside or outside this window.

Protobuf type google.cloud.redis.v1.WeeklyMaintenanceWindow

WeeklyMaintenanceWindow.Builder

Time window in which disruptive maintenance updates occur. Non-disruptive updates can occur inside or outside this window.

Protobuf type google.cloud.redis.v1.WeeklyMaintenanceWindow

ZoneMetadata

Defines specific information for a particular zone. Currently empty and reserved for future use only.

Protobuf type google.cloud.redis.v1.ZoneMetadata

ZoneMetadata.Builder

Defines specific information for a particular zone. Currently empty and reserved for future use only.

Protobuf type google.cloud.redis.v1.ZoneMetadata

Interfaces

CreateInstanceRequestOrBuilder

DeleteInstanceRequestOrBuilder

ExportInstanceRequestOrBuilder

FailoverInstanceRequestOrBuilder

GcsDestinationOrBuilder

GcsSourceOrBuilder

GetInstanceAuthStringRequestOrBuilder

GetInstanceRequestOrBuilder

ImportInstanceRequestOrBuilder

InputConfigOrBuilder

InstanceAuthStringOrBuilder

InstanceOrBuilder

ListInstancesRequestOrBuilder

ListInstancesResponseOrBuilder

LocationMetadataOrBuilder

MaintenancePolicyOrBuilder

MaintenanceScheduleOrBuilder

NodeInfoOrBuilder

OperationMetadataOrBuilder

OutputConfigOrBuilder

RescheduleMaintenanceRequestOrBuilder

TlsCertificateOrBuilder

UpdateInstanceRequestOrBuilder

UpgradeInstanceRequestOrBuilder

WeeklyMaintenanceWindowOrBuilder

ZoneMetadataOrBuilder

Enums

FailoverInstanceRequest.DataProtectionMode

Specifies different modes of operation in relation to the data retention.

Protobuf enum google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode

InputConfig.SourceCase

Instance.ConnectMode

Available connection modes.

Protobuf enum google.cloud.redis.v1.Instance.ConnectMode

Instance.ReadReplicasMode

Read replicas mode.

Protobuf enum google.cloud.redis.v1.Instance.ReadReplicasMode

Instance.State

Represents the different states of a Redis instance.

Protobuf enum google.cloud.redis.v1.Instance.State

Instance.Tier

Available service tiers to choose from

Protobuf enum google.cloud.redis.v1.Instance.Tier

Instance.TransitEncryptionMode

Available TLS modes.

Protobuf enum google.cloud.redis.v1.Instance.TransitEncryptionMode

OutputConfig.DestinationCase

RescheduleMaintenanceRequest.RescheduleType

Reschedule options.

Protobuf enum google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType