CRI Provider implementation (#195)

* First commit of CRI provider. Vendor deps not included

* First commit of CRI provider. Vendor deps not included

* Tidy up comments and format code

* vendor grpc, CRI APIs, update protobuf and tidy logging

* First commit of CRI provider. Vendor deps not included

* Tidy up comments and format code

* vendor grpc, CRI APIs, update protobuf and tidy logging

* Add README

* Fix errors in make test
This commit is contained in:
Ben Corrie
2018-05-15 08:50:52 -07:00
committed by Ria Bhatia
parent 4b61932ac1
commit c6c89f062f
702 changed files with 456968 additions and 11190 deletions

View File

@@ -0,0 +1,905 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/cloud/redis/v1beta1/cloud_redis.proto
/*
Package redis is a generated protocol buffer package.
It is generated from these files:
google/cloud/redis/v1beta1/cloud_redis.proto
It has these top-level messages:
Instance
ListInstancesRequest
ListInstancesResponse
GetInstanceRequest
CreateInstanceRequest
UpdateInstanceRequest
DeleteInstanceRequest
LocationMetadata
ZoneMetadata
*/
package redis
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "google.golang.org/genproto/googleapis/api/annotations"
import google_longrunning "google.golang.org/genproto/googleapis/longrunning"
import google_protobuf3 "google.golang.org/genproto/protobuf/field_mask"
import google_protobuf4 "github.com/golang/protobuf/ptypes/timestamp"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// Represents the different states of a Redis instance.
type Instance_State int32
const (
// Not set.
Instance_STATE_UNSPECIFIED Instance_State = 0
// Redis instance is being created.
Instance_CREATING Instance_State = 1
// Redis instance has been created and is fully usable.
Instance_READY Instance_State = 2
// Redis instance configuration is being updated. Certain kinds of updates
// may cause the instance to become unusable while the update is in
// progress.
Instance_UPDATING Instance_State = 3
// Redis instance is being deleted.
Instance_DELETING Instance_State = 4
// Redis instance is being repaired and may be unusable. Details can be
// found in the `status_message` field.
Instance_REPAIRING Instance_State = 5
// Maintenance is being performed on this Redis instance.
Instance_MAINTENANCE Instance_State = 6
)
var Instance_State_name = map[int32]string{
0: "STATE_UNSPECIFIED",
1: "CREATING",
2: "READY",
3: "UPDATING",
4: "DELETING",
5: "REPAIRING",
6: "MAINTENANCE",
}
var Instance_State_value = map[string]int32{
"STATE_UNSPECIFIED": 0,
"CREATING": 1,
"READY": 2,
"UPDATING": 3,
"DELETING": 4,
"REPAIRING": 5,
"MAINTENANCE": 6,
}
func (x Instance_State) String() string {
return proto.EnumName(Instance_State_name, int32(x))
}
func (Instance_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} }
// Available service tiers to choose from
type Instance_Tier int32
const (
// Not set.
Instance_TIER_UNSPECIFIED Instance_Tier = 0
// BASIC tier: standalone instance
Instance_BASIC Instance_Tier = 1
// STANDARD_HA tier: highly available primary/replica instances
Instance_STANDARD_HA Instance_Tier = 3
)
var Instance_Tier_name = map[int32]string{
0: "TIER_UNSPECIFIED",
1: "BASIC",
3: "STANDARD_HA",
}
var Instance_Tier_value = map[string]int32{
"TIER_UNSPECIFIED": 0,
"BASIC": 1,
"STANDARD_HA": 3,
}
func (x Instance_Tier) String() string {
return proto.EnumName(Instance_Tier_name, int32(x))
}
func (Instance_Tier) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 1} }
// A Google Cloud Redis instance.
type Instance struct {
// Required. Unique name of the resource in this scope including project and
// location using the form:
// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
//
// Note: Redis instances are managed and addressed at regional level so
// location_id here refers to a GCP region; however, users get to choose which
// specific zone (or collection of zones for cross-zone instances) an instance
// should be provisioned in. Refer to [location_id] and
// [alternative_location_id] fields for more details.
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
// An arbitrary and optional user-provided name for the instance.
DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName" json:"display_name,omitempty"`
// Resource labels to represent user provided metadata
Labels map[string]string `protobuf:"bytes,3,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// Optional. The zone where the instance will be provisioned. If not provided,
// the service will choose a zone for the instance. For STANDARD_HA tier,
// instances will be created across two zones for protection against zonal
// failures. if [alternative_location_id] is also provided, it must be
// different from [location_id].
LocationId string `protobuf:"bytes,4,opt,name=location_id,json=locationId" json:"location_id,omitempty"`
// Optional. Only applicable to STANDARD_HA tier which protects the instance
// against zonal failures by provisioning it across two zones. If provided, it
// must be a different zone from the one provided in [location_id].
AlternativeLocationId string `protobuf:"bytes,5,opt,name=alternative_location_id,json=alternativeLocationId" json:"alternative_location_id,omitempty"`
// Optional. The version of Redis software.
// If not provided, latest supported version will be used.
RedisVersion string `protobuf:"bytes,7,opt,name=redis_version,json=redisVersion" json:"redis_version,omitempty"`
// Optional. The CIDR range of internal addresses that are reserved for this
// instance. If not provided, the service will choose an unused /29 block,
// for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
// and non-overlapping with existing subnets in a network.
ReservedIpRange string `protobuf:"bytes,9,opt,name=reserved_ip_range,json=reservedIpRange" json:"reserved_ip_range,omitempty"`
// Output only. Hostname or IP address of the exposed redis endpoint used by
// clients to connect to the service.
Host string `protobuf:"bytes,10,opt,name=host" json:"host,omitempty"`
// Output only. The port number of the exposed redis endpoint.
Port int32 `protobuf:"varint,11,opt,name=port" json:"port,omitempty"`
// Output only. The current zone where the Redis endpoint is placed. In
// single zone deployments, this will always be the same as [location_id]
// provided by the user at creation time. In cross-zone instances (only
// applicable in STANDARD_HA tier), this can be either [location_id] or
// [alternative_location_id] and can change on a failover event.
CurrentLocationId string `protobuf:"bytes,12,opt,name=current_location_id,json=currentLocationId" json:"current_location_id,omitempty"`
// Output only. The time the instance was created.
CreateTime *google_protobuf4.Timestamp `protobuf:"bytes,13,opt,name=create_time,json=createTime" json:"create_time,omitempty"`
// Output only. The current state of this instance.
State Instance_State `protobuf:"varint,14,opt,name=state,enum=google.cloud.redis.v1beta1.Instance_State" json:"state,omitempty"`
// Output only. Additional information about the current status of this
// instance, if available.
StatusMessage string `protobuf:"bytes,15,opt,name=status_message,json=statusMessage" json:"status_message,omitempty"`
// Optional. Redis configuration parameters, according to
// http://redis.io/topics/config. Currently, the only supported parameters
// are:
// * maxmemory-policy
// * notify-keyspace-events
RedisConfigs map[string]string `protobuf:"bytes,16,rep,name=redis_configs,json=redisConfigs" json:"redis_configs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// Required. The service tier of the instance.
Tier Instance_Tier `protobuf:"varint,17,opt,name=tier,enum=google.cloud.redis.v1beta1.Instance_Tier" json:"tier,omitempty"`
// Required. Redis memory size in GB.
MemorySizeGb int32 `protobuf:"varint,18,opt,name=memory_size_gb,json=memorySizeGb" json:"memory_size_gb,omitempty"`
// Optional. The full name of the Google Compute Engine
// [network](/compute/docs/networks-and-firewalls#networks) to which the
// instance is connected. If left unspecified, the `default` network
// will be used.
AuthorizedNetwork string `protobuf:"bytes,20,opt,name=authorized_network,json=authorizedNetwork" json:"authorized_network,omitempty"`
}
func (m *Instance) Reset() { *m = Instance{} }
func (m *Instance) String() string { return proto.CompactTextString(m) }
func (*Instance) ProtoMessage() {}
func (*Instance) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Instance) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Instance) GetDisplayName() string {
if m != nil {
return m.DisplayName
}
return ""
}
func (m *Instance) GetLabels() map[string]string {
if m != nil {
return m.Labels
}
return nil
}
func (m *Instance) GetLocationId() string {
if m != nil {
return m.LocationId
}
return ""
}
func (m *Instance) GetAlternativeLocationId() string {
if m != nil {
return m.AlternativeLocationId
}
return ""
}
func (m *Instance) GetRedisVersion() string {
if m != nil {
return m.RedisVersion
}
return ""
}
func (m *Instance) GetReservedIpRange() string {
if m != nil {
return m.ReservedIpRange
}
return ""
}
func (m *Instance) GetHost() string {
if m != nil {
return m.Host
}
return ""
}
func (m *Instance) GetPort() int32 {
if m != nil {
return m.Port
}
return 0
}
func (m *Instance) GetCurrentLocationId() string {
if m != nil {
return m.CurrentLocationId
}
return ""
}
func (m *Instance) GetCreateTime() *google_protobuf4.Timestamp {
if m != nil {
return m.CreateTime
}
return nil
}
func (m *Instance) GetState() Instance_State {
if m != nil {
return m.State
}
return Instance_STATE_UNSPECIFIED
}
func (m *Instance) GetStatusMessage() string {
if m != nil {
return m.StatusMessage
}
return ""
}
func (m *Instance) GetRedisConfigs() map[string]string {
if m != nil {
return m.RedisConfigs
}
return nil
}
func (m *Instance) GetTier() Instance_Tier {
if m != nil {
return m.Tier
}
return Instance_TIER_UNSPECIFIED
}
func (m *Instance) GetMemorySizeGb() int32 {
if m != nil {
return m.MemorySizeGb
}
return 0
}
func (m *Instance) GetAuthorizedNetwork() string {
if m != nil {
return m.AuthorizedNetwork
}
return ""
}
// Request for [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances].
type ListInstancesRequest struct {
// Required. The resource name of the instance location using the form:
// `projects/{project_id}/locations/{location_id}`
// where `location_id` refers to a GCP region
Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"`
// The maximum number of items to return.
//
// If not specified, a default value of 1000 will be used by the service.
// Regardless of the page_size value, the response may include a partial list
// and a caller should only rely on response's
// [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
// to determine if there are more instances left to be queried.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"`
// The next_page_token value returned from a previous List request,
// if any.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"`
}
func (m *ListInstancesRequest) Reset() { *m = ListInstancesRequest{} }
func (m *ListInstancesRequest) String() string { return proto.CompactTextString(m) }
func (*ListInstancesRequest) ProtoMessage() {}
func (*ListInstancesRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *ListInstancesRequest) GetParent() string {
if m != nil {
return m.Parent
}
return ""
}
func (m *ListInstancesRequest) GetPageSize() int32 {
if m != nil {
return m.PageSize
}
return 0
}
func (m *ListInstancesRequest) GetPageToken() string {
if m != nil {
return m.PageToken
}
return ""
}
// Response for [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances].
type ListInstancesResponse struct {
// A list of Redis instances in the project in the specified location,
// or across all locations.
//
// If the `location_id` in the parent field of the request is "-", all regions
// available to the project are queried, and the results aggregated.
// If in such an aggregated query a location is unavailable, a dummy Redis
// entry is included in the response with the "name" field set to a value of
// the form projects/{project_id}/locations/{location_id}/instances/- and the
// "status" field set to ERROR and "status_message" field set to "location not
// available for ListInstances".
Instances []*Instance `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"`
// Token to retrieve the next page of results, or empty if there are no more
// results in the list.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"`
}
func (m *ListInstancesResponse) Reset() { *m = ListInstancesResponse{} }
func (m *ListInstancesResponse) String() string { return proto.CompactTextString(m) }
func (*ListInstancesResponse) ProtoMessage() {}
func (*ListInstancesResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *ListInstancesResponse) GetInstances() []*Instance {
if m != nil {
return m.Instances
}
return nil
}
func (m *ListInstancesResponse) GetNextPageToken() string {
if m != nil {
return m.NextPageToken
}
return ""
}
// Request for [GetInstance][google.cloud.redis.v1beta1.CloudRedis.GetInstance].
type GetInstanceRequest struct {
// Required. Redis instance resource name using the form:
// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
// where `location_id` refers to a GCP region
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}
func (m *GetInstanceRequest) Reset() { *m = GetInstanceRequest{} }
func (m *GetInstanceRequest) String() string { return proto.CompactTextString(m) }
func (*GetInstanceRequest) ProtoMessage() {}
func (*GetInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *GetInstanceRequest) GetName() string {
if m != nil {
return m.Name
}
return ""
}
// Request for [CreateInstance][google.cloud.redis.v1beta1.CloudRedis.CreateInstance].
type CreateInstanceRequest struct {
// Required. The resource name of the instance location using the form:
// `projects/{project_id}/locations/{location_id}`
// where `location_id` refers to a GCP region
Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"`
// Required. The logical name of the Redis instance in the customer project
// with the following restrictions:
//
// * Must contain only lowercase letters, numbers, and hyphens.
// * Must start with a letter.
// * Must be between 1-40 characters.
// * Must end with a number or a letter.
// * Must be unique within the customer project / location
InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId" json:"instance_id,omitempty"`
// Required. A Redis [Instance] resource
Instance *Instance `protobuf:"bytes,3,opt,name=instance" json:"instance,omitempty"`
}
func (m *CreateInstanceRequest) Reset() { *m = CreateInstanceRequest{} }
func (m *CreateInstanceRequest) String() string { return proto.CompactTextString(m) }
func (*CreateInstanceRequest) ProtoMessage() {}
func (*CreateInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *CreateInstanceRequest) GetParent() string {
if m != nil {
return m.Parent
}
return ""
}
func (m *CreateInstanceRequest) GetInstanceId() string {
if m != nil {
return m.InstanceId
}
return ""
}
func (m *CreateInstanceRequest) GetInstance() *Instance {
if m != nil {
return m.Instance
}
return nil
}
// Request for [UpdateInstance][google.cloud.redis.v1beta1.CloudRedis.UpdateInstance].
type UpdateInstanceRequest struct {
// Required. Mask of fields to update. At least one path must be supplied in
// this field. The elements of the repeated paths field may only include these
// fields from [Instance][CloudRedis.Instance]:
// * `display_name`
// * `labels`
// * `memory_size_gb`
// * `redis_config`
UpdateMask *google_protobuf3.FieldMask `protobuf:"bytes,1,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"`
// Required. Update description.
// Only fields specified in update_mask are updated.
Instance *Instance `protobuf:"bytes,2,opt,name=instance" json:"instance,omitempty"`
}
func (m *UpdateInstanceRequest) Reset() { *m = UpdateInstanceRequest{} }
func (m *UpdateInstanceRequest) String() string { return proto.CompactTextString(m) }
func (*UpdateInstanceRequest) ProtoMessage() {}
func (*UpdateInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *UpdateInstanceRequest) GetUpdateMask() *google_protobuf3.FieldMask {
if m != nil {
return m.UpdateMask
}
return nil
}
func (m *UpdateInstanceRequest) GetInstance() *Instance {
if m != nil {
return m.Instance
}
return nil
}
// Request for [DeleteInstance][google.cloud.redis.v1beta1.CloudRedis.DeleteInstance].
type DeleteInstanceRequest struct {
// Required. Redis instance resource name using the form:
// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
// where `location_id` refers to a GCP region
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}
func (m *DeleteInstanceRequest) Reset() { *m = DeleteInstanceRequest{} }
func (m *DeleteInstanceRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteInstanceRequest) ProtoMessage() {}
func (*DeleteInstanceRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func (m *DeleteInstanceRequest) GetName() string {
if m != nil {
return m.Name
}
return ""
}
// 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.
type LocationMetadata struct {
// Output only. The set of available zones in the location. The map is keyed
// by the lowercase ID of each zone, as defined by GCE. These keys can be
// specified in `location_id` or `alternative_location_id` fields when
// creating a Redis instance.
AvailableZones map[string]*ZoneMetadata `protobuf:"bytes,1,rep,name=available_zones,json=availableZones" json:"available_zones,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
func (m *LocationMetadata) Reset() { *m = LocationMetadata{} }
func (m *LocationMetadata) String() string { return proto.CompactTextString(m) }
func (*LocationMetadata) ProtoMessage() {}
func (*LocationMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
func (m *LocationMetadata) GetAvailableZones() map[string]*ZoneMetadata {
if m != nil {
return m.AvailableZones
}
return nil
}
// Defines specific information for a particular zone. Currently empty and
// reserved for future use only.
type ZoneMetadata struct {
}
func (m *ZoneMetadata) Reset() { *m = ZoneMetadata{} }
func (m *ZoneMetadata) String() string { return proto.CompactTextString(m) }
func (*ZoneMetadata) ProtoMessage() {}
func (*ZoneMetadata) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
func init() {
proto.RegisterType((*Instance)(nil), "google.cloud.redis.v1beta1.Instance")
proto.RegisterType((*ListInstancesRequest)(nil), "google.cloud.redis.v1beta1.ListInstancesRequest")
proto.RegisterType((*ListInstancesResponse)(nil), "google.cloud.redis.v1beta1.ListInstancesResponse")
proto.RegisterType((*GetInstanceRequest)(nil), "google.cloud.redis.v1beta1.GetInstanceRequest")
proto.RegisterType((*CreateInstanceRequest)(nil), "google.cloud.redis.v1beta1.CreateInstanceRequest")
proto.RegisterType((*UpdateInstanceRequest)(nil), "google.cloud.redis.v1beta1.UpdateInstanceRequest")
proto.RegisterType((*DeleteInstanceRequest)(nil), "google.cloud.redis.v1beta1.DeleteInstanceRequest")
proto.RegisterType((*LocationMetadata)(nil), "google.cloud.redis.v1beta1.LocationMetadata")
proto.RegisterType((*ZoneMetadata)(nil), "google.cloud.redis.v1beta1.ZoneMetadata")
proto.RegisterEnum("google.cloud.redis.v1beta1.Instance_State", Instance_State_name, Instance_State_value)
proto.RegisterEnum("google.cloud.redis.v1beta1.Instance_Tier", Instance_Tier_name, Instance_Tier_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for CloudRedis service
type CloudRedisClient interface {
// Lists all Redis instances owned by a project in either the specified
// location (region) or all locations.
//
// The location should have the following format:
// * `projects/{project_id}/locations/{location_id}`
//
// If `location_id` is specified as `-` (wildcard), then all regions
// available to the project are queried, and the results are aggregated.
ListInstances(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error)
// Gets the details of a specific Redis instance.
GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*Instance, error)
// Creates a Redis instance based on the specified tier and memory size.
//
// By default, the instance is peered to the project's
// [default network](/compute/docs/networks-and-firewalls#networks).
//
// The creation is executed asynchronously and callers may check the returned
// operation to track its progress. Once the operation is completed the Redis
// instance will be fully functional. Completed longrunning.Operation will
// contain the new instance object in the response field.
//
// The returned operation is automatically deleted after a few hours, so there
// is no need to call DeleteOperation.
CreateInstance(ctx context.Context, in *CreateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error)
// Updates the metadata and configuration of a specific Redis instance.
//
// Completed longrunning.Operation will contain the new instance object
// in the response field. The returned operation is automatically deleted
// after a few hours, so there is no need to call DeleteOperation.
UpdateInstance(ctx context.Context, in *UpdateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error)
// Deletes a specific Redis instance. Instance stops serving and data is
// deleted.
DeleteInstance(ctx context.Context, in *DeleteInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error)
}
type cloudRedisClient struct {
cc *grpc.ClientConn
}
func NewCloudRedisClient(cc *grpc.ClientConn) CloudRedisClient {
return &cloudRedisClient{cc}
}
func (c *cloudRedisClient) ListInstances(ctx context.Context, in *ListInstancesRequest, opts ...grpc.CallOption) (*ListInstancesResponse, error) {
out := new(ListInstancesResponse)
err := grpc.Invoke(ctx, "/google.cloud.redis.v1beta1.CloudRedis/ListInstances", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *cloudRedisClient) GetInstance(ctx context.Context, in *GetInstanceRequest, opts ...grpc.CallOption) (*Instance, error) {
out := new(Instance)
err := grpc.Invoke(ctx, "/google.cloud.redis.v1beta1.CloudRedis/GetInstance", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *cloudRedisClient) CreateInstance(ctx context.Context, in *CreateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) {
out := new(google_longrunning.Operation)
err := grpc.Invoke(ctx, "/google.cloud.redis.v1beta1.CloudRedis/CreateInstance", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *cloudRedisClient) UpdateInstance(ctx context.Context, in *UpdateInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) {
out := new(google_longrunning.Operation)
err := grpc.Invoke(ctx, "/google.cloud.redis.v1beta1.CloudRedis/UpdateInstance", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *cloudRedisClient) DeleteInstance(ctx context.Context, in *DeleteInstanceRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) {
out := new(google_longrunning.Operation)
err := grpc.Invoke(ctx, "/google.cloud.redis.v1beta1.CloudRedis/DeleteInstance", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for CloudRedis service
type CloudRedisServer interface {
// Lists all Redis instances owned by a project in either the specified
// location (region) or all locations.
//
// The location should have the following format:
// * `projects/{project_id}/locations/{location_id}`
//
// If `location_id` is specified as `-` (wildcard), then all regions
// available to the project are queried, and the results are aggregated.
ListInstances(context.Context, *ListInstancesRequest) (*ListInstancesResponse, error)
// Gets the details of a specific Redis instance.
GetInstance(context.Context, *GetInstanceRequest) (*Instance, error)
// Creates a Redis instance based on the specified tier and memory size.
//
// By default, the instance is peered to the project's
// [default network](/compute/docs/networks-and-firewalls#networks).
//
// The creation is executed asynchronously and callers may check the returned
// operation to track its progress. Once the operation is completed the Redis
// instance will be fully functional. Completed longrunning.Operation will
// contain the new instance object in the response field.
//
// The returned operation is automatically deleted after a few hours, so there
// is no need to call DeleteOperation.
CreateInstance(context.Context, *CreateInstanceRequest) (*google_longrunning.Operation, error)
// Updates the metadata and configuration of a specific Redis instance.
//
// Completed longrunning.Operation will contain the new instance object
// in the response field. The returned operation is automatically deleted
// after a few hours, so there is no need to call DeleteOperation.
UpdateInstance(context.Context, *UpdateInstanceRequest) (*google_longrunning.Operation, error)
// Deletes a specific Redis instance. Instance stops serving and data is
// deleted.
DeleteInstance(context.Context, *DeleteInstanceRequest) (*google_longrunning.Operation, error)
}
func RegisterCloudRedisServer(s *grpc.Server, srv CloudRedisServer) {
s.RegisterService(&_CloudRedis_serviceDesc, srv)
}
func _CloudRedis_ListInstances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListInstancesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CloudRedisServer).ListInstances(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.redis.v1beta1.CloudRedis/ListInstances",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CloudRedisServer).ListInstances(ctx, req.(*ListInstancesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CloudRedis_GetInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetInstanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CloudRedisServer).GetInstance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.redis.v1beta1.CloudRedis/GetInstance",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CloudRedisServer).GetInstance(ctx, req.(*GetInstanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CloudRedis_CreateInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateInstanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CloudRedisServer).CreateInstance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.redis.v1beta1.CloudRedis/CreateInstance",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CloudRedisServer).CreateInstance(ctx, req.(*CreateInstanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CloudRedis_UpdateInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateInstanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CloudRedisServer).UpdateInstance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.redis.v1beta1.CloudRedis/UpdateInstance",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CloudRedisServer).UpdateInstance(ctx, req.(*UpdateInstanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CloudRedis_DeleteInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteInstanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CloudRedisServer).DeleteInstance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/google.cloud.redis.v1beta1.CloudRedis/DeleteInstance",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CloudRedisServer).DeleteInstance(ctx, req.(*DeleteInstanceRequest))
}
return interceptor(ctx, in, info, handler)
}
var _CloudRedis_serviceDesc = grpc.ServiceDesc{
ServiceName: "google.cloud.redis.v1beta1.CloudRedis",
HandlerType: (*CloudRedisServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListInstances",
Handler: _CloudRedis_ListInstances_Handler,
},
{
MethodName: "GetInstance",
Handler: _CloudRedis_GetInstance_Handler,
},
{
MethodName: "CreateInstance",
Handler: _CloudRedis_CreateInstance_Handler,
},
{
MethodName: "UpdateInstance",
Handler: _CloudRedis_UpdateInstance_Handler,
},
{
MethodName: "DeleteInstance",
Handler: _CloudRedis_DeleteInstance_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "google/cloud/redis/v1beta1/cloud_redis.proto",
}
func init() { proto.RegisterFile("google/cloud/redis/v1beta1/cloud_redis.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 1230 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdf, 0x6e, 0x1b, 0xc5,
0x17, 0xfe, 0x6d, 0x12, 0xe7, 0x17, 0x9f, 0x4d, 0x1c, 0x67, 0x9a, 0xc0, 0xca, 0x50, 0x1a, 0xdc,
0x82, 0x4c, 0x80, 0x5d, 0x6a, 0x50, 0x55, 0x1a, 0xf5, 0x8f, 0x63, 0x6f, 0x53, 0x4b, 0x89, 0x89,
0xd6, 0x2e, 0x12, 0xe5, 0x62, 0x35, 0xb6, 0xa7, 0xdb, 0x6d, 0xd6, 0x3b, 0xcb, 0xce, 0xd8, 0x90,
0xa0, 0x0a, 0x09, 0xde, 0x00, 0x24, 0x2e, 0xe1, 0x96, 0x4b, 0x78, 0x12, 0x2e, 0x78, 0x02, 0x24,
0xae, 0x78, 0x0a, 0x34, 0x33, 0xbb, 0xb1, 0x9d, 0x6e, 0x5d, 0x37, 0x77, 0x33, 0xdf, 0xf9, 0xce,
0xcc, 0x37, 0xe7, 0xcc, 0x37, 0x6b, 0xc3, 0x07, 0x1e, 0xa5, 0x5e, 0x40, 0xac, 0x5e, 0x40, 0x87,
0x7d, 0x2b, 0x26, 0x7d, 0x9f, 0x59, 0xa3, 0xeb, 0x5d, 0xc2, 0xf1, 0x75, 0x85, 0xb9, 0x12, 0x33,
0xa3, 0x98, 0x72, 0x8a, 0x4a, 0x8a, 0x6d, 0xca, 0x88, 0xa9, 0x22, 0x09, 0xbb, 0xf4, 0x66, 0xb2,
0x12, 0x8e, 0x7c, 0x0b, 0x87, 0x21, 0xe5, 0x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