scaleway.serverless_sqldb.v1alpha1 package

Submodules

scaleway.serverless_sqldb.v1alpha1.api module

class scaleway.serverless_sqldb.v1alpha1.api.ServerlessSqldbV1Alpha1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Serverless SQL Databases.

create_database(*, name: str, cpu_min: int, cpu_max: int, region: str | None = None, project_id: str | None = None, from_backup_id: str | None = None) Database

Create a new Serverless SQL Database. 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. :param name: The name of the Serverless SQL Database to be created. :param cpu_min: The minimum number of CPU units for your Serverless SQL Database. :param cpu_max: The maximum number of CPU units for your Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :param project_id: The ID of your Scaleway project. :param from_backup_id: The ID of the backup to create the database from. :return: Database

Usage:

result = api.create_database(
    name="example",
    cpu_min=1,
    cpu_max=1,
)
delete_database(*, database_id: str, region: str | None = None) Database

Delete a database. Deletes a database. You must provide the database_id parameter. All data stored in the database will be permanently deleted. :param database_id: UUID of the Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :return: Database

Usage:

result = api.delete_database(
    database_id="example",
)
export_database_backup(*, backup_id: str, region: str | None = None) DatabaseBackup

Export a database backup. Export a database backup providing a download link once the export process is completed. You must provide the backup_id parameter. :param backup_id: UUID of the Serverless SQL Database backup. :param region: Region to target. If none is passed will use default region from the config. :return: DatabaseBackup

Usage:

result = api.export_database_backup(
    backup_id="example",
)
get_database(*, database_id: str, region: str | None = None) Database

Get a database information. Retrieve information about your Serverless SQL Database. You must provide the database_id parameter. :param database_id: UUID of the Serverless SQL DB database. :param region: Region to target. If none is passed will use default region from the config. :return: Database

Usage:

result = api.get_database(
    database_id="example",
)
get_database_backup(*, backup_id: str, region: str | None = None) DatabaseBackup

Get a database backup information. Retrieve information about your Serverless SQL Database backup. You must provide the backup_id parameter. :param backup_id: UUID of the Serverless SQL Database backup. :param region: Region to target. If none is passed will use default region from the config. :return: DatabaseBackup

Usage:

result = api.get_database_backup(
    backup_id="example",
)
list_database_backups(*, database_id: str, region: str | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListDatabaseBackupsRequestOrderBy | None = None) ListDatabaseBackupsResponse

List your Serverless SQL Database backups. 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. :param database_id: Filter by the UUID of the Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :param organization_id: Filter by the UUID of the Scaleway organization. :param project_id: Filter by the UUID of the Scaleway project. :param page: Page number. :param page_size: Page size. :param order_by: Sorting criteria. One of created_at_asc, created_at_desc. :return: ListDatabaseBackupsResponse

Usage:

result = api.list_database_backups(
    database_id="example",
)
list_database_backups_all(*, database_id: str, region: str | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListDatabaseBackupsRequestOrderBy | None = None) List[DatabaseBackup]

List your Serverless SQL Database backups. 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. :param database_id: Filter by the UUID of the Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :param organization_id: Filter by the UUID of the Scaleway organization. :param project_id: Filter by the UUID of the Scaleway project. :param page: Page number. :param page_size: Page size. :param order_by: Sorting criteria. One of created_at_asc, created_at_desc. :return: List[DatabaseBackup]

Usage:

result = api.list_database_backups_all(
    database_id="example",
)
list_databases(*, region: str | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None, name: str | None = None, order_by: ListDatabasesRequestOrderBy | None = None) ListDatabasesResponse

List your Serverless SQL Databases. 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. :param region: Region to target. If none is passed will use default region from the config. :param organization_id: Filter by the UUID of the Scaleway organization. :param project_id: UUID of the Scaleway project. :param page: Page number. :param page_size: Page size. :param name: Filter by the name of the database. :param order_by: Sorting criteria. One of created_at_asc, created_at_desc, name_asc, name_desc. :return: ListDatabasesResponse

