Documentation ¶
Overview ¶
Package databases allows CRUD operations on the Databases resource - a sub-resource of Subscriptions.
Index ¶
- Constants
- func AlertNameValues() []string
- func BackupIntervals() []string
- func BackupStorageTypes() []string
- func DataEvictionPolicyValues() []string
- func DataPersistenceValues() []string
- func MemoryStorageValues() []string
- func ProtocolValues() []string
- func SourceTypeValues() []string
- type API
- func (a *API) ActiveActiveCreate(ctx context.Context, subscription int, db CreateActiveActiveDatabase) (int, error)
- func (a *API) ActiveActiveUpdate(ctx context.Context, subscription int, database int, ...) error
- func (a *API) Backup(ctx context.Context, subscription int, database int) error
- func (a *API) Create(ctx context.Context, subscription int, db CreateDatabase) (int, error)
- func (a *API) Delete(ctx context.Context, subscription int, database int) error
- func (a *API) Get(ctx context.Context, subscription int, database int) (*Database, error)
- func (a *API) GetActiveActive(ctx context.Context, subscription int, database int) (*ActiveActiveDatabase, error)
- func (a *API) Import(ctx context.Context, subscription int, database int, request Import) error
- func (a *API) List(ctx context.Context, subscription int) *ListDatabase
- func (a *API) ListActiveActive(ctx context.Context, subscription int) *ListActiveActiveDatabase
- func (a *API) Update(ctx context.Context, subscription int, database int, update UpdateDatabase) error
- type ActiveActiveDatabase
- type Alert
- type Backup
- type Clustering
- type CrdbDatabase
- type CreateActiveActiveDatabase
- type CreateDatabase
- type CreateThroughputMeasurement
- type Database
- type DatabaseBackupConfig
- type HttpClient
- type Import
- type ListActiveActiveDatabase
- type ListDatabase
- type LocalRegionProperties
- type LocalThroughput
- type Log
- type Module
- type NotFound
- type RegexRule
- type ReplicaOf
- type Security
- type TaskWaiter
- type Throughput
- type UpdateActiveActiveDatabase
- type UpdateDatabase
- type UpdateThroughputMeasurement
Constants ¶
const ( // StatusActive is the active value of the `Status` field in `Database` StatusActive = "active" // StatusDraft is the draft value of the `Status` field in `Database` StatusDraft = "draft" // StatusPending is the pending value of the `Status` field in `Database` StatusPending = "pending" // StatusRCPChangePending is the RCP change pending value of the `Status` field in `Database` StatusRCPChangePending = "rcp-change-pending" // StatusRCPDraft is the RCP draft value of the `Status` field in `Database` StatusRCPDraft = "rcp-draft" // StatusRCPActiveChangeDraft is the RCP active change draft value of the `Status` field in `Database` StatusRCPActiveChangeDraft = "rcp-active-change-draft" // StatusActiveChangeDraft is the Active change draft value of the `Status` field in `Database` StatusActiveChangeDraft = "active-change-draft" // StatusActiveChangePending is the Active change pending value of the `Status` field in `Database` StatusActiveChangePending = "active-change-pending" // StatusProxyPolicyChangePending and StatusProxyPolicyChangeDraft //The below two Proxy Policy states are caused by a change to the 'support_oss_cluster_api' attribute // StatusProxyPolicyChangePending is the Proxy Policy change pending value of the `Status` field in `Database`. StatusProxyPolicyChangePending = "proxy-policy-change-pending" // StatusProxyPolicyChangeDraft is the Proxy Policy change draft value of the `Status` field in `Database` StatusProxyPolicyChangeDraft = "proxy-policy-change-draft" // StatusError is the error value of the `Status` field in `Database` StatusError = "error" // BackupIntervalEvery24Hours is the schedule to back up once a day BackupIntervalEvery24Hours = "every-24-hours" // BackupIntervalEvery12Hours is the schedule to back up twice a day BackupIntervalEvery12Hours = "every-12-hours" // BackupIntervalEvery6Hours is the schedule to back up four times a day BackupIntervalEvery6Hours = "every-6-hours" // BackupIntervalEvery4Hours is the schedule to back up six times a day BackupIntervalEvery4Hours = "every-4-hours" // BackupIntervalEvery2Hours is the schedule to back up twelve times a day BackupIntervalEvery2Hours = "every-2-hours" // BackupIntervalEvery1Hours is the schedule to back up every hour BackupIntervalEvery1Hours = "every-1-hours" // MemoryStorageRam stores data only in RAM MemoryStorageRam = "ram" // MemoryStorageRamAndFlash stores data both in RAM and on SSD MemoryStorageRamAndFlash = "ram-and-flash" )
Variables ¶
This section is empty.
Functions ¶
func AlertNameValues ¶
func AlertNameValues() []string
func BackupIntervals ¶ added in v0.3.0
func BackupIntervals() []string
func BackupStorageTypes ¶ added in v0.3.0
func BackupStorageTypes() []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, taskWaiter TaskWaiter, logger Log) *API
func (*API) ActiveActiveCreate ¶ added in v0.1.10
func (a *API) ActiveActiveCreate(ctx context.Context, subscription int, db CreateActiveActiveDatabase) (int, error)
ActiveActiveCreate will create a new database for the subscription and return the identifier of the database.
func (*API) ActiveActiveUpdate ¶ added in v0.1.10
func (a *API) ActiveActiveUpdate(ctx context.Context, subscription int, database int, update UpdateActiveActiveDatabase) error
ActiveActiveUpdate will update certain values of an existing database.
func (*API) Backup ¶
Backup will create a manual backup of the database to the destination the database has been configured to backup to.
func (*API) Create ¶
Create will create a new database for the subscription and return the identifier of the database.
func (*API) GetActiveActive ¶ added in v0.1.11
func (a *API) GetActiveActive(ctx context.Context, subscription int, database int) (*ActiveActiveDatabase, error)
GetActiveActive will retrieve an existing database.
func (*API) Import ¶
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) ListActiveActive ¶ added in v0.1.11
func (a *API) ListActiveActive(ctx context.Context, subscription int) *ListActiveActiveDatabase
ListActiveActive will return a ListDatabase that is capable of paging through all of the databases associated with a subscription.
type ActiveActiveDatabase ¶ added in v0.1.11
type ActiveActiveDatabase struct { ID *int `json:"databaseId,omitempty"` Name *string `json:"name,omitempty"` Protocol *string `json:"protocol,omitempty"` Status *string `json:"status,omitempty"` MemoryStorage *string `json:"memoryStorage,omitempty"` ActiveActiveRedis *bool `json:"activeActiveRedis,omitempty"` ActivatedOn *time.Time `json:"activatedOn,omitempty"` LastModified *time.Time `json:"lastModified,omitempty"` SupportOSSClusterAPI *bool `json:"supportOSSClusterApi,omitempty"` UseExternalEndpointForOSSClusterAPI *bool `json:"useExternalEndpointForOSSClusterApi,omitempty"` Replication *bool `json:"replication,omitempty"` DataEvictionPolicy *string `json:"dataEvictionPolicy,omitempty"` Modules []*Module `json:"modules,omitempty"` CrdbDatabases []*CrdbDatabase `json:"crdbDatabases,omitempty"` }
func (ActiveActiveDatabase) String ¶ added in v0.1.11
func (o ActiveActiveDatabase) String() string
type Backup ¶ added in v0.1.11
type Clustering ¶
type Clustering struct { NumberOfShards *int `json:"numberOfShards,omitempty"` RegexRules []*RegexRule `json:"regexRules,omitempty"` }
func (Clustering) String ¶
func (o Clustering) String() string
type CrdbDatabase ¶ added in v0.1.11
type CrdbDatabase struct { Provider *string `json:"provider,omitempty"` Region *string `json:"region,omitempty"` RedisVersionCompliance *string `json:"redisVersionCompliance,omitempty"` PublicEndpoint *string `json:"publicEndpoint,omitempty"` PrivateEndpoint *string `json:"privateEndpoint,omitempty"` MemoryLimitInGB *float64 `json:"memoryLimitInGb,omitempty"` MemoryUsedInMB *float64 `json:"memoryUsedInMb,omitempty"` ReadOperationsPerSecond *int `json:"readOperationsPerSecond,omitempty"` WriteOperationsPerSecond *int `json:"writeOperationsPerSecond,omitempty"` DataPersistence *string `json:"dataPersistence,omitempty"` Alerts []*Alert `json:"alerts,omitempty"` Security *Security `json:"security,omitempty"` Backup *Backup `json:"backup,omitempty"` }
func (CrdbDatabase) String ¶ added in v0.1.11
func (o CrdbDatabase) String() string
type CreateActiveActiveDatabase ¶ added in v0.1.10
type CreateActiveActiveDatabase 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"` RespVersion *string `json:"respVersion,omitempty"` UseExternalEndpointForOSSClusterAPI *bool `json:"useExternalEndpointForOSSClusterApi,omitempty"` DataEvictionPolicy *string `json:"dataEvictionPolicy,omitempty"` GlobalDataPersistence *string `json:"dataPersistence,omitempty"` GlobalSourceIP []*string `json:"sourceIp,omitempty"` GlobalPassword *string `json:"password,omitempty"` GlobalAlerts []*Alert `json:"alerts,omitempty"` GlobalModules []*Module `json:"modules,omitempty"` LocalThroughputMeasurement []*LocalThroughput `json:"localThroughputMeasurement,omitempty"` PortNumber *int `json:"port,omitempty"` }
func (CreateActiveActiveDatabase) String ¶ added in v0.1.10
func (o CreateActiveActiveDatabase) 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"` RespVersion *string `json:"respVersion,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"` // Deprecated: Use RemoteBackup instead PeriodicBackupPath *string `json:"periodicBackupPath,omitempty"` SourceIP []*string `json:"sourceIp,omitempty"` ClientSSLCertificate *string `json:"clientSslCertificate,omitempty"` Password *string `json:"password,omitempty"` Alerts []*Alert `json:"alerts,omitempty"` Modules []*Module `json:"modules,omitempty"` EnableTls *bool `json:"enableTls,omitempty"` PortNumber *int `json:"port,omitempty"` RemoteBackup *DatabaseBackupConfig `json:"remoteBackup,omitempty"` }
func (CreateDatabase) String ¶
func (o CreateDatabase) String() string
type CreateThroughputMeasurement ¶
type CreateThroughputMeasurement struct { By *string `json:"by,omitempty"` Value *int `json:"value,omitempty"` }
func (CreateThroughputMeasurement) String ¶
func (o CreateThroughputMeasurement) String() string
type Database ¶
type Database struct { ID *int `json:"databaseId,omitempty"` Name *string `json:"name,omitempty"` Protocol *string `json:"protocol,omitempty"` // For filtering out active-active entries, this property should not be present in the JSON response ActiveActiveRedis *bool `json:"activeActiveRedis,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"` RespVersion *string `json:"respVersion,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"` Backup *Backup `json:"backup,omitempty"` }
type DatabaseBackupConfig ¶ added in v0.1.10
type DatabaseBackupConfig struct { Active *bool `json:"active,omitempty"` Interval *string `json:"interval,omitempty"` TimeUTC *string `json:"timeUTC,omitempty"` StorageType *string `json:"storageType,omitempty"` StoragePath *string `json:"storagePath,omitempty"` }
func (DatabaseBackupConfig) String ¶ added in v0.1.10
func (o DatabaseBackupConfig) 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 ListActiveActiveDatabase ¶ added in v0.1.11
type ListActiveActiveDatabase struct {
// contains filtered or unexported fields
}
func (*ListActiveActiveDatabase) Err ¶ added in v0.1.11
func (d *ListActiveActiveDatabase) Err() error
Err returns any error that occurred while trying to retrieve the next page of databases.
func (*ListActiveActiveDatabase) Next ¶ added in v0.1.11
func (d *ListActiveActiveDatabase) 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 (*ListActiveActiveDatabase) Value ¶ added in v0.1.11
func (d *ListActiveActiveDatabase) Value() *ActiveActiveDatabase
Value returns the current page of databases.
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 LocalRegionProperties ¶ added in v0.1.10
type LocalRegionProperties struct { Region *string `json:"region,omitempty"` RemoteBackup *DatabaseBackupConfig `json:"remoteBackup,omitempty"` LocalThroughputMeasurement *LocalThroughput `json:"localThroughputMeasurement,omitempty"` DataPersistence *string `json:"dataPersistence,omitempty"` Password *string `json:"password,omitempty"` SourceIP []*string `json:"sourceIp,omitempty"` // Using a pointer to allow empty slices to be serialised/sent Alerts *[]*Alert `json:"alerts,omitempty"` }
func (LocalRegionProperties) String ¶ added in v0.1.10
func (o LocalRegionProperties) String() string
type LocalThroughput ¶ added in v0.1.10
type LocalThroughput struct { Region *string `json:"region,omitempty"` WriteOperationsPerSecond *int `json:"writeOperationsPerSecond,omitempty"` ReadOperationsPerSecond *int `json:"readOperationsPerSecond,omitempty"` }
func (LocalThroughput) String ¶ added in v0.1.10
func (o LocalThroughput) String() string
type Security ¶
type TaskWaiter ¶ added in v0.9.0
type Throughput ¶
func (Throughput) String ¶
func (o Throughput) String() string
type UpdateActiveActiveDatabase ¶ added in v0.1.10
type UpdateActiveActiveDatabase struct { DryRun *bool `json:"dryRun,omitempty"` MemoryLimitInGB *float64 `json:"memoryLimitInGb,omitempty"` SupportOSSClusterAPI *bool `json:"supportOSSClusterApi,omitempty"` UseExternalEndpointForOSSClusterAPI *bool `json:"useExternalEndpointForOSSClusterApi,omitempty"` ClientSSLCertificate *string `json:"clientSslCertificate,omitempty"` EnableTls *bool `json:"enableTls,omitempty"` GlobalDataPersistence *string `json:"globalDataPersistence,omitempty"` GlobalPassword *string `json:"globalPassword,omitempty"` GlobalSourceIP []*string `json:"globalSourceIp,omitempty"` // Using a pointer to allow empty slices to be serialised/sent GlobalAlerts *[]*Alert `json:"globalAlerts,omitempty"` Regions []*LocalRegionProperties `json:"regions,omitempty"` DataEvictionPolicy *string `json:"dataEvictionPolicy,omitempty"` }
func (UpdateActiveActiveDatabase) String ¶ added in v0.1.10
func (o UpdateActiveActiveDatabase) 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"` RespVersion *string `json:"respVersion,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"` PeriodicBackupPath *string `json:"periodicBackupPath,omitempty"` SourceIP []*string `json:"sourceIp,omitempty"` ClientSSLCertificate *string `json:"clientSslCertificate,omitempty"` Password *string `json:"password,omitempty"` // It's important to use a pointer here, because the terraform user may want to send an empty list. // In that case, the developer must pass a (pointer to a) non-nil, zero-length slice // If the developer really wants to omit this value, passing a nil slice value would work Alerts *[]*Alert `json:"alerts,omitempty"` EnableTls *bool `json:"enableTls,omitempty"` RemoteBackup *DatabaseBackupConfig `json:"remoteBackup,omitempty"` EnableDefaultUser *bool `json:"enableDefaultUser,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 ¶
func (o UpdateThroughputMeasurement) String() string