databases

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package databases allows CRUD operations on the Databases resource - a sub-resource of Subscriptions.

Index

Constants

View Source
const (
	// Active value of the `Status` field in `Database`
	StatusActive = "active"
	// Draft value of the `Status` field in `Database`
	StatusDraft = "draft"
	// Pending value of the `Status` field in `Database`
	StatusPending = "pending"
	// RCP change pending value of the `Status` field in `Database`
	StatusRCPChangePending = "rcp-change-pending"
	// RCP draft value of the `Status` field in `Database`
	StatusRCPDraft = "rcp-draft"
	// RCP active change draft value of the `Status` field in `Database`
	StatusRCPActiveChangeDraft = "rcp-active-change-draft"
	// Active change draft value of the `Status` field in `Database`
	StatusActiveChangeDraft = "active-change-draft"
	// Active change pending value of the `Status` field in `Database`
	StatusActiveChangePending = "active-change-pending"
	// Error value of the `Status` field in `Database`
	StatusError = "error"
)

Variables

This section is empty.

Functions

func AlertNameValues

func AlertNameValues() []string

func DataEvictionPolicyValues

func DataEvictionPolicyValues() []string

func DataPersistenceValues

func DataPersistenceValues() []string

func MemoryStorageValues

func MemoryStorageValues() []string

func ProtocolValues

func ProtocolValues() []string

func SourceTypeValues

func SourceTypeValues() []string

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(client HttpClient, task Task, logger Log) *API

func (*API) Backup

func (a *API) Backup(ctx context.Context, subscription int, database int) error

Backup will create a manual backup of the database to the destination the database has been configured to backup to.

func (*API) Create

func (a *API) Create(ctx context.Context, subscription int, db CreateDatabase) (int, error)

Create will create a new database for the subscription and return the identifier of the database.

func (*API) Delete

func (a *API) Delete(ctx context.Context, subscription int, database int) error

Delete will destroy an existing database.

func (*API) Get

func (a *API) Get(ctx context.Context, subscription int, database int) (*Database, error)

Get will retrieve an existing database.

func (*API) Import

func (a *API) Import(ctx context.Context, subscription int, database int, request Import) error

Import will import data from an RDB file or another Redis database into an existing database.

func (*API) List

func (a *API) List(ctx context.Context, subscription int) *ListDatabase

List will return a ListDatabase that is capable of paging through all of the databases associated with a subscription.

func (*API) Update

func (a *API) Update(ctx context.Context, subscription int, database int, update UpdateDatabase) error

Update will update certain values of an existing database.

type Alert

type Alert struct {
	Name  *string `json:"name,omitempty"`
	Value *int    `json:"value,omitempty"`
}

func (Alert) String

func (o Alert) String() string

type Clustering

type Clustering struct {
	NumberOfShards *int         `json:"numberOfShards,omitempty"`
	RegexRules     []*RegexRule `json:"regexRules,omitempty"`
}

func (Clustering) String

func (o Clustering) String() string

type CreateAlert

type CreateAlert struct {
	Name  *string `json:"name,omitempty"`
	Value *int    `json:"value,omitempty"`
}

func (CreateAlert) String

func (o CreateAlert) String() string

type CreateDatabase

type CreateDatabase struct {
	DryRun                              *bool                        `json:"dryRun,omitempty"`
	Name                                *string                      `json:"name,omitempty"`
	Protocol                            *string                      `json:"protocol,omitempty"`
	MemoryLimitInGB                     *float64                     `json:"memoryLimitInGb,omitempty"`
	SupportOSSClusterAPI                *bool                        `json:"supportOSSClusterApi,omitempty"`
	UseExternalEndpointForOSSClusterAPI *bool                        `json:"useExternalEndpointForOSSClusterApi,omitempty"`
	DataPersistence                     *string                      `json:"dataPersistence,omitempty"`
	DataEvictionPolicy                  *string                      `json:"dataEvictionPolicy,omitempty"`
	Replication                         *bool                        `json:"replication,omitempty"`
	ThroughputMeasurement               *CreateThroughputMeasurement `json:"throughputMeasurement,omitempty"`
	AverageItemSizeInBytes              *int                         `json:"averageItemSizeInBytes,omitempty"`
	ReplicaOf                           []*string                    `json:"replicaOf,omitempty"`
	PeriodicBackupPath                  *string                      `json:"periodicBackupPath,omitempty"`
	SourceIP                            []*string                    `json:"sourceIp,omitempty"`
	ClientSSLCertificate                *string                      `json:"clientSslCertificate,omitempty"`
	Password                            *string                      `json:"password,omitempty"`
	Alerts                              []*CreateAlert               `json:"alerts,omitempty"`
	Modules                             []*CreateModule              `json:"modules,omitempty"`
}

func (CreateDatabase) String

func (o CreateDatabase) String() string

type CreateModule

type CreateModule struct {
	Name *string `json:"name,omitempty"`
}

func (CreateModule) String

func (o CreateModule) String() string

type CreateThroughputMeasurement

type CreateThroughputMeasurement struct {
	By    *string `json:"by,omitempty"`
	Value *int    `json:"value,omitempty"`
}

func (CreateThroughputMeasurement) String

type Database