Usage:

result = api.list_databases()
list_databases_all(*, region: str | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None, name: str | None = None, order_by: ListDatabasesRequestOrderBy | None = None) List[Database]

List your Serverless SQL Databases. 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. :param region: Region to target. If none is passed will use default region from the config. :param organization_id: Filter by the UUID of the Scaleway organization. :param project_id: UUID of the Scaleway project. :param page: Page number. :param page_size: Page size. :param name: Filter by the name of the database. :param order_by: Sorting criteria. One of created_at_asc, created_at_desc, name_asc, name_desc. :return: List[Database]

Usage:

result = api.list_databases_all()
restore_database_from_backup(*, database_id: str, backup_id: str, region: str | None = None) Database

Restore a database from a backup. Restore a database from a backup. You must provide the backup_id parameter. :param database_id: UUID of the Serverless SQL Database. :param backup_id: UUID of the Serverless SQL Database backup to restore. :param region: Region to target. If none is passed will use default region from the config. :return: Database

Usage:

result = api.restore_database_from_backup(
    database_id="example",
    backup_id="example",
)
update_database(*, database_id: str, region: str | None = None, cpu_min: int | None = None, cpu_max: int | None = None) Database

Update database information. Update CPU limits of your Serverless SQL Database. You must provide the database_id parameter. :param database_id: UUID of the Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :param cpu_min: The minimum number of CPU units for your Serverless SQL Database. :param cpu_max: The maximum number of CPU units for your Serverless SQL Database. :return: Database

Usage:

result = api.update_database(
    database_id="example",
)
wait_for_database(*, database_id: str, region: str | None = None, options: WaitForOptions[Database, bool] | None = None) Database

Get a database information. Retrieve information about your Serverless SQL Database. You must provide the database_id parameter. :param database_id: UUID of the Serverless SQL DB database. :param region: Region to target. If none is passed will use default region from the config. :return: Database

Usage:

result = api.get_database(
    database_id="example",
)

scaleway.serverless_sqldb.v1alpha1.content module

scaleway.serverless_sqldb.v1alpha1.content.DATABASE_TRANSIENT_STATUSES: List[DatabaseStatus] = [<DatabaseStatus.CREATING: 'creating'>, <DatabaseStatus.DELETING: 'deleting'>, <DatabaseStatus.RESTORING: 'restoring'>]

Lists transient statutes of the enum DatabaseStatus.

scaleway.serverless_sqldb.v1alpha1.marshalling module

