Documentation ¶
Overview ¶
Package dbaas implements the Selectel DBaaS v1 API
Index ¶
- Constants
- type ACL
- type ACLCreateOpts
- type ACLQueryParams
- type ACLUpdateOpts
- type API
- func (api *API) ACL(ctx context.Context, aclID string) (ACL, error)
- func (api *API) ACLs(ctx context.Context, params *ACLQueryParams) ([]ACL, error)
- func (api *API) AvailableExtension(ctx context.Context, availableExtensionID string) (AvailableExtension, error)
- func (api *API) AvailableExtensions(ctx context.Context) ([]AvailableExtension, error)
- func (api *API) BackupsDatastore(ctx context.Context, datastoreID string, opts DatastoreBackupsOpts) (Datastore, error)
- func (api *API) ConfigDatastore(ctx context.Context, datastoreID string, opts DatastoreConfigOpts) (Datastore, error)
- func (api *API) ConfigurationParameter(ctx context.Context, configurationParameterID string) (ConfigurationParameter, error)
- func (api *API) ConfigurationParameters(ctx context.Context) ([]ConfigurationParameter, error)
- func (api *API) CreateACL(ctx context.Context, opts ACLCreateOpts) (ACL, error)
- func (api *API) CreateDatabase(ctx context.Context, opts DatabaseCreateOpts) (Database, error)
- func (api *API) CreateDatastore(ctx context.Context, opts DatastoreCreateOpts) (Datastore, error)
- func (api *API) CreateExtension(ctx context.Context, opts ExtensionCreateOpts) (Extension, error)
- func (api *API) CreateFloatingIP(ctx context.Context, opts FloatingIPsOpts) error
- func (api *API) CreateGrant(ctx context.Context, opts GrantCreateOpts) (Grant, error)
- func (api *API) CreateLogicalReplicationSlot(ctx context.Context, opts LogicalReplicationSlotCreateOpts) (LogicalReplicationSlot, error)
- func (api *API) CreatePrometheusMetricToken(ctx context.Context, opts PrometheusMetricTokenCreateOpts) (PrometheusMetricToken, error)
- func (api *API) CreateTopic(ctx context.Context, opts TopicCreateOpts) (Topic, error)
- func (api *API) CreateUser(ctx context.Context, opts UserCreateOpts) (User, error)
- func (api *API) Database(ctx context.Context, databaseID string) (Database, error)
- func (api *API) Databases(ctx context.Context, params *DatabaseQueryParams) ([]Database, error)
- func (api *API) Datastore(ctx context.Context, datastoreID string) (Datastore, error)
- func (api *API) DatastoreType(ctx context.Context, datastoreTypeID string) (DatastoreType, error)
- func (api *API) DatastoreTypes(ctx context.Context) ([]DatastoreType, error)
- func (api *API) Datastores(ctx context.Context, params *DatastoreQueryParams) ([]Datastore, error)
- func (api *API) DeleteACL(ctx context.Context, aclID string) error
- func (api *API) DeleteDatabase(ctx context.Context, databaseID string) error
- func (api *API) DeleteDatastore(ctx context.Context, datastoreID string) error
- func (api *API) DeleteExtension(ctx context.Context, extensionID string) error
- func (api *API) DeleteFloatingIP(ctx context.Context, opts FloatingIPsOpts) error
- func (api *API) DeleteGrant(ctx context.Context, grantID string) error
- func (api *API) DeleteLogicalReplicationSlot(ctx context.Context, slotID string) error
- func (api *API) DeletePrometheusMetricToken(ctx context.Context, prometheusMetricTokenID string) error
- func (api *API) DeleteTopic(ctx context.Context, topicID string) error
- func (api *API) DeleteUser(ctx context.Context, userID string) error
- func (api *API) Extension(ctx context.Context, extensionID string) (Extension, error)
- func (api *API) Extensions(ctx context.Context, params *ExtensionQueryParams) ([]Extension, error)
- func (api *API) FirewallDatastore(ctx context.Context, datastoreID string, opts DatastoreFirewallOpts) (Datastore, error)
- func (api *API) Flavor(ctx context.Context, flavorID string) (FlavorResponse, error)
- func (api *API) Flavors(ctx context.Context) ([]FlavorResponse, error)
- func (api *API) Grant(ctx context.Context, grantID string) (Grant, error)
- func (api *API) Grants(ctx context.Context) ([]Grant, error)
- func (api *API) LogicalReplicationSlot(ctx context.Context, slotID string) (LogicalReplicationSlot, error)
- func (api *API) LogicalReplicationSlots(ctx context.Context, params *LogicalReplicationSlotQueryParams) ([]LogicalReplicationSlot, error)
- func (api *API) PasswordDatastore(ctx context.Context, datastoreID string, opts DatastorePasswordOpts) (Datastore, error)
- func (api *API) PoolerDatastore(ctx context.Context, datastoreID string, opts DatastorePoolerOpts) (Datastore, error)
- func (api *API) PrometheusMetricToken(ctx context.Context, prometheusMetricTokenID string) (PrometheusMetricToken, error)
- func (api *API) PrometheusMetricTokens(ctx context.Context) ([]PrometheusMetricToken, error)
- func (api *API) ResizeDatastore(ctx context.Context, datastoreID string, opts DatastoreResizeOpts) (Datastore, error)
- func (api *API) Topic(ctx context.Context, topicID string) (Topic, error)
- func (api *API) Topics(ctx context.Context, params *TopicQueryParams) ([]Topic, error)
- func (api *API) UpdateACL(ctx context.Context, aclID string, opts ACLUpdateOpts) (ACL, error)
- func (api *API) UpdateDatabase(ctx context.Context, databaseID string, opts DatabaseUpdateOpts) (Database, error)
- func (api *API) UpdateDatastore(ctx context.Context, datastoreID string, opts DatastoreUpdateOpts) (Datastore, error)
- func (api *API) UpdatePrometheusMetricToken(ctx context.Context, prometheusMetricTokenID string, ...) (PrometheusMetricToken, error)
- func (api *API) UpdateTopic(ctx context.Context, topicID string, opts TopicUpdateOpts) (Topic, error)
- func (api *API) UpdateUser(ctx context.Context, userID string, opts UserUpdateOpts) (User, error)
- func (api *API) User(ctx context.Context, userID string) (User, error)
- func (api *API) Users(ctx context.Context) ([]User, error)
- type AvailableExtension
- type ConfigurationParameter
- type DBaaSAPIError
- type Database
- type DatabaseCreateOpts
- type DatabaseQueryParams
- type DatabaseUpdateOpts
- type Datastore
- type DatastoreBackupsOpts
- type DatastoreConfigOpts
- type DatastoreCreateOpts
- type DatastoreFirewallOpts
- type DatastorePasswordOpts
- type DatastorePoolerOpts
- type DatastoreQueryParams
- type DatastoreResizeOpts
- type DatastoreType
- type DatastoreUpdateOpts
- type Extension
- type ExtensionCreateOpts
- type ExtensionQueryParams
- type Firewall
- type Flavor
- type FlavorResponse
- type FloatingIPs
- type FloatingIPsOpts
- type Grant
- type GrantCreateOpts
- type Instances
- type LogicalReplicationSlot
- type LogicalReplicationSlotCreateOpts
- type LogicalReplicationSlotQueryParams
- type Pooler
- type PrometheusMetricToken
- type PrometheusMetricTokenCreateOpts
- type PrometheusMetricTokenUpdateOpts
- type Restore
- type Status
- type Topic
- type TopicCreateOpts
- type TopicQueryParams
- type TopicUpdateOpts
- type User
- type UserCreateOpts
- type UserUpdateOpts
Constants ¶
const ( ErrorNotFoundTitle = "Not Found" ErrorBadRequestTitle = "Bad Request" )
Error titles.
const ACLsURI = "/acls"
const AvailableExtensionsURI = "/available-extensions"
const ConfigurationParametersURI = "/configuration-parameters"
const DatabasesURI = "/databases"
const DatastoreTypesURI = "/datastore-types"
const DatastoresURI = "/datastores"
const ExtensionsURI = "/extensions"
const FlavorsURI = "/flavors"
const FloatingIPsURI = "/floating-ips"
const GrantsURI = "/grants"
const LogicalReplicationSlotsURI = "/logical-replication-slots"
const NotFoundEntityID = "0721fd40-77e9-4012-8f4d-6bb3bd9ea1fa"
const PrometheusMetricsTokensURI = "/prometheus-metrics-tokens"
const TopicsURI = "/topics"
const UsersURI = "/users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACL ¶ added in v0.10.0
type ACL struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` ProjectID string `json:"project_id"` DatastoreID string `json:"datastore_id"` Pattern string `json:"pattern"` PatternType string `json:"pattern_type"` UserID string `json:"user_id"` Status Status `json:"status"` AllowRead bool `json:"allow_read"` AllowWrite bool `json:"allow_write"` }
ACL is the API response for the acls.
type ACLCreateOpts ¶ added in v0.10.0
type ACLCreateOpts struct { DatastoreID string `json:"datastore_id"` Pattern string `json:"pattern,omitempty"` PatternType string `json:"pattern_type"` UserID string `json:"user_id"` AllowRead bool `json:"allow_read"` AllowWrite bool `json:"allow_write"` }
ACLCreateOpts represents options for the acl Create request.
type ACLQueryParams ¶ added in v0.10.0
type ACLQueryParams struct { ID string `json:"id,omitempty"` ProjectID string `json:"project_id,omitempty"` DatastoreID string `json:"datastore_id,omitempty"` Pattern string `json:"pattern,omitempty"` PatternType string `json:"pattern_type,omitempty"` UserID string `json:"user_id,omitempty"` Status Status `json:"status,omitempty"` }
ACLQueryParams represents available query parameters for the acl.
type ACLUpdateOpts ¶ added in v0.10.0
type ACLUpdateOpts struct { AllowRead bool `json:"allow_read"` AllowWrite bool `json:"allow_write"` }
ACLUpdateOpts represents options for the acl Update request.
type API ¶
API stores details that are needed to work with Selectel DBaaS API.
func NewDBAASClient ¶
NewDBAASClient initializes a new DBaaS client for the V1 API.
func NewDBAASClientV1WithCustomHTTP ¶
func NewDBAASClientV1WithCustomHTTP(customHTTPClient *http.Client, token, endpoint string) (*API, error)
NewDBAASClientV1WithCustomHTTP initializes a new DBaaS client for the V1 API using custom HTTP client. If custom HTTP client is nil - default HTTP client will be used.
func NewDBAASClientV1WithOpenstackCredentials ¶
func NewDBAASClientV1WithOpenstackCredentials(token, identityEndpoint, region, serviceType string) (*API, error)
NewDBAASClientV1WithOpenstackCredentials initializes a new DBaaS client for the V1 API using openstack credentials. You need to provide identityEndpoint, region and serviceType to get correct service endpoint.
func (*API) AvailableExtension ¶
func (api *API) AvailableExtension(ctx context.Context, availableExtensionID string) (AvailableExtension, error)
AvailableExtension returns an available extension based on the ID.
func (*API) AvailableExtensions ¶
func (api *API) AvailableExtensions(ctx context.Context) ([]AvailableExtension, error)
AvailableExtensions returns all available extensions.
func (*API) BackupsDatastore ¶ added in v0.9.0
func (api *API) BackupsDatastore(ctx context.Context, datastoreID string, opts DatastoreBackupsOpts) (Datastore, error)
BackupsDatastore updates backups parameters of an existing datastore.
func (*API) ConfigDatastore ¶ added in v0.2.0
func (api *API) ConfigDatastore(ctx context.Context, datastoreID string, opts DatastoreConfigOpts) (Datastore, error)
ConfigDatastore updates configuration parameters rules of an existing datastore.
func (*API) ConfigurationParameter ¶ added in v0.2.0
func (api *API) ConfigurationParameter( ctx context.Context, configurationParameterID string, ) (ConfigurationParameter, error)
ConfigurationParameter returns a configuration parameter based on the ID.
func (*API) ConfigurationParameters ¶ added in v0.2.0
func (api *API) ConfigurationParameters(ctx context.Context) ([]ConfigurationParameter, error)
ConfigurationParameters returns all configuration parameters.
func (*API) CreateDatabase ¶
CreateDatabase creates a new database.
func (*API) CreateDatastore ¶
CreateDatastore creates a new datastore.
func (*API) CreateExtension ¶
CreateExtension creates a new extension.
func (*API) CreateFloatingIP ¶ added in v0.12.0
func (api *API) CreateFloatingIP(ctx context.Context, opts FloatingIPsOpts) error
CreateFloatingIP creates FloatingIP for provided instance of an existing datastore.
func (*API) CreateGrant ¶
CreateGrant creates a new grant.
func (*API) CreateLogicalReplicationSlot ¶ added in v0.8.0
func (api *API) CreateLogicalReplicationSlot( ctx context.Context, opts LogicalReplicationSlotCreateOpts, ) (LogicalReplicationSlot, error)
CreateLogicalReplicationSlot creates a new slot.
func (*API) CreatePrometheusMetricToken ¶ added in v0.3.0
func (api *API) CreatePrometheusMetricToken( ctx context.Context, opts PrometheusMetricTokenCreateOpts, ) (PrometheusMetricToken, error)
CreatePrometheusMetricToken creates a new token.
func (*API) CreateTopic ¶ added in v0.10.0
CreateTopic creates a new topic.
func (*API) CreateUser ¶
CreateUser creates a new user.
func (*API) DatastoreType ¶
DatastoreType returns a datastore type based on the ID.
func (*API) DatastoreTypes ¶
func (api *API) DatastoreTypes(ctx context.Context) ([]DatastoreType, error)
DatastoreTypes returns all datastore types.
func (*API) Datastores ¶
Datastores returns all datastores.
func (*API) DeleteDatabase ¶
DeleteDatabase deletes an existing database.
func (*API) DeleteDatastore ¶
DeleteDatastore deletes an existing datastore.
func (*API) DeleteExtension ¶
DeleteExtension deletes an existing extension.
func (*API) DeleteFloatingIP ¶ added in v0.12.0
func (api *API) DeleteFloatingIP(ctx context.Context, opts FloatingIPsOpts) error
DeleteFloatingIP deletes FloatingIP from provided instance of an existing datastore.
func (*API) DeleteGrant ¶
DeleteGrant deletes an existing grant.
func (*API) DeleteLogicalReplicationSlot ¶ added in v0.8.0
DeleteLogicalReplicationSlot deletes an existing slot.
func (*API) DeletePrometheusMetricToken ¶ added in v0.3.0
func (api *API) DeletePrometheusMetricToken(ctx context.Context, prometheusMetricTokenID string) error
DeletePrometheusMetricToken deletes an existing token.
func (*API) DeleteTopic ¶ added in v0.10.0
DeleteTopic deletes an existing topic.
func (*API) DeleteUser ¶
DeleteUser deletes an existing user.
func (*API) Extensions ¶
Extensions returns all extensions.
func (*API) FirewallDatastore ¶
func (api *API) FirewallDatastore(ctx context.Context, datastoreID string, opts DatastoreFirewallOpts) (Datastore, error)
FirewallDatastore updates firewall rules of an existing datastore.
func (*API) Flavors ¶
func (api *API) Flavors(ctx context.Context) ([]FlavorResponse, error)
Flavors returns all flavors.
func (*API) LogicalReplicationSlot ¶ added in v0.8.0
func (api *API) LogicalReplicationSlot(ctx context.Context, slotID string) (LogicalReplicationSlot, error)
LogicalReplicationSlot returns a slot based on the ID.
func (*API) LogicalReplicationSlots ¶ added in v0.8.0
func (api *API) LogicalReplicationSlots( ctx context.Context, params *LogicalReplicationSlotQueryParams, ) ([]LogicalReplicationSlot, error)
LogicalReplicationSlots returns all slots.
func (*API) PasswordDatastore ¶ added in v0.4.0
func (api *API) PasswordDatastore(ctx context.Context, datastoreID string, opts DatastorePasswordOpts) (Datastore, error)
PasswordDatastore updates password of an existing Redis datastore.
func (*API) PoolerDatastore ¶
func (api *API) PoolerDatastore(ctx context.Context, datastoreID string, opts DatastorePoolerOpts) (Datastore, error)
PoolerDatastore updates pooler parameters of an existing datastore.
func (*API) PrometheusMetricToken ¶ added in v0.3.0
func (api *API) PrometheusMetricToken( ctx context.Context, prometheusMetricTokenID string, ) (PrometheusMetricToken, error)
PrometheusMetricToken returns a token based on the ID.
func (*API) PrometheusMetricTokens ¶ added in v0.3.0
func (api *API) PrometheusMetricTokens(ctx context.Context) ([]PrometheusMetricToken, error)
PrometheusMetricTokens returns all tokens.
func (*API) ResizeDatastore ¶
func (api *API) ResizeDatastore(ctx context.Context, datastoreID string, opts DatastoreResizeOpts) (Datastore, error)
ResizeDatastore resizes an existing datastore.
func (*API) UpdateDatabase ¶
func (api *API) UpdateDatabase(ctx context.Context, databaseID string, opts DatabaseUpdateOpts) (Database, error)
UpdateDatabase updates an existing database.
func (*API) UpdateDatastore ¶
func (api *API) UpdateDatastore(ctx context.Context, datastoreID string, opts DatastoreUpdateOpts) (Datastore, error)
UpdateDatastore updates an existing datastore.
func (*API) UpdatePrometheusMetricToken ¶ added in v0.3.0
func (api *API) UpdatePrometheusMetricToken( ctx context.Context, prometheusMetricTokenID string, opts PrometheusMetricTokenUpdateOpts, ) (PrometheusMetricToken, error)
UpdatePrometheusMetricToken updates an existing token.
func (*API) UpdateTopic ¶ added in v0.10.0
func (api *API) UpdateTopic(ctx context.Context, topicID string, opts TopicUpdateOpts) (Topic, error)
UpdateTopic updates an existing topic.
func (*API) UpdateUser ¶
UpdateUser updates an existing user.
type AvailableExtension ¶
type AvailableExtension struct { ID string `json:"id"` Name string `json:"name"` DatastoreTypeIDs []string `json:"datastore_type_ids"` DependencyIDs []string `json:"dependency_ids"` }
AvailableExtension is the API response for the available extensions.
type ConfigurationParameter ¶ added in v0.2.0
type ConfigurationParameter struct { ID string `json:"id"` DatastoreTypeID string `json:"datastore_type_id"` Name string `json:"name"` Type string `json:"type"` Unit string `json:"unit"` Min interface{} `json:"min"` Max interface{} `json:"max"` DefaultValue interface{} `json:"default_value"` Choices []interface{} `json:"choices"` InvalidValues []interface{} `json:"invalid_values"` IsRestartRequired bool `json:"is_restart_required"` IsChangeable bool `json:"is_changeable"` }
ConfigurationParameter is the API response for the configuration parameters.
type DBaaSAPIError ¶
type DBaaSAPIError struct { APIError struct { Message string `json:"message"` Title string `json:"title"` Code int `json:"code"` } `json:"error"` }
DBaaSAPIError is a type of an error raised by API calls made by this library.
func (DBaaSAPIError) Error ¶
func (e DBaaSAPIError) Error() string
Error returns string representation of the error.
func (DBaaSAPIError) StatusCode ¶
func (e DBaaSAPIError) StatusCode() int
StatusCode returns the HTTP status from the error response.
type Database ¶
type Database struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` ProjectID string `json:"project_id"` Name string `json:"name"` OwnerID string `json:"owner_id"` LcCollate string `json:"lc_collate"` LcCtype string `json:"lc_ctype"` DatastoreID string `json:"datastore_id"` Status Status `json:"status"` }
Database is the API response for the databases.
type DatabaseCreateOpts ¶
type DatabaseCreateOpts struct { DatastoreID string `json:"datastore_id"` Name string `json:"name"` OwnerID string `json:"owner_id,omitempty"` LcCollate string `json:"lc_collate,omitempty"` LcCtype string `json:"lc_ctype,omitempty"` }
DatabaseCreateOpts represents options for the database Create request.
type DatabaseQueryParams ¶
type DatabaseQueryParams struct { ID string `json:"id,omitempty"` ProjectID string `json:"project_id,omitempty"` Name string `json:"name,omitempty"` DatastoreID string `json:"datastore_id,omitempty"` Status Status `json:"status,omitempty"` }
DatabaseQueryParams represents available query parameters for database.
type DatabaseUpdateOpts ¶
type DatabaseUpdateOpts struct {
OwnerID string `json:"owner_id"`
}
DatabaseUpdateOpts represents options for the database Update request.
type Datastore ¶
type Datastore struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` ProjectID string `json:"project_id"` Name string `json:"name"` TypeID string `json:"type_id"` SubnetID string `json:"subnet_id"` FlavorID string `json:"flavor_id"` Status Status `json:"status"` Connection map[string]string `json:"connection"` Firewall []Firewall `json:"firewall"` Instances []Instances `json:"instances"` Config map[string]interface{} `json:"config"` Pooler Pooler `json:"pooler"` Flavor Flavor `json:"flavor"` NodeCount int `json:"node_count"` Enabled bool `json:"enabled"` AllowRestore bool `json:"allow_restore"` IsMaintenance bool `json:"is_maintenance"` IsProtected bool `json:"is_protected"` BackupRetentionDays int `json:"backup_retention_days"` }
Datastore is the API response for the datastores.
type DatastoreBackupsOpts ¶ added in v0.9.0
type DatastoreBackupsOpts struct {
BackupRetentionDays int `json:"backup_retention_days"`
}
DatastoreBackupsOpts represents update options for the Datastore backups.
type DatastoreConfigOpts ¶ added in v0.2.0
type DatastoreConfigOpts struct {
Config map[string]interface{} `json:"config"`
}
DatastoreConfigOpts represents options for the datastore's configuration parameters Update request.
type DatastoreCreateOpts ¶
type DatastoreCreateOpts struct { Flavor *Flavor `json:"flavor,omitempty"` Restore *Restore `json:"restore,omitempty"` Pooler *Pooler `json:"pooler,omitempty"` FloatingIPs *FloatingIPs `json:"floating_ips,omitempty"` Config map[string]interface{} `json:"config,omitempty"` Name string `json:"name"` TypeID string `json:"type_id"` SubnetID string `json:"subnet_id"` FlavorID string `json:"flavor_id,omitempty"` RedisPassword string `json:"redis_password,omitempty"` NodeCount int `json:"node_count"` BackupRetentionDays int `json:"backup_retention_days,omitempty"` }
DatastoreCreateOpts represents options for the datastore Create request.
type DatastoreFirewallOpts ¶
type DatastoreFirewallOpts struct {
IPs []string `json:"ips"`
}
DatastoreFirewallOpts represents options for the datastore's firewall rules Update request.
type DatastorePasswordOpts ¶ added in v0.4.0
type DatastorePasswordOpts struct {
RedisPassword string `json:"redis_password"`
}
DatastorePasswordOpts represents options for the Redis datastore's password Update request.
type DatastorePoolerOpts ¶
type DatastorePoolerOpts struct { Mode string `json:"mode,omitempty"` Size int `json:"size,omitempty"` }
DatastorePoolerOpts represents options for the datastore's pooler Update request.
type DatastoreQueryParams ¶
type DatastoreQueryParams struct { ID string `json:"id,omitempty"` ProjectID string `json:"project_id,omitempty"` Name string `json:"name,omitempty"` Status Status `json:"status,omitempty"` Enabled string `json:"enabled,omitempty"` TypeID string `json:"type_id,omitempty"` FlavorID string `json:"flavor_id,omitempty"` SubnetID string `json:"subnet_id,omitempty"` AllowRestore bool `json:"allow_restore,omitempty"` IsMaintenance bool `json:"is_maintenance,omitempty"` IsProtected bool `json:"is_protected,omitempty"` Deleted bool `json:"deleted,omitempty"` }
DatastoreQueryParams represents available query parameters for datastore.
type DatastoreResizeOpts ¶
type DatastoreResizeOpts struct { Flavor *Flavor `json:"flavor,omitempty"` FlavorID string `json:"flavor_id,omitempty"` NodeCount int `json:"node_count,omitempty"` }
DatastoreResizeOpts represents options for the datastore Resize request.
type DatastoreType ¶
type DatastoreType struct { ID string `json:"id"` Engine string `json:"engine"` Version string `json:"version"` }
DatastoreType is the API response for the datastore types.
type DatastoreUpdateOpts ¶
type DatastoreUpdateOpts struct {
Name string `json:"name"`
}
DatastoreUpdateOpts represents options for the datastore Update request.
type Extension ¶
type Extension struct { ID string `json:"id"` ProjectID string `json:"project_id"` AvailableExtensionID string `json:"available_extension_id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` DatastoreID string `json:"datastore_id"` DatabaseID string `json:"database_id"` Status Status `json:"status"` }
Extension is the API response for the extension.
type ExtensionCreateOpts ¶
type ExtensionCreateOpts struct { AvailableExtensionID string `json:"available_extension_id"` DatastoreID string `json:"datastore_id"` DatabaseID string `json:"database_id"` }
ExtensionCreateOpts represents options for the extension Create request.
type ExtensionQueryParams ¶
type ExtensionQueryParams struct { ID string `json:"id,omitempty"` ProjectID string `json:"project_id,omitempty"` AvailableExtensionID string `json:"available_extension_id,omitempty"` DatastoreID string `json:"datastore_id,omitempty"` DatabaseID string `json:"database_id,omitempty"` Status Status `json:"status,omitempty"` }
ExtensionQueryParams represents available query parameters for extension.
type Firewall ¶
type Firewall struct {
IP string `json:"ip"`
}
Firewall represents firewall rules parameters for datastore.
type FlavorResponse ¶
type FlavorResponse struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` FlSize string `json:"fl_size"` DatastoreTypeIDs []string `json:"datastore_type_ids"` Vcpus int `json:"vcpus"` RAM int `json:"ram"` Disk int `json:"disk"` }
FlavorResponse is the API response for the flavors.
type FloatingIPs ¶ added in v0.11.0
FloatingIPs represents floating IPs creation schema.
type FloatingIPsOpts ¶ added in v0.12.0
type FloatingIPsOpts struct {
InstanceID string `json:"instance_id"`
}
FloatingIPsOpts represents create|delete options for creating|deleting Floating IP in|from existed cluster.
type Grant ¶
type Grant struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` ProjectID string `json:"project_id"` DatastoreID string `json:"datastore_id"` DatabaseID string `json:"database_id"` UserID string `json:"user_id"` Status Status `json:"status"` }
Grant is the API response for the grants.
type GrantCreateOpts ¶
type GrantCreateOpts struct { DatastoreID string `json:"datastore_id"` DatabaseID string `json:"database_id"` UserID string `json:"user_id"` }
GrantCreateOpts represents options for the grant Create request.
type Instances ¶
type Instances struct { ID string `json:"id"` IP string `json:"ip"` FloatingIP string `json:"floating_ip"` Role string `json:"role"` Status Status `json:"status"` Hostname string `json:"hostname"` }
Instances represents datastore's instances.
type LogicalReplicationSlot ¶ added in v0.8.0
type LogicalReplicationSlot struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` ProjectID string `json:"project_id"` Name string `json:"name"` DatastoreID string `json:"datastore_id"` DatabaseID string `json:"database_id"` Status Status `json:"status"` }
LogicalReplicationSlot is the API response for the logical replication slot.
type LogicalReplicationSlotCreateOpts ¶ added in v0.8.0
type LogicalReplicationSlotQueryParams ¶ added in v0.8.0
type LogicalReplicationSlotQueryParams struct { ID string `json:"id,omitempty"` ProjectID string `json:"project_id,omitempty"` Name string `json:"name,omitempty"` DatastoreID string `json:"datastore_id,omitempty"` DatabaseID string `json:"database_id,omitempty"` Status Status `json:"status,omitempty"` }
type PrometheusMetricToken ¶ added in v0.3.0
type PrometheusMetricToken struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` ProjectID string `json:"project_id"` Name string `json:"name"` Value string `json:"value"` }
PrometheusMetricToken is the API response for the prometheus metrics tokens.
type PrometheusMetricTokenCreateOpts ¶ added in v0.3.0
type PrometheusMetricTokenCreateOpts struct {
Name string `json:"name"`
}
PrometheusMetricTokenCreateOpts represents options for the prometheus metrics token Create request.
type PrometheusMetricTokenUpdateOpts ¶ added in v0.3.0
type PrometheusMetricTokenUpdateOpts struct {
Name string `json:"name"`
}
PrometheusMetricTokenUpdateOpts represents options for the prometheus metrics token Update request.
type Restore ¶
type Restore struct { DatastoreID string `json:"datastore_id,omitempty"` TargetTime string `json:"target_time,omitempty"` }
Restore represents restore parameters for datastore.
type Status ¶
type Status string
Status represents custom type for various DBaaS objects statuses.
const ( StatusActive Status = "ACTIVE" StatusDeleted Status = "DELETED" StatusDegraded Status = "DEGRADED" StatusDiskFull Status = "DISK_FULL" StatusError Status = "ERROR" StatusPendingCreate Status = "PENDING_CREATE" StatusPendingUpdate Status = "PENDING_UPDATE" StatusPendingDelete Status = "PENDING_DELETE" StatusDown Status = "DOWN" StatusResizing Status = "RESIZING" )
type Topic ¶ added in v0.10.0
type Topic struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` ProjectID string `json:"project_id"` DatastoreID string `json:"datastore_id"` Name string `json:"name"` Status Status `json:"status"` Partitions uint16 `json:"partitions"` }
Topic is the API response for the topics.
type TopicCreateOpts ¶ added in v0.10.0
type TopicCreateOpts struct { DatastoreID string `json:"datastore_id"` Name string `json:"name"` Partitions uint16 `json:"partitions"` }
TopicCreateOpts represents options for the topic Create request.
type TopicQueryParams ¶ added in v0.10.0
type TopicQueryParams struct { ID string `json:"id,omitempty"` ProjectID string `json:"project_id,omitempty"` DatastoreID string `json:"datastore_id,omitempty"` Name string `json:"name,omitempty"` Status Status `json:"status,omitempty"` }
TopicQueryParams represents available query parameters for the topic.
type TopicUpdateOpts ¶ added in v0.10.0
type TopicUpdateOpts struct {
Partitions uint16 `json:"partitions"`
}
TopicUpdateOpts represents options for the topic Update request.
type User ¶
type User struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` ProjectID string `json:"project_id"` DatastoreID string `json:"datastore_id"` Name string `json:"name"` Status Status `json:"status"` }
User is the API response for the users.
type UserCreateOpts ¶
type UserCreateOpts struct { Name string `json:"name"` Password string `json:"password"` DatastoreID string `json:"datastore_id"` }
UserCreateOpts represents options for the user Create request.
type UserUpdateOpts ¶
type UserUpdateOpts struct {
Password string `json:"password"`
}
UserUpdateOpts represents options for the user Update request.