Documentation
¶
Overview ¶
Package serverless_sqldb provides methods and message types of the serverless_sqldb v1alpha1 API.
Index ¶
- Constants
- type API
- func (s *API) CreateDatabase(req *CreateDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
- func (s *API) DeleteDatabase(req *DeleteDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
- func (s *API) ExportDatabaseBackup(req *ExportDatabaseBackupRequest, opts ...scw.RequestOption) (*DatabaseBackup, error)
- func (s *API) GetDatabase(req *GetDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
- func (s *API) GetDatabaseBackup(req *GetDatabaseBackupRequest, opts ...scw.RequestOption) (*DatabaseBackup, error)
- func (s *API) ListDatabaseBackups(req *ListDatabaseBackupsRequest, opts ...scw.RequestOption) (*ListDatabaseBackupsResponse, error)
- func (s *API) ListDatabases(req *ListDatabasesRequest, opts ...scw.RequestOption) (*ListDatabasesResponse, error)
- func (s *API) Regions() []scw.Region
- func (s *API) RestoreDatabaseFromBackup(req *RestoreDatabaseFromBackupRequest, opts ...scw.RequestOption) (*Database, error)
- func (s *API) UpdateDatabase(req *UpdateDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
- func (s *API) WaitForDatabase(req *WaitForDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
- func (s *API) WaitForDatabaseBackup(req *WaitForDatabaseBackupRequest, opts ...scw.RequestOption) (*DatabaseBackup, error)
- type CreateDatabaseRequest
- type Database
- type DatabaseBackup
- type DatabaseBackupStatus
- type DatabaseStatus
- type DeleteDatabaseRequest
- type ExportDatabaseBackupRequest
- type GetDatabaseBackupRequest
- type GetDatabaseRequest
- type ListDatabaseBackupsRequest
- type ListDatabaseBackupsRequestOrderBy
- func (enum ListDatabaseBackupsRequestOrderBy) MarshalJSON() ([]byte, error)
- func (enum ListDatabaseBackupsRequestOrderBy) String() string
- func (enum *ListDatabaseBackupsRequestOrderBy) UnmarshalJSON(data []byte) error
- func (enum ListDatabaseBackupsRequestOrderBy) Values() []ListDatabaseBackupsRequestOrderBy
- type ListDatabaseBackupsResponse
- type ListDatabasesRequest
- type ListDatabasesRequestOrderBy
- type ListDatabasesResponse
- type RestoreDatabaseFromBackupRequest
- type UpdateDatabaseRequest
- type WaitForDatabaseBackupRequest
- type WaitForDatabaseRequest
Constants ¶
const ( DatabaseBackupStatusUnknownStatus = DatabaseBackupStatus("unknown_status") DatabaseBackupStatusError = DatabaseBackupStatus("error") DatabaseBackupStatusReady = DatabaseBackupStatus("ready") DatabaseBackupStatusLocked = DatabaseBackupStatus("locked") )
const ( DatabaseStatusUnknownStatus = DatabaseStatus("unknown_status") DatabaseStatusError = DatabaseStatus("error") DatabaseStatusCreating = DatabaseStatus("creating") DatabaseStatusReady = DatabaseStatus("ready") DatabaseStatusDeleting = DatabaseStatus("deleting") DatabaseStatusRestoring = DatabaseStatus("restoring") DatabaseStatusLocked = DatabaseStatus("locked") )
const ( ListDatabaseBackupsRequestOrderByCreatedAtDesc = ListDatabaseBackupsRequestOrderBy("created_at_desc") ListDatabaseBackupsRequestOrderByCreatedAtAsc = ListDatabaseBackupsRequestOrderBy("created_at_asc") )
const ( ListDatabasesRequestOrderByCreatedAtAsc = ListDatabasesRequestOrderBy("created_at_asc") ListDatabasesRequestOrderByCreatedAtDesc = ListDatabasesRequestOrderBy("created_at_desc") ListDatabasesRequestOrderByNameAsc = ListDatabasesRequestOrderBy("name_asc") ListDatabasesRequestOrderByNameDesc = ListDatabasesRequestOrderBy("name_desc") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
This API allows you to manage your Serverless SQL Databases.
func (*API) CreateDatabase ¶
func (s *API) CreateDatabase(req *CreateDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
CreateDatabase: You must provide the following parameters: `organization_id`, `project_id`, `name`, `cpu_min`, `cpu_max`. You can also provide `from_backup_id` to create a database from a backup.
func (*API) DeleteDatabase ¶
func (s *API) DeleteDatabase(req *DeleteDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
DeleteDatabase: Deletes a database. You must provide the `database_id` parameter. All data stored in the database will be permanently deleted.
func (*API) ExportDatabaseBackup ¶
func (s *API) ExportDatabaseBackup(req *ExportDatabaseBackupRequest, opts ...scw.RequestOption) (*DatabaseBackup, error)
ExportDatabaseBackup: Export a database backup providing a download link once the export process is completed. You must provide the `backup_id` parameter.
func (*API) GetDatabase ¶
func (s *API) GetDatabase(req *GetDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
GetDatabase: Retrieve information about your Serverless SQL Database. You must provide the `database_id` parameter.
func (*API) GetDatabaseBackup ¶
func (s *API) GetDatabaseBackup(req *GetDatabaseBackupRequest, opts ...scw.RequestOption) (*DatabaseBackup, error)
GetDatabaseBackup: Retrieve information about your Serverless SQL Database backup. You must provide the `backup_id` parameter.
func (*API) ListDatabaseBackups ¶
func (s *API) ListDatabaseBackups(req *ListDatabaseBackupsRequest, opts ...scw.RequestOption) (*ListDatabaseBackupsResponse, error)
ListDatabaseBackups: List all Serverless SQL Database backups for a given Scaleway Project or Database. By default, the backups returned in the list are ordered by creation date in descending order, though this can be modified via the order_by field.
func (*API) ListDatabases ¶
func (s *API) ListDatabases(req *ListDatabasesRequest, opts ...scw.RequestOption) (*ListDatabasesResponse, error)
ListDatabases: List all Serverless SQL Databases for a given Scaleway Organization or Scaleway Project. By default, the databases returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.
func (*API) RestoreDatabaseFromBackup ¶
func (s *API) RestoreDatabaseFromBackup(req *RestoreDatabaseFromBackupRequest, opts ...scw.RequestOption) (*Database, error)
RestoreDatabaseFromBackup: Restore a database from a backup. You must provide the `backup_id` parameter.
func (*API) UpdateDatabase ¶
func (s *API) UpdateDatabase(req *UpdateDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
UpdateDatabase: Update CPU limits of your Serverless SQL Database. You must provide the `database_id` parameter.
func (*API) WaitForDatabase ¶
func (s *API) WaitForDatabase(req *WaitForDatabaseRequest, opts ...scw.RequestOption) (*Database, error)
WaitForDatabase waits for the database to be in a "terminal state" before returning. This function can be used to wait for a database to be ready for example.
func (*API) WaitForDatabaseBackup ¶
func (s *API) WaitForDatabaseBackup(req *WaitForDatabaseBackupRequest, opts ...scw.RequestOption) (*DatabaseBackup, error)
WaitForDatabaseBackup waits for the backup to be in a "terminal state" before returning. This function can be used to wait for a backup to be ready for example.
type CreateDatabaseRequest ¶
type CreateDatabaseRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // ProjectID: the ID of your Scaleway project. ProjectID string `json:"project_id"` // Name: the name of the Serverless SQL Database to be created. Name string `json:"name"` // CPUMin: the minimum number of CPU units for your Serverless SQL Database. CPUMin uint32 `json:"cpu_min"` // CPUMax: the maximum number of CPU units for your Serverless SQL Database. CPUMax uint32 `json:"cpu_max"` // FromBackupID: the ID of the backup to create the database from. FromBackupID *string `json:"from_backup_id,omitempty"` }
CreateDatabaseRequest: create database request.
type Database ¶
type Database struct { // ID: UUID that uniquely identifies your Serverless SQL DB Database. ID string `json:"id"` // Name: name of the database. Name string `json:"name"` // Status: status of the Serverless SQL Ddatabase. One of `unknown_status` | `ready` | `creating` | `deleting` | `error` | `restoring` | `locked`. // Default value: unknown_status Status DatabaseStatus `json:"status"` // Endpoint: endpoint of the database. Endpoint string `json:"endpoint"` // OrganizationID: the ID of your Scaleway organization. OrganizationID string `json:"organization_id"` // ProjectID: project ID the database belongs to. ProjectID string `json:"project_id"` // Region: region of the database. Region scw.Region `json:"region"` // CreatedAt: creation date. CreatedAt *time.Time `json:"created_at"` // CPUMin: the minimum number of CPU units for your Serverless SQL Database. CPUMin uint32 `json:"cpu_min"` // CPUMax: the maximum number of CPU units for your Serverless SQL Database. CPUMax uint32 `json:"cpu_max"` // CPUCurrent: the current number of CPU units allocated to your Serverless SQL Database. CPUCurrent uint32 `json:"cpu_current"` // Started: whether your Serverless SQL Database is running or not. Started bool `json:"started"` // EngineMajorVersion: the major version of the underlying database engine. EngineMajorVersion uint32 `json:"engine_major_version"` }
Database: database.
type DatabaseBackup ¶
type DatabaseBackup struct { // ID: UUID that uniquely identifies a Serverless SQL Database backup. ID string `json:"id"` // Status: status of the Serverless SQL Database backup. One of `unknown_status` | `error` | `ready` | `locked`. // Default value: unknown_status Status DatabaseBackupStatus `json:"status"` // OrganizationID: the ID of your Scaleway organization. OrganizationID string `json:"organization_id"` // ProjectID: UUID of the Scaleway project. ProjectID string `json:"project_id"` // DatabaseID: UUID of the source Serverless SQL Database the backup is created from. DatabaseID string `json:"database_id"` // CreatedAt: creation date. CreatedAt *time.Time `json:"created_at"` // ExpiresAt: expiration date. ExpiresAt *time.Time `json:"expires_at"` // Size: size (in bytes) of the database backup file. Size *scw.Size `json:"size"` // DbSize: size (in bytes) of the database when backup has been done. DbSize *scw.Size `json:"db_size"` // DownloadURL: download URL of the exported database backup. DownloadURL *string `json:"download_url"` // DownloadURLExpiresAt: expiration date of the download URL. DownloadURLExpiresAt *time.Time `json:"download_url_expires_at"` // Region: region of the database backup. Region scw.Region `json:"region"` }
DatabaseBackup: database backup.
type DatabaseBackupStatus ¶
type DatabaseBackupStatus string
func (DatabaseBackupStatus) MarshalJSON ¶
func (enum DatabaseBackupStatus) MarshalJSON() ([]byte, error)
func (DatabaseBackupStatus) String ¶
func (enum DatabaseBackupStatus) String() string
func (*DatabaseBackupStatus) UnmarshalJSON ¶
func (enum *DatabaseBackupStatus) UnmarshalJSON(data []byte) error
func (DatabaseBackupStatus) Values ¶
func (enum DatabaseBackupStatus) Values() []DatabaseBackupStatus
type DatabaseStatus ¶
type DatabaseStatus string
func (DatabaseStatus) MarshalJSON ¶
func (enum DatabaseStatus) MarshalJSON() ([]byte, error)
func (DatabaseStatus) String ¶
func (enum DatabaseStatus) String() string
func (*DatabaseStatus) UnmarshalJSON ¶
func (enum *DatabaseStatus) UnmarshalJSON(data []byte) error
func (DatabaseStatus) Values ¶
func (enum DatabaseStatus) Values() []DatabaseStatus
type DeleteDatabaseRequest ¶
type DeleteDatabaseRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // DatabaseID: UUID of the Serverless SQL Database. DatabaseID string `json:"-"` }
DeleteDatabaseRequest: delete database request.
type ExportDatabaseBackupRequest ¶
type ExportDatabaseBackupRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // BackupID: UUID of the Serverless SQL Database backup. BackupID string `json:"-"` }
ExportDatabaseBackupRequest: export database backup request.
type GetDatabaseBackupRequest ¶
type GetDatabaseBackupRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // BackupID: UUID of the Serverless SQL Database backup. BackupID string `json:"-"` }
GetDatabaseBackupRequest: get database backup request.
type GetDatabaseRequest ¶
type GetDatabaseRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // DatabaseID: UUID of the Serverless SQL DB database. DatabaseID string `json:"-"` }
GetDatabaseRequest: get database request.
type ListDatabaseBackupsRequest ¶
type ListDatabaseBackupsRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // OrganizationID: filter by the UUID of the Scaleway organization. OrganizationID *string `json:"-"` // ProjectID: filter by the UUID of the Scaleway project. ProjectID *string `json:"-"` // DatabaseID: filter by the UUID of the Serverless SQL Database. DatabaseID string `json:"-"` // Page: page number. Page *int32 `json:"-"` // PageSize: page size. PageSize *uint32 `json:"-"` // OrderBy: sorting criteria. One of `created_at_asc`, `created_at_desc`. // Default value: created_at_desc OrderBy ListDatabaseBackupsRequestOrderBy `json:"-"` }
ListDatabaseBackupsRequest: list database backups request.
type ListDatabaseBackupsRequestOrderBy ¶
type ListDatabaseBackupsRequestOrderBy string
func (ListDatabaseBackupsRequestOrderBy) MarshalJSON ¶
func (enum ListDatabaseBackupsRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListDatabaseBackupsRequestOrderBy) String ¶
func (enum ListDatabaseBackupsRequestOrderBy) String() string
func (*ListDatabaseBackupsRequestOrderBy) UnmarshalJSON ¶
func (enum *ListDatabaseBackupsRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListDatabaseBackupsRequestOrderBy) Values ¶
func (enum ListDatabaseBackupsRequestOrderBy) Values() []ListDatabaseBackupsRequestOrderBy
type ListDatabaseBackupsResponse ¶
type ListDatabaseBackupsResponse struct { // Backups: list of the backups. Backups []*DatabaseBackup `json:"backups"` // TotalCount: length of the backups list. TotalCount uint64 `json:"total_count"` }
ListDatabaseBackupsResponse: list database backups response.
func (*ListDatabaseBackupsResponse) UnsafeAppend ¶
func (r *ListDatabaseBackupsResponse) UnsafeAppend(res interface{}) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListDatabaseBackupsResponse) UnsafeGetTotalCount ¶
func (r *ListDatabaseBackupsResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type ListDatabasesRequest ¶
type ListDatabasesRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // OrganizationID: filter by the UUID of the Scaleway organization. OrganizationID *string `json:"-"` // ProjectID: UUID of the Scaleway project. ProjectID string `json:"-"` // Page: page number. Page *int32 `json:"-"` // PageSize: page size. PageSize *uint32 `json:"-"` // Name: filter by the name of the database. Name *string `json:"-"` // OrderBy: sorting criteria. One of `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc`. // Default value: created_at_asc OrderBy ListDatabasesRequestOrderBy `json:"-"` }
ListDatabasesRequest: list databases request.
type ListDatabasesRequestOrderBy ¶
type ListDatabasesRequestOrderBy string
func (ListDatabasesRequestOrderBy) MarshalJSON ¶
func (enum ListDatabasesRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListDatabasesRequestOrderBy) String ¶
func (enum ListDatabasesRequestOrderBy) String() string
func (*ListDatabasesRequestOrderBy) UnmarshalJSON ¶
func (enum *ListDatabasesRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListDatabasesRequestOrderBy) Values ¶
func (enum ListDatabasesRequestOrderBy) Values() []ListDatabasesRequestOrderBy
type ListDatabasesResponse ¶
type ListDatabasesResponse struct { // Databases: list of the databases. Databases []*Database `json:"databases"` // TotalCount: total count of Serverless SQL Databases. TotalCount uint64 `json:"total_count"` }
ListDatabasesResponse: list databases response.
func (*ListDatabasesResponse) UnsafeAppend ¶
func (r *ListDatabasesResponse) UnsafeAppend(res interface{}) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListDatabasesResponse) UnsafeGetTotalCount ¶
func (r *ListDatabasesResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type RestoreDatabaseFromBackupRequest ¶
type RestoreDatabaseFromBackupRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // DatabaseID: UUID of the Serverless SQL Database. DatabaseID string `json:"-"` // BackupID: UUID of the Serverless SQL Database backup to restore. BackupID string `json:"backup_id"` }
RestoreDatabaseFromBackupRequest: restore database from backup request.
type UpdateDatabaseRequest ¶
type UpdateDatabaseRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // DatabaseID: UUID of the Serverless SQL Database. DatabaseID string `json:"-"` // CPUMin: the minimum number of CPU units for your Serverless SQL Database. CPUMin *uint32 `json:"cpu_min,omitempty"` // CPUMax: the maximum number of CPU units for your Serverless SQL Database. CPUMax *uint32 `json:"cpu_max,omitempty"` }
UpdateDatabaseRequest: update database request.