scaleway.serverless_sqldb.v1alpha1.marshalling.marshal_CreateDatabaseRequest(request: CreateDatabaseRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.serverless_sqldb.v1alpha1.marshalling.marshal_RestoreDatabaseFromBackupRequest(request: RestoreDatabaseFromBackupRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.serverless_sqldb.v1alpha1.marshalling.marshal_UpdateDatabaseRequest(request: UpdateDatabaseRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.serverless_sqldb.v1alpha1.marshalling.unmarshal_Database(data: Any) Database
scaleway.serverless_sqldb.v1alpha1.marshalling.unmarshal_DatabaseBackup(data: Any) DatabaseBackup
scaleway.serverless_sqldb.v1alpha1.marshalling.unmarshal_ListDatabaseBackupsResponse(data: Any) ListDatabaseBackupsResponse
scaleway.serverless_sqldb.v1alpha1.marshalling.unmarshal_ListDatabasesResponse(data: Any) ListDatabasesResponse

scaleway.serverless_sqldb.v1alpha1.types module

class scaleway.serverless_sqldb.v1alpha1.types.CreateDatabaseRequest(name: 'str', cpu_min: 'int', cpu_max: 'int', region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, from_backup_id: 'Optional[str]' = None)

Bases: object

cpu_max: int

The maximum number of CPU units for your Serverless SQL Database.

cpu_min: int

The minimum number of CPU units for your Serverless SQL Database.

from_backup_id: str | None = None

The ID of the backup to create the database from.

name: str

The name of the Serverless SQL Database to be created.

project_id: str | None = None

The ID of your Scaleway project.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.types.Database(id: 'str', name: 'str', status: 'DatabaseStatus', endpoint: 'str', organization_id: 'str', project_id: 'str', region: 'ScwRegion', cpu_min: 'int', cpu_max: 'int', cpu_current: 'int', started: 'bool', engine_major_version: 'int', created_at: 'Optional[datetime]' = None)

Bases: object

cpu_current: int

The current number of CPU units allocated to your Serverless SQL Database.

cpu_max: int

The maximum number of CPU units for your Serverless SQL Database.

cpu_min: int

The minimum number of CPU units for your Serverless SQL Database.

created_at: datetime | None = None

Creation date.

endpoint: str

Endpoint of the database.

engine_major_version: int

The major version of the underlying database engine.

id: str

UUID that uniquely identifies your Serverless SQL DB Database.

name: str

Name of the database.

organization_id: str

The ID of your Scaleway organization.

project_id: str

Project ID the database belongs to.

region: str

Region of the database.

started: bool

Whether your Serverless SQL Database is running or not.

status: DatabaseStatus

Status of the Serverless SQL Ddatabase. One of unknown_status | ready | creating | deleting | error | restoring | locked.

class scaleway.serverless_sqldb.v1alpha1.types.DatabaseBackup(id: 'str', status: 'DatabaseBackupStatus', organization_id: 'str', project_id: 'str', database_id: 'str', region: 'ScwRegion', created_at: 'Optional[datetime]' = None, expires_at: 'Optional[datetime]' = None, size: 'Optional[int]' = 0, db_size: 'Optional[int]' = 0, download_url: 'Optional[str]' = None, download_url_expires_at: 'Optional[datetime]' = None)

Bases: object

created_at: datetime | None = None

Creation date.

database_id: str

UUID of the source Serverless SQL Database the backup is created from.

db_size: int | None = 0

Size (in bytes) of the database when backup has been done.

download_url: str | None = None

Download URL of the exported database backup.

download_url_expires_at: datetime | None = None

Expiration date of the download URL.

expires_at: datetime | None = None

Expiration date.

id: str

UUID that uniquely identifies a Serverless SQL Database backup.

organization_id: str

The ID of your Scaleway organization.

project_id: str

UUID of the Scaleway project.

region: str

Region of the database backup.

size: int | None = 0

Size (in bytes) of the database backup file.

status: DatabaseBackupStatus

Status of the Serverless SQL Database backup. One of unknown_status | error | ready | locked.

class scaleway.serverless_sqldb.v1alpha1.types.DatabaseBackupStatus(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

ERROR = 'error'
LOCKED = 'locked'
READY = 'ready'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.serverless_sqldb.v1alpha1.types.DatabaseStatus(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CREATING = 'creating'
DELETING = 'deleting'
ERROR = 'error'
LOCKED = 'locked'
READY = 'ready'
RESTORING = 'restoring'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.serverless_sqldb.v1alpha1.types.DeleteDatabaseRequest(database_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

database_id: str

UUID of the Serverless SQL Database.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.types.ExportDatabaseBackupRequest(backup_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.types.GetDatabaseBackupRequest(backup_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.types.GetDatabaseRequest(database_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

database_id: str

UUID of the Serverless SQL DB database.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.types.ListDatabaseBackupsRequest(database_id: 'str', region: 'Optional[ScwRegion]' = None, organization_id: 'Optional[str]' = None, project_id: 'Optional[str]' = None, page: 'Optional[int]' = None, page_size: 'Optional[int]' = None, order_by: 'Optional[ListDatabaseBackupsRequestOrderBy]' = <ListDatabaseBackupsRequestOrderBy.CREATED_AT_DESC: 'created_at_desc'>)

Bases: object

database_id: str

Filter by the UUID of the Serverless SQL Database.

order_by: ListDatabaseBackupsRequestOrderBy | None = 'created_at_desc'

Sorting criteria. One of created_at_asc, created_at_desc.

organization_id: str | None = None

Filter by the UUID of the Scaleway organization.

page: int | None = None

Page number.

page_size: int | None = None

Page size.

project_id: str | None = None

Filter by the UUID of the Scaleway project.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.types.ListDatabaseBackupsRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
class scaleway.serverless_sqldb.v1alpha1.types.ListDatabaseBackupsResponse(backups: 'List[DatabaseBackup]', total_count: 'int')

Bases: object

backups: List[DatabaseBackup]

List of the backups.

total_count: int

Length of the backups list.

class scaleway.serverless_sqldb.v1alpha1.types.ListDatabasesRequest(region: 'Optional[ScwRegion]' = None, organization_id: 'Optional[str]' = None, project_id: 'Optional[str]' = None, page: 'Optional[int]' = None, page_size: 'Optional[int]' = None, name: 'Optional[str]' = None, order_by: 'Optional[ListDatabasesRequestOrderBy]' = <ListDatabasesRequestOrderBy.CREATED_AT_ASC: 'created_at_asc'>)

Bases: object

name: str | None = None

Filter by the name of the database.

order_by: ListDatabasesRequestOrderBy | None = 'created_at_asc'

Sorting criteria. One of created_at_asc, created_at_desc, name_asc, name_desc.

organization_id: str | None = None

Filter by the UUID of the Scaleway organization.

page: int | None = None

Page number.

page_size: int | None = None

Page size.

project_id: str | None = None

UUID of the Scaleway project.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.types.ListDatabasesRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.serverless_sqldb.v1alpha1.types.ListDatabasesResponse(databases: 'List[Database]', total_count: 'int')

Bases: object

databases: List[Database]

List of the databases.

total_count: int

Total count of Serverless SQL Databases.

class scaleway.serverless_sqldb.v1alpha1.types.RestoreDatabaseFromBackupRequest(database_id: 'str', backup_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup to restore.

database_id: str

UUID of the Serverless SQL Database.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.types.UpdateDatabaseRequest(database_id: 'str', region: 'Optional[ScwRegion]' = None, cpu_min: 'Optional[int]' = 0, cpu_max: 'Optional[int]' = 0)

Bases: object

cpu_max: int | None = 0

The maximum number of CPU units for your Serverless SQL Database.

cpu_min: int | None = 0

The minimum number of CPU units for your Serverless SQL Database.

database_id: str

UUID of the Serverless SQL Database.

region: str | None = None

Region to target. If none is passed will use default region from the config.

Module contents

class scaleway.serverless_sqldb.v1alpha1.CreateDatabaseRequest(name: 'str', cpu_min: 'int', cpu_max: 'int', region: 'Optional[ScwRegion]' = None, project_id: 'Optional[str]' = None, from_backup_id: 'Optional[str]' = None)

Bases: object

cpu_max: int

The maximum number of CPU units for your Serverless SQL Database.

cpu_min: int

The minimum number of CPU units for your Serverless SQL Database.

from_backup_id: str | None = None

The ID of the backup to create the database from.

name: str

The name of the Serverless SQL Database to be created.

project_id: str | None = None

The ID of your Scaleway project.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.Database(id: 'str', name: 'str', status: 'DatabaseStatus', endpoint: 'str', organization_id: 'str', project_id: 'str', region: 'ScwRegion', cpu_min: 'int', cpu_max: 'int', cpu_current: 'int', started: 'bool', engine_major_version: 'int', created_at: 'Optional[datetime]' = None)

Bases: object

cpu_current: int

The current number of CPU units allocated to your Serverless SQL Database.

cpu_max: int

The maximum number of CPU units for your Serverless SQL Database.

cpu_min: int

The minimum number of CPU units for your Serverless SQL Database.

created_at: datetime | None = None

Creation date.

endpoint: str

Endpoint of the database.

engine_major_version: int

The major version of the underlying database engine.

id: str

UUID that uniquely identifies your Serverless SQL DB Database.

name: str

Name of the database.

organization_id: str

The ID of your Scaleway organization.

project_id: str

Project ID the database belongs to.

region: str

Region of the database.

started: bool

Whether your Serverless SQL Database is running or not.

status: DatabaseStatus

Status of the Serverless SQL Ddatabase. One of unknown_status | ready | creating | deleting | error | restoring | locked.

class scaleway.serverless_sqldb.v1alpha1.DatabaseBackup(id: 'str', status: 'DatabaseBackupStatus', organization_id: 'str', project_id: 'str', database_id: 'str', region: 'ScwRegion', created_at: 'Optional[datetime]' = None, expires_at: 'Optional[datetime]' = None, size: 'Optional[int]' = 0, db_size: 'Optional[int]' = 0, download_url: 'Optional[str]' = None, download_url_expires_at: 'Optional[datetime]' = None)

Bases: object

created_at: datetime | None = None

Creation date.

database_id: str

UUID of the source Serverless SQL Database the backup is created from.

db_size: int | None = 0

Size (in bytes) of the database when backup has been done.

download_url: str | None = None

Download URL of the exported database backup.

download_url_expires_at: datetime | None = None

Expiration date of the download URL.

expires_at: datetime | None = None

Expiration date.

id: str

UUID that uniquely identifies a Serverless SQL Database backup.

organization_id: str

The ID of your Scaleway organization.

project_id: str

UUID of the Scaleway project.

region: str

Region of the database backup.

size: int | None = 0

Size (in bytes) of the database backup file.

status: DatabaseBackupStatus

Status of the Serverless SQL Database backup. One of unknown_status | error | ready | locked.

class scaleway.serverless_sqldb.v1alpha1.DatabaseBackupStatus(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

ERROR = 'error'
LOCKED = 'locked'
READY = 'ready'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.serverless_sqldb.v1alpha1.DatabaseStatus(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CREATING = 'creating'
DELETING = 'deleting'
ERROR = 'error'
LOCKED = 'locked'
READY = 'ready'
RESTORING = 'restoring'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.serverless_sqldb.v1alpha1.DeleteDatabaseRequest(database_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

database_id: str

UUID of the Serverless SQL Database.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.ExportDatabaseBackupRequest(backup_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.GetDatabaseBackupRequest(backup_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.GetDatabaseRequest(database_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

database_id: str

UUID of the Serverless SQL DB database.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.ListDatabaseBackupsRequest(database_id: 'str', region: 'Optional[ScwRegion]' = None, organization_id: 'Optional[str]' = None, project_id: 'Optional[str]' = None, page: 'Optional[int]' = None, page_size: 'Optional[int]' = None, order_by: 'Optional[ListDatabaseBackupsRequestOrderBy]' = <ListDatabaseBackupsRequestOrderBy.CREATED_AT_DESC: 'created_at_desc'>)

Bases: object

database_id: str

Filter by the UUID of the Serverless SQL Database.

order_by: ListDatabaseBackupsRequestOrderBy | None = 'created_at_desc'

Sorting criteria. One of created_at_asc, created_at_desc.

organization_id: str | None = None

Filter by the UUID of the Scaleway organization.

page: int | None = None

Page number.

page_size: int | None = None

Page size.

project_id: str | None = None

Filter by the UUID of the Scaleway project.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.ListDatabaseBackupsRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
class scaleway.serverless_sqldb.v1alpha1.ListDatabaseBackupsResponse(backups: 'List[DatabaseBackup]', total_count: 'int')

Bases: object

backups: List[DatabaseBackup]

List of the backups.

total_count: int

Length of the backups list.

class scaleway.serverless_sqldb.v1alpha1.ListDatabasesRequest(region: 'Optional[ScwRegion]' = None, organization_id: 'Optional[str]' = None, project_id: 'Optional[str]' = None, page: 'Optional[int]' = None, page_size: 'Optional[int]' = None, name: 'Optional[str]' = None, order_by: 'Optional[ListDatabasesRequestOrderBy]' = <ListDatabasesRequestOrderBy.CREATED_AT_ASC: 'created_at_asc'>)

Bases: object

name: str | None = None

Filter by the name of the database.

order_by: ListDatabasesRequestOrderBy | None = 'created_at_asc'

Sorting criteria. One of created_at_asc, created_at_desc, name_asc, name_desc.

organization_id: str | None = None

Filter by the UUID of the Scaleway organization.

page: int | None = None

Page number.

page_size: int | None = None

Page size.

project_id: str | None = None

UUID of the Scaleway project.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.ListDatabasesRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CREATED_AT_ASC = 'created_at_asc'
CREATED_AT_DESC = 'created_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.serverless_sqldb.v1alpha1.ListDatabasesResponse(databases: 'List[Database]', total_count: 'int')

Bases: object

databases: List[Database]

List of the databases.

total_count: int

Total count of Serverless SQL Databases.

class scaleway.serverless_sqldb.v1alpha1.RestoreDatabaseFromBackupRequest(database_id: 'str', backup_id: 'str', region: 'Optional[ScwRegion]' = None)

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup to restore.

database_id: str

UUID of the Serverless SQL Database.

region: str | None = None

Region to target. If none is passed will use default region from the config.

class scaleway.serverless_sqldb.v1alpha1.ServerlessSqldbV1Alpha1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Serverless SQL Databases.

create_database(*, name: str, cpu_min: int, cpu_max: int, region: str | None = None, project_id: str | None = None, from_backup_id: str | None = None) Database

Create a new Serverless SQL Database. 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. :param name: The name of the Serverless SQL Database to be created. :param cpu_min: The minimum number of CPU units for your Serverless SQL Database. :param cpu_max: The maximum number of CPU units for your Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :param project_id: The ID of your Scaleway project. :param from_backup_id: The ID of the backup to create the database from. :return: Database

Usage:

result = api.create_database(
    name="example",
    cpu_min=1,
    cpu_max=1,
)
delete_database(*, database_id: str, region: str | None = None) Database

Delete a database. Deletes a database. You must provide the database_id parameter. All data stored in the database will be permanently deleted. :param database_id: UUID of the Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :return: Database

Usage:

result = api.delete_database(
    database_id="example",
)
export_database_backup(*, backup_id: str, region: str | None = None) DatabaseBackup

Export a database backup. Export a database backup providing a download link once the export process is completed. You must provide the backup_id parameter. :param backup_id: UUID of the Serverless SQL Database backup. :param region: Region to target. If none is passed will use default region from the config. :return: DatabaseBackup

Usage:

result = api.export_database_backup(
    backup_id="example",
)
get_database(*, database_id: str, region: str | None = None) Database

Get a database information. Retrieve information about your Serverless SQL Database. You must provide the database_id parameter. :param database_id: UUID of the Serverless SQL DB database. :param region: Region to target. If none is passed will use default region from the config. :return: Database

Usage:

result = api.get_database(
    database_id="example",
)
get_database_backup(*, backup_id: str, region: str | None = None) DatabaseBackup

Get a database backup information. Retrieve information about your Serverless SQL Database backup. You must provide the backup_id parameter. :param backup_id: UUID of the Serverless SQL Database backup. :param region: Region to target. If none is passed will use default region from the config. :return: DatabaseBackup

Usage:

result = api.get_database_backup(
    backup_id="example",
)
list_database_backups(*, database_id: str, region: str | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListDatabaseBackupsRequestOrderBy | None = None) ListDatabaseBackupsResponse

List your Serverless SQL Database backups. 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. :param database_id: Filter by the UUID of the Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :param organization_id: Filter by the UUID of the Scaleway organization. :param project_id: Filter by the UUID of the Scaleway project. :param page: Page number. :param page_size: Page size. :param order_by: Sorting criteria. One of created_at_asc, created_at_desc. :return: ListDatabaseBackupsResponse

Usage:

result = api.list_database_backups(
    database_id="example",
)
list_database_backups_all(*, database_id: str, region: str | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None, order_by: ListDatabaseBackupsRequestOrderBy | None = None) List[DatabaseBackup]

List your Serverless SQL Database backups. 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. :param database_id: Filter by the UUID of the Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :param organization_id: Filter by the UUID of the Scaleway organization. :param project_id: Filter by the UUID of the Scaleway project. :param page: Page number. :param page_size: Page size. :param order_by: Sorting criteria. One of created_at_asc, created_at_desc. :return: List[DatabaseBackup]

Usage:

result = api.list_database_backups_all(
    database_id="example",
)
list_databases(*, region: str | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None, name: str | None = None, order_by: ListDatabasesRequestOrderBy | None = None) ListDatabasesResponse

List your Serverless SQL Databases. 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. :param region: Region to target. If none is passed will use default region from the config. :param organization_id: Filter by the UUID of the Scaleway organization. :param project_id: UUID of the Scaleway project. :param page: Page number. :param page_size: Page size. :param name: Filter by the name of the database. :param order_by: Sorting criteria. One of created_at_asc, created_at_desc, name_asc, name_desc. :return: ListDatabasesResponse

Usage:

result = api.list_databases()
list_databases_all(*, region: str | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None, name: str | None = None, order_by: ListDatabasesRequestOrderBy | None = None) List[Database]

List your Serverless SQL Databases. 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. :param region: Region to target. If none is passed will use default region from the config. :param organization_id: Filter by the UUID of the Scaleway organization. :param project_id: UUID of the Scaleway project. :param page: Page number. :param page_size: Page size. :param name: Filter by the name of the database. :param order_by: Sorting criteria. One of created_at_asc, created_at_desc, name_asc, name_desc. :return: List[Database]

Usage:

result = api.list_databases_all()
restore_database_from_backup(*, database_id: str, backup_id: str, region: str | None = None) Database

Restore a database from a backup. Restore a database from a backup. You must provide the backup_id parameter. :param database_id: UUID of the Serverless SQL Database. :param backup_id: UUID of the Serverless SQL Database backup to restore. :param region: Region to target. If none is passed will use default region from the config. :return: Database

Usage:

result = api.restore_database_from_backup(
    database_id="example",
    backup_id="example",
)
update_database(*, database_id: str, region: str | None = None, cpu_min: int | None = None, cpu_max: int | None = None) Database

Update database information. Update CPU limits of your Serverless SQL Database. You must provide the database_id parameter. :param database_id: UUID of the Serverless SQL Database. :param region: Region to target. If none is passed will use default region from the config. :param cpu_min: The minimum number of CPU units for your Serverless SQL Database. :param cpu_max: The maximum number of CPU units for your Serverless SQL Database. :return: Database

Usage:

result = api.update_database(
    database_id="example",
)
wait_for_database(*, database_id: str, region: str | None = None, options: WaitForOptions[Database, bool] | None = None) Database

Get a database information. Retrieve information about your Serverless SQL Database. You must provide the database_id parameter. :param database_id: UUID of the Serverless SQL DB database. :param region: Region to target. If none is passed will use default region from the config. :return: Database

Usage:

result = api.get_database(
    database_id="example",
)
class scaleway.serverless_sqldb.v1alpha1.UpdateDatabaseRequest(database_id: 'str', region: 'Optional[ScwRegion]' = None, cpu_min: 'Optional[int]' = 0, cpu_max: 'Optional[int]' = 0)

Bases: object

cpu_max: int | None = 0

The maximum number of CPU units for your Serverless SQL Database.

cpu_min: int | None = 0

The minimum number of CPU units for your Serverless SQL Database.

database_id: str

UUID of the Serverless SQL Database.

region: str | None = None

Region to target. If none is passed will use default region from the config.