Documentation
¶
Overview ¶
Package databases allows CRUD operations on the Databases resource - a sub-resource of Subscriptions.
Index ¶
- Constants
- func AlertNameValues() []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 CreateAlert
- type CreateDatabase
- type CreateModule
- 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 Task
- type Throughput
- type UpdateActiveActiveDatabase
- type UpdateAlert
- type UpdateDatabase
- type UpdateThroughputMeasurement
Constants ¶
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" // The below two Proxy Policy states are caused by a change to the 'support_oss_cluster_api' attribute // Proxy Policy change pending value of the `Status` field in `Database`. StatusProxyPolicyChangePending = "proxy-policy-change-pending" // Proxy Policy change draft value of the `Status` field in `Database` StatusProxyPolicyChangeDraft = "proxy-policy-change-draft" // 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 (*API) ActiveActiveCreate ¶ added in v0.1.10
func (a *API) ActiveActiveCreate(ctx context.Context, subscription int, db CreateActiveActiveDatabase) (int, error)
Create 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
Update 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)
Get 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
List 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"` 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"` UseExternalEndpointForOSSClusterAPI *bool `json:"useExternalEndpointForOSSClusterApi,omitempty"` GlobalDataPersistence *string `json:"dataPersistence,omitempty"` GlobalSourceIP []*string `json:"sourceIp,omitempty"` GlobalPassword *string `json:"password,omitempty"` GlobalAlerts []*CreateAlert `json:"alerts,omitempty"` LocalThroughputMeasurement []*LocalThroughput `json:"localThroughputMeasurement,omitempty"` }
func (CreateActiveActiveDatabase) String ¶ added in v0.1.10
func (o CreateActiveActiveDatabase) 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"` EnableTls *bool `json:"enableTls,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 ¶
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"` 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"` }
TODO: do we need a separate ActiveActiveDatabase type as well?
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"` Alerts []*UpdateAlert `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 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"` GlobalAlerts []*UpdateAlert `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 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"` 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"` EnableTls *bool `json:"enableTls,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