type Database struct {
	ID                     *int        `json:"databaseId,omitempty"`
	Name                   *string     `json:"name,omitempty"`
	Protocol               *string     `json:"protocol,omitempty"`
	Provider               *string     `json:"provider,omitempty"`
	Region                 *string     `json:"region,omitempty"`
	Status                 *string     `json:"status,omitempty"`
	MemoryLimitInGB        *float64    `json:"memoryLimitInGb,omitempty"`
	MemoryUsedInMB         *float64    `json:"memoryUsedInMb,omitempty"`
	SupportOSSClusterAPI   *bool       `json:"supportOSSClusterApi,omitempty"`
	DataPersistence        *string     `json:"dataPersistence,omitempty"`
	Replication            *bool       `json:"replication,omitempty"`
	DataEvictionPolicy     *string     `json:"dataEvictionPolicy,omitempty"`
	ThroughputMeasurement  *Throughput `json:"throughputMeasurement,omitempty"`
	ReplicaOf              *ReplicaOf  `json:"replicaOf,omitempty"`
	Clustering             *Clustering `json:"clustering,omitempty"`
	Security               *Security   `json:"security,omitempty"`
	Modules                []*Module   `json:"modules,omitempty"`
	Alerts                 []*Alert    `json:"alerts,omitempty"`
	ActivatedOn            *time.Time  `json:"activatedOn,omitempty"`
	LastModified           *time.Time  `json:"lastModified,omitempty"`
	MemoryStorage          *string     `json:"memoryStorage,omitempty"`
	PrivateEndpoint        *string     `json:"privateEndpoint,omitempty"`
	PublicEndpoint         *string     `json:"publicEndpoint,omitempty"`
	RedisVersionCompliance *string     `json:"redisVersionCompliance,omitempty"`
}

func (Database) String

func (o Database) String() string

type HttpClient

type HttpClient interface {
	Get(ctx context.Context, name, path string, responseBody interface{}) error
	GetWithQuery(ctx context.Context, name, path string, query url.Values, responseBody interface{}) error
	Post(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Put(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
	Delete(ctx context.Context, name, path string, responseBody interface{}) error
}

type Import

type Import struct {
	SourceType    *string   `json:"sourceType,omitempty"`
	ImportFromURI []*string `json:"importFromUri,omitempty"`
}

func (Import) String

func (o Import) String() string

type ListDatabase

type ListDatabase struct {
	// contains filtered or unexported fields
}

func (*ListDatabase) Err

func (d *ListDatabase) Err() error

Err returns any error that occurred while trying to retrieve the next page of databases.

func (*ListDatabase) Next

func (d *ListDatabase) Next() bool

Next attempts to retrieve the next page of databases and will return false if no more databases were found. Any error that occurs within this function can be retrieved from the `Err()` function.

func (*ListDatabase) Value

func (d *ListDatabase) Value() *Database

Value returns the current page of databases.

type Log

type Log interface {
	Printf(format string, args ...interface{})
}

type Module

type Module struct {
	Name *string `json:"name,omitempty"`
}

func (Module) String

func (o Module) String() string

type RegexRule

type RegexRule struct {
	Ordinal int    `json:"ordinal"`
	Pattern string `json:"pattern"`
}

func (RegexRule) String

func (o RegexRule) String() string

type ReplicaOf

type ReplicaOf struct {
	Endpoints []*string `json:"endpoints,omitempty"`
}

type Security

type Security struct {
	SSLClientAuthentication *bool     `json:"sslClientAuthentication,omitempty"`
	SourceIPs               []*string `json:"sourceIps,omitempty"`
	Password                *string   `json:"password,omitempty"`
}

func (Security) String

func (o Security) String() string

type Task

type Task interface {
	WaitForResourceId(ctx context.Context, id string) (int, error)
	Wait(ctx context.Context, id string) error
}

type Throughput

type Throughput struct {
	By    *string `json:"by,omitempty"`
	Value *int    `json:"value,omitempty"`
}

func (Throughput) String

func (o Throughput) String() string

type UpdateAlert

type UpdateAlert struct {
	Name  *string `json:"name,omitempty"`
	Value *int    `json:"value,omitempty"`
}

func (UpdateAlert) String

func (o UpdateAlert) String() string

type UpdateDatabase

type UpdateDatabase struct {
	DryRun                              *bool                        `json:"dryRun,omitempty"`
	Name                                *string                      `json:"name,omitempty"`
	MemoryLimitInGB                     *float64                     `json:"memoryLimitInGb,omitempty"`
	SupportOSSClusterAPI                *bool                        `json:"supportOSSClusterApi,omitempty"`
	UseExternalEndpointForOSSClusterAPI *bool                        `json:"useExternalEndpointForOSSClusterApi,omitempty"`
	DataEvictionPolicy                  *string                      `json:"dataEvictionPolicy,omitempty"`
	Replication                         *bool                        `json:"replication,omitempty"`
	ThroughputMeasurement               *UpdateThroughputMeasurement `json:"throughputMeasurement,omitempty"`
	RegexRules                          []*string                    `json:"regexRules,omitempty"`
	DataPersistence                     *string                      `json:"dataPersistence,omitempty"`
	ReplicaOf                           []*string                    `json:"replicaOf,omitempty"`
	PeriodicBackupPath                  *string                      `json:"periodicBackupPath,omitempty"`
	SourceIP                            []*string                    `json:"sourceIp,omitempty"`
	ClientSSLCertificate                *string                      `json:"clientSslCertificate,omitempty"`
	Password                            *string                      `json:"password,omitempty"`
	Alerts                              []*UpdateAlert               `json:"alerts,omitempty"`
}

func (UpdateDatabase) String

func (o UpdateDatabase) String() string

type UpdateThroughputMeasurement

type UpdateThroughputMeasurement struct {
	By    *string `json:"by,omitempty"`
	Value *int    `json:"value,omitempty"`
}

func (UpdateThroughputMeasurement) String

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL