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: Optional[str] = None, project_id: Optional[str] = None, from_backup_id: Optional[str] = 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: Optional[str] = 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: Optional[str] = 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: Optional[str] = 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: Optional[str] = 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: Optional[str] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListDatabaseBackupsRequestOrderBy] = 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: Optional[str] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListDatabaseBackupsRequestOrderBy] = 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: Optional[str] = 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] = 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: Optional[str] = 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] = 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: Optional[str] = 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: Optional[str] = None, cpu_min: Optional[int] = None, cpu_max: Optional[int] = 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: Optional[str] = None, options: Optional[WaitForOptions[Database, bool]] = 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[Region]', project_id: 'Optional[str]', from_backup_id: 'Optional[str]')

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: Optional[str]

The ID of the backup to create the database from.

name: str

The name of the Serverless SQL Database to be created.

project_id: Optional[str]

The ID of your Scaleway project.

region: Optional[str]

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: 'Region', cpu_min: 'int', cpu_max: 'int', cpu_current: 'int', started: 'bool', engine_major_version: 'int', created_at: 'Optional[datetime]')

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: Optional[datetime]

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: 'Region', created_at: 'Optional[datetime]', expires_at: 'Optional[datetime]', size: 'Optional[int]', db_size: 'Optional[int]', download_url: 'Optional[str]', download_url_expires_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Creation date.

database_id: str

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

db_size: Optional[int]

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

download_url: Optional[str]

Download URL of the exported database backup.

download_url_expires_at: Optional[datetime]

Expiration date of the download URL.

expires_at: Optional[datetime]

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: Optional[int]

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: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

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

Bases: str, Enum

An enumeration.

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[Region]')

Bases: object

database_id: str

UUID of the Serverless SQL Database.

region: Optional[str]

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[Region]')

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup.

region: Optional[str]

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[Region]')

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup.

region: Optional[str]

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[Region]')

Bases: object

database_id: str

UUID of the Serverless SQL DB database.

region: Optional[str]

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[Region]', organization_id: 'Optional[str]', project_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]', order_by: 'Optional[ListDatabaseBackupsRequestOrderBy]')

Bases: object

database_id: str

Filter by the UUID of the Serverless SQL Database.

order_by: Optional[ListDatabaseBackupsRequestOrderBy]

Sorting criteria. One of created_at_asc, created_at_desc.

organization_id: Optional[str]

Filter by the UUID of the Scaleway organization.

page: Optional[int]

Page number.

page_size: Optional[int]

Page size.

project_id: Optional[str]

Filter by the UUID of the Scaleway project.

region: Optional[str]

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

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

Bases: str, Enum

An enumeration.

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[Region]', organization_id: 'Optional[str]', project_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]', name: 'Optional[str]', order_by: 'Optional[ListDatabasesRequestOrderBy]')

Bases: object

name: Optional[str]

Filter by the name of the database.

order_by: Optional[ListDatabasesRequestOrderBy]

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

organization_id: Optional[str]

Filter by the UUID of the Scaleway organization.

page: Optional[int]

Page number.

page_size: Optional[int]

Page size.

project_id: Optional[str]

UUID of the Scaleway project.

region: Optional[str]

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

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

Bases: str, Enum

An enumeration.

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[Region]')

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup to restore.

database_id: str

UUID of the Serverless SQL Database.

region: Optional[str]

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[Region]', cpu_min: 'Optional[int]', cpu_max: 'Optional[int]')

Bases: object

cpu_max: Optional[int]

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

cpu_min: Optional[int]

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

database_id: str

UUID of the Serverless SQL Database.

region: Optional[str]

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[Region]', project_id: 'Optional[str]', from_backup_id: 'Optional[str]')

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: Optional[str]

The ID of the backup to create the database from.

name: str

The name of the Serverless SQL Database to be created.

project_id: Optional[str]

The ID of your Scaleway project.

region: Optional[str]

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: 'Region', cpu_min: 'int', cpu_max: 'int', cpu_current: 'int', started: 'bool', engine_major_version: 'int', created_at: 'Optional[datetime]')

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: Optional[datetime]

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: 'Region', created_at: 'Optional[datetime]', expires_at: 'Optional[datetime]', size: 'Optional[int]', db_size: 'Optional[int]', download_url: 'Optional[str]', download_url_expires_at: 'Optional[datetime]')

Bases: object

created_at: Optional[datetime]

Creation date.

database_id: str

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

db_size: Optional[int]

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

download_url: Optional[str]

Download URL of the exported database backup.

download_url_expires_at: Optional[datetime]

Expiration date of the download URL.

expires_at: Optional[datetime]

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: Optional[int]

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: Optional[Any] = None, *args: Any, **kwargs: Any)

Bases: str, Enum

An enumeration.

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

Bases: str, Enum

An enumeration.

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[Region]')

Bases: object

database_id: str

UUID of the Serverless SQL Database.

region: Optional[str]

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[Region]')

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup.

region: Optional[str]

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[Region]')

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup.

region: Optional[str]

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[Region]')

Bases: object

database_id: str

UUID of the Serverless SQL DB database.

region: Optional[str]

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[Region]', organization_id: 'Optional[str]', project_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]', order_by: 'Optional[ListDatabaseBackupsRequestOrderBy]')

Bases: object

database_id: str

Filter by the UUID of the Serverless SQL Database.

order_by: Optional[ListDatabaseBackupsRequestOrderBy]

Sorting criteria. One of created_at_asc, created_at_desc.

organization_id: Optional[str]

Filter by the UUID of the Scaleway organization.

page: Optional[int]

Page number.

page_size: Optional[int]

Page size.

project_id: Optional[str]

Filter by the UUID of the Scaleway project.

region: Optional[str]

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

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

Bases: str, Enum

An enumeration.

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[Region]', organization_id: 'Optional[str]', project_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]', name: 'Optional[str]', order_by: 'Optional[ListDatabasesRequestOrderBy]')

Bases: object

name: Optional[str]

Filter by the name of the database.

order_by: Optional[ListDatabasesRequestOrderBy]

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

organization_id: Optional[str]

Filter by the UUID of the Scaleway organization.

page: Optional[int]

Page number.

page_size: Optional[int]

Page size.

project_id: Optional[str]

UUID of the Scaleway project.

region: Optional[str]

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

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

Bases: str, Enum

An enumeration.

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[Region]')

Bases: object

backup_id: str

UUID of the Serverless SQL Database backup to restore.

database_id: str

UUID of the Serverless SQL Database.

region: Optional[str]

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: Optional[str] = None, project_id: Optional[str] = None, from_backup_id: Optional[str] = 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: Optional[str] = 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: Optional[str] = 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: Optional[str] = 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: Optional[str] = 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: Optional[str] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListDatabaseBackupsRequestOrderBy] = 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: Optional[str] = None, organization_id: Optional[str] = None, project_id: Optional[str] = None, page: Optional[int] = None, page_size: Optional[int] = None, order_by: Optional[ListDatabaseBackupsRequestOrderBy] = 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: Optional[str] = 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] = 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: Optional[str] = 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] = 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: Optional[str] = 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: Optional[str] = None, cpu_min: Optional[int] = None, cpu_max: Optional[int] = 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: Optional[str] = None, options: Optional[WaitForOptions[Database, bool]] = 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[Region]', cpu_min: 'Optional[int]', cpu_max: 'Optional[int]')

Bases: object

cpu_max: Optional[int]

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

cpu_min: Optional[int]

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

database_id: str

UUID of the Serverless SQL Database.

region: Optional[str]

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