scaleway.mongodb.v1 package

Submodules

scaleway.mongodb.v1.api module

class scaleway.mongodb.v1.api.MongodbV1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Managed Databases for MongoDB®.

create_endpoint(*, instance_id: str, endpoint: EndpointSpec, region: str | None = None) Endpoint

Create a new Instance endpoint. Create a new endpoint for a MongoDB® Database Instance. You can add public_network or private_network specifications to the body of the request. :param instance_id: UUID of the Database Instance. :param endpoint: EndpointSpec used to expose your Database Instance. :param region: Region to target. If none is passed will use default region from the config. :return: Endpoint

Usage:

result = api.create_endpoint(
    instance_id="example",
    endpoint=EndpointSpec(),
)
create_instance(*, version: str, node_amount: int, node_type: str, user_name: str, password: str, region: str | None = None, project_id: str | None = None, name: str | None = None, tags: List[str] | None = None, volume: Volume | None = None, endpoints: List[EndpointSpec] | None = None) Instance

Create a MongoDB® Database Instance. Create a new MongoDB® Database Instance. :param version: Major version of the MongoDB® engine. :param node_amount: Number of node to use for the Database Instance. :param node_type: Type of node to use for the Database Instance. :param user_name: Username created when the Database Instance is created. :param password: Password of the initial user. :param region: Region to target. If none is passed will use default region from the config. :param project_id: The Project ID on which the Database Instance will be created. :param name: Name of the Database Instance. :param tags: Tags to apply to the Database Instance. :param volume: Instance volume information. :param endpoints: One or multiple EndpointSpec used to expose your Database Instance. :return: Instance

Usage:

result = api.create_instance(
    version="example",
    node_amount=1,
    node_type="example",
    user_name="example",
    password="example",
)
create_snapshot(*, instance_id: str, name: str, region: str | None = None, expires_at: datetime | None = None) Snapshot

Create a Database Instance snapshot. Create a new snapshot of a Database Instance. You must define the name and instance_id parameters in the request. :param instance_id: UUID of the Database Instance to snapshot. :param name: Name of the snapshot. :param region: Region to target. If none is passed will use default region from the config. :param expires_at: Expiration date of the snapshot (must follow the ISO 8601 format). :return: Snapshot

Usage:

result = api.create_snapshot(
    instance_id="example",
    name="example",
)
create_user(*, instance_id: str, name: str, password: str, region: str | None = None) User

Create an user on a Database Instance. Create an user on a Database Instance. You must define the name, password of the user and instance_id parameters in the request. :param instance_id: UUID of the Database Instance the user belongs to. :param name: Name of the database user. :param password: Password of the database user. :param region: Region to target. If none is passed will use default region from the config. :return: User

Usage:

result = api.create_user(
    instance_id="example",
    name="example",
    password="example",
)
delete_endpoint(*, endpoint_id: str, region: str | None = None) None

Delete a Database Instance endpoint. Delete the endpoint of a Database Instance. You must specify the endpoint_id parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint. :param endpoint_id: UUID of the Endpoint to delete. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = api.delete_endpoint(
    endpoint_id="example",
)
delete_instance(*, instance_id: str, region: str | None = None) Instance

Delete a MongoDB® Database Instance. Delete a given MongoDB® Database Instance, specified by the region and instance_id parameters. Deleting a MongoDB® Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost. :param instance_id: UUID of the Database Instance to delete. :param region: Region to target. If none is passed will use default region from the config. :return: Instance

Usage:

result = api.delete_instance(
    instance_id="example",
)
delete_snapshot(*, snapshot_id: str, region: str | None = None) Snapshot

Delete a Database Instance snapshot. Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to delete. :param snapshot_id: UUID of the snapshot. :param region: Region to target. If none is passed will use default region from the config. :return: Snapshot

Usage:

result = api.delete_snapshot(
    snapshot_id="example",
)
delete_user(*, instance_id: str, name: str, region: str | None = None) None

Delete a user on a Database Instance. Delete an existing user on a Database Instance. :param instance_id: UUID of the Database Instance the user belongs to. :param name: Name of the database user. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = api.delete_user(
    instance_id="example",
    name="example",
)
get_instance(*, instance_id: str, region: str | None = None) Instance

Get a MongoDB® Database Instance. Retrieve information about a given MongoDB® Database Instance, specified by the region and instance_id parameters. Its full details, including name, status, IP address and port, are returned in the response object. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :return: Instance

Usage:

result = api.get_instance(
    instance_id="example",
)
get_instance_certificate(*, instance_id: str, region: str | None = None) ScwFile

Get the certificate of a Database Instance. Retrieve the certificate of a given Database Instance, specified by the instance_id parameter. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :return: ScwFile

Usage:

result = api.get_instance_certificate(
    instance_id="example",
)
get_snapshot(*, snapshot_id: str, region: str | None = None) Snapshot

Get a Database Instance snapshot. Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to retrieve. :param snapshot_id: UUID of the snapshot. :param region: Region to target. If none is passed will use default region from the config. :return: Snapshot

Usage:

result = api.get_snapshot(
    snapshot_id="example",
)
list_databases(*, instance_id: str, region: str | None = None, order_by: ListDatabasesRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None) ListDatabasesResponse

List databases in a Database Instance. List all databases of a given Database Instance. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Criteria to use when requesting user listing. :param page: :param page_size: :return: ListDatabasesResponse

Usage:

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

List databases in a Database Instance. List all databases of a given Database Instance. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Criteria to use when requesting user listing. :param page: :param page_size: :return: List[Database]

Usage:

result = api.list_databases_all(
    instance_id="example",
)
list_instances(*, region: str | None = None, tags: List[str] | None = None, name: str | None = None, order_by: ListInstancesRequestOrderBy | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None) ListInstancesResponse

List MongoDB® Database Instances. List all MongoDB® Database Instances in the specified region. By default, the MongoDB® Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as tags and name. 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 tags: List Database Instances that have a given tag. :param name: Lists Database Instances that match a name pattern. :param order_by: Criteria to use when ordering Database Instance listings. :param organization_id: Organization ID of the Database Instance. :param project_id: Project ID to list the instances of. :param page: :param page_size: :return: ListInstancesResponse

Usage:

result = api.list_instances()
list_instances_all(*, region: str | None = None, tags: List[str] | None = None, name: str | None = None, order_by: ListInstancesRequestOrderBy | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None) List[Instance]

List MongoDB® Database Instances. List all MongoDB® Database Instances in the specified region. By default, the MongoDB® Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as tags and name. 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 tags: List Database Instances that have a given tag. :param name: Lists Database Instances that match a name pattern. :param order_by: Criteria to use when ordering Database Instance listings. :param organization_id: Organization ID of the Database Instance. :param project_id: Project ID to list the instances of. :param page: :param page_size: :return: List[Instance]

Usage:

result = api.list_instances_all()
list_node_types(*, region: str | None = None, include_disabled: bool | None = None, page: int | None = None, page_size: int | None = None) ListNodeTypesResponse

List available node types. :param region: Region to target. If none is passed will use default region from the config. :param include_disabled: Defines whether or not to include disabled types. :param page: :param page_size: :return: ListNodeTypesResponse

Usage:

result = api.list_node_types()
list_node_types_all(*, region: str | None = None, include_disabled: bool | None = None, page: int | None = None, page_size: int | None = None) List[NodeType]

List available node types. :param region: Region to target. If none is passed will use default region from the config. :param include_disabled: Defines whether or not to include disabled types. :param page: :param page_size: :return: List[NodeType]

Usage:

result = api.list_node_types_all()
list_snapshots(*, region: str | None = None, instance_id: str | None = None, name: str | None = None, order_by: ListSnapshotsRequestOrderBy | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None) ListSnapshotsResponse

List snapshots. List snapshots. You can include the instance_id or project_id in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param instance_id: Instance ID the snapshots belongs to. :param name: Lists database snapshots that match a name pattern. :param order_by: Criteria to use when ordering snapshot listings. :param organization_id: Organization ID the snapshots belongs to. :param project_id: Project ID to list the snapshots of. :param page: :param page_size: :return: ListSnapshotsResponse

Usage:

result = api.list_snapshots()
list_snapshots_all(*, region: str | None = None, instance_id: str | None = None, name: str | None = None, order_by: ListSnapshotsRequestOrderBy | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None) List[Snapshot]

List snapshots. List snapshots. You can include the instance_id or project_id in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param instance_id: Instance ID the snapshots belongs to. :param name: Lists database snapshots that match a name pattern. :param order_by: Criteria to use when ordering snapshot listings. :param organization_id: Organization ID the snapshots belongs to. :param project_id: Project ID to list the snapshots of. :param page: :param page_size: :return: List[Snapshot]

Usage:

result = api.list_snapshots_all()
list_users(*, instance_id: str, region: str | None = None, name: str | None = None, order_by: ListUsersRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None) ListUsersResponse

List users of a Database Instance. List all users of a given Database Instance. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the user. :param order_by: Criteria to use when requesting user listing. :param page: :param page_size: :return: ListUsersResponse

Usage:

result = api.list_users(
    instance_id="example",
)
list_users_all(*, instance_id: str, region: str | None = None, name: str | None = None, order_by: ListUsersRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None) List[User]

List users of a Database Instance. List all users of a given Database Instance. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the user. :param order_by: Criteria to use when requesting user listing. :param page: :param page_size: :return: List[User]

Usage:

result = api.list_users_all(
    instance_id="example",
)
list_versions(*, region: str | None = None, version: str | None = None, page: int | None = None, page_size: int | None = None) ListVersionsResponse

List available MongoDB® major versions. :param region: Region to target. If none is passed will use default region from the config. :param version: :param page: :param page_size: :return: ListVersionsResponse

Usage:

result = api.list_versions()
list_versions_all(*, region: str | None = None, version: str | None = None, page: int | None = None, page_size: int | None = None) List[Version]

List available MongoDB® major versions. :param region: Region to target. If none is passed will use default region from the config. :param version: :param page: :param page_size: :return: List[Version]

Usage:

result = api.list_versions_all()
restore_snapshot(*, snapshot_id: str, instance_name: str, node_type: str, node_amount: int, volume_type: VolumeType, region: str | None = None) Instance

Restore a Database Instance snapshot. Restore a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to restore, the instance_name of the new Database Instance, node_type of the new Database Instance and node_amount of the new Database Instance. :param snapshot_id: UUID of the snapshot. :param instance_name: Name of the new Database Instance. :param node_type: Node type to use for the new Database Instance. :param node_amount: Number of nodes to use for the new Database Instance. :param volume_type: Instance volume type. :param region: Region to target. If none is passed will use default region from the config. :return: Instance

Usage:

result = api.restore_snapshot(
    snapshot_id="example",
    instance_name="example",
    node_type="example",
    node_amount=1,
    volume_type=VolumeType.unknown_type,
)
set_user_role(*, instance_id: str, user_name: str, region: str | None = None, roles: List[UserRole] | None = None) User

Apply user roles. Apply preset roles for a user in a Database Instance. :param instance_id: UUID of the Database Instance the user belongs to. :param user_name: Name of the database user. :param region: Region to target. If none is passed will use default region from the config. :param roles: List of roles assigned to the user, along with the corresponding database where each role is granted. :return: User

Usage:

result = api.set_user_role(
    instance_id="example",
    user_name="example",
)
update_instance(*, instance_id: str, region: str | None = None, name: str | None = None, tags: List[str] | None = None, snapshot_schedule_frequency_hours: int | None = None, snapshot_schedule_retention_days: int | None = None, is_snapshot_schedule_enabled: bool | None = None) Instance

Update a MongoDB® Database Instance. Update the parameters of a MongoDB® Database Instance. :param instance_id: UUID of the Database Instance to update. :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the Database Instance. :param tags: Tags of a Database Instance. :param snapshot_schedule_frequency_hours: In hours. :param snapshot_schedule_retention_days: In days. :param is_snapshot_schedule_enabled: Defines whether or not the snapshot schedule is enabled. :return: Instance

Usage:

result = api.update_instance(
    instance_id="example",
)
update_snapshot(*, snapshot_id: str, region: str | None = None, name: str | None = None, expires_at: datetime | None = None) Snapshot

Update a Database Instance snapshot. Update the parameters of a snapshot of a Database Instance. You can update the name and expires_at parameters. :param snapshot_id: UUID of the Snapshot. :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the snapshot. :param expires_at: Expiration date of the snapshot (must follow the ISO 8601 format). :return: Snapshot

Usage:

result = api.update_snapshot(
    snapshot_id="example",
)
update_user(*, instance_id: str, name: str, region: str | None = None, password: str | None = None) User

Update a user on a Database Instance. Update the parameters of a user on a Database Instance. You can update the password parameter, but you cannot change the name of the user. :param instance_id: UUID of the Database Instance the user belongs to. :param name: Name of the database user. :param region: Region to target. If none is passed will use default region from the config. :param password: Password of the database user. :return: User

Usage:

result = api.update_user(
    instance_id="example",
    name="example",
)
upgrade_instance(*, instance_id: str, region: str | None = None, volume_size_bytes: int | None = None) Instance

Upgrade a Database Instance. Upgrade your current Database Instance specifications like volume size. :param instance_id: UUID of the Database Instance you want to upgrade. :param region: Region to target. If none is passed will use default region from the config. :param volume_size_bytes: Increase your Block Storage volume size. One-Of (‘upgrade_target’): at most one of ‘volume_size_bytes’ could be set. :return: Instance

Usage:

result = api.upgrade_instance(
    instance_id="example",
)
wait_for_instance(*, instance_id: str, region: str | None = None, options: WaitForOptions[Instance, bool] | None = None) Instance

Get a MongoDB® Database Instance. Retrieve information about a given MongoDB® Database Instance, specified by the region and instance_id parameters. Its full details, including name, status, IP address and port, are returned in the response object. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :return: Instance

Usage:

result = api.get_instance(
    instance_id="example",
)
wait_for_snapshot(*, snapshot_id: str, region: str | None = None, options: WaitForOptions[Snapshot, bool] | None = None) Snapshot

Get a Database Instance snapshot. Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to retrieve. :param snapshot_id: UUID of the snapshot. :param region: Region to target. If none is passed will use default region from the config. :return: Snapshot

Usage:

result = api.get_snapshot(
    snapshot_id="example",
)

scaleway.mongodb.v1.content module

scaleway.mongodb.v1.content.INSTANCE_TRANSIENT_STATUSES: List[InstanceStatus] = [<InstanceStatus.PROVISIONING: 'provisioning'>, <InstanceStatus.CONFIGURING: 'configuring'>, <InstanceStatus.DELETING: 'deleting'>, <InstanceStatus.INITIALIZING: 'initializing'>, <InstanceStatus.SNAPSHOTTING: 'snapshotting'>]

Lists transient statutes of the enum InstanceStatus.

scaleway.mongodb.v1.content.SNAPSHOT_TRANSIENT_STATUSES: List[SnapshotStatus] = [<SnapshotStatus.CREATING: 'creating'>, <SnapshotStatus.RESTORING: 'restoring'>, <SnapshotStatus.DELETING: 'deleting'>]

Lists transient statutes of the enum SnapshotStatus.

scaleway.mongodb.v1.marshalling module

scaleway.mongodb.v1.marshalling.marshal_CreateEndpointRequest(request: CreateEndpointRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_CreateInstanceRequest(request: CreateInstanceRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_CreateSnapshotRequest(request: CreateSnapshotRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_CreateUserRequest(request: CreateUserRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_EndpointSpec(request: EndpointSpec, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_EndpointSpecPrivateNetworkDetails(request: EndpointSpecPrivateNetworkDetails, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_EndpointSpecPublicNetworkDetails(request: EndpointSpecPublicNetworkDetails, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_RestoreSnapshotRequest(request: RestoreSnapshotRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_SetUserRoleRequest(request: SetUserRoleRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_UpdateInstanceRequest(request: UpdateInstanceRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_UpdateSnapshotRequest(request: UpdateSnapshotRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_UpdateUserRequest(request: UpdateUserRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_UpgradeInstanceRequest(request: UpgradeInstanceRequest, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_UserRole(request: UserRole, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.marshal_Volume(request: Volume, defaults: ProfileDefaults) Dict[str, Any]
scaleway.mongodb.v1.marshalling.unmarshal_Database(data: Any) Database
scaleway.mongodb.v1.marshalling.unmarshal_Endpoint(data: Any) Endpoint
scaleway.mongodb.v1.marshalling.unmarshal_EndpointPrivateNetworkDetails(data: Any) EndpointPrivateNetworkDetails
scaleway.mongodb.v1.marshalling.unmarshal_EndpointPublicNetworkDetails(data: Any) EndpointPublicNetworkDetails
scaleway.mongodb.v1.marshalling.unmarshal_Instance(data: Any) Instance
scaleway.mongodb.v1.marshalling.unmarshal_InstanceSnapshotSchedule(data: Any) InstanceSnapshotSchedule
scaleway.mongodb.v1.marshalling.unmarshal_ListDatabasesResponse(data: Any) ListDatabasesResponse
scaleway.mongodb.v1.marshalling.unmarshal_ListInstancesResponse(data: Any) ListInstancesResponse
scaleway.mongodb.v1.marshalling.unmarshal_ListNodeTypesResponse(data: Any) ListNodeTypesResponse
scaleway.mongodb.v1.marshalling.unmarshal_ListSnapshotsResponse(data: Any) ListSnapshotsResponse
scaleway.mongodb.v1.marshalling.unmarshal_ListUsersResponse(data: Any) ListUsersResponse
scaleway.mongodb.v1.marshalling.unmarshal_ListVersionsResponse(data: Any) ListVersionsResponse
scaleway.mongodb.v1.marshalling.unmarshal_NodeType(data: Any) NodeType
scaleway.mongodb.v1.marshalling.unmarshal_NodeTypeVolumeType(data: Any) NodeTypeVolumeType
scaleway.mongodb.v1.marshalling.unmarshal_Snapshot(data: Any) Snapshot
scaleway.mongodb.v1.marshalling.unmarshal_User(data: Any) User
scaleway.mongodb.v1.marshalling.unmarshal_UserRole(data: Any) UserRole
scaleway.mongodb.v1.marshalling.unmarshal_Version(data: Any) Version
scaleway.mongodb.v1.marshalling.unmarshal_Volume(data: Any) Volume

scaleway.mongodb.v1.types module

class scaleway.mongodb.v1.types.CreateEndpointRequest(instance_id: 'str', endpoint: 'EndpointSpec', region: 'Optional[ScwRegion]')

Bases: object

endpoint: EndpointSpec

EndpointSpec used to expose your Database Instance.

instance_id: str

UUID of the Database Instance.

region: str | None

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

class scaleway.mongodb.v1.types.CreateInstanceRequest(version: 'str', node_amount: 'int', node_type: 'str', user_name: 'str', password: 'str', region: 'Optional[ScwRegion]', project_id: 'Optional[str]', name: 'Optional[str]', tags: 'Optional[List[str]]', volume: 'Optional[Volume]', endpoints: 'Optional[List[EndpointSpec]]')

Bases: object

endpoints: List[EndpointSpec] | None

One or multiple EndpointSpec used to expose your Database Instance.

name: str | None

Name of the Database Instance.

node_amount: int

Number of node to use for the Database Instance.

node_type: str

Type of node to use for the Database Instance.

password: str

Password of the initial user.

project_id: str | None

The Project ID on which the Database Instance will be created.

region: str | None

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

tags: List[str] | None

Tags to apply to the Database Instance.

user_name: str

Username created when the Database Instance is created.

version: str

Major version of the MongoDB® engine.

volume: Volume | None

Instance volume information.

class scaleway.mongodb.v1.types.CreateSnapshotRequest(instance_id: 'str', name: 'str', region: 'Optional[ScwRegion]', expires_at: 'Optional[datetime]')

Bases: object

expires_at: datetime | None

Expiration date of the snapshot (must follow the ISO 8601 format).

instance_id: str

UUID of the Database Instance to snapshot.

name: str

Name of the snapshot.

region: str | None

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

class scaleway.mongodb.v1.types.CreateUserRequest(instance_id: 'str', name: 'str', password: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance the user belongs to.

name: str

Name of the database user.

password: str

Password of the database user.

region: str | None

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

class scaleway.mongodb.v1.types.Database(name: 'str')

Bases: object

name: str
class scaleway.mongodb.v1.types.DeleteEndpointRequest(endpoint_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

endpoint_id: str

UUID of the Endpoint to delete.

region: str | None

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

class scaleway.mongodb.v1.types.DeleteInstanceRequest(instance_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance to delete.

region: str | None

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

class scaleway.mongodb.v1.types.DeleteSnapshotRequest(snapshot_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: str | None

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

snapshot_id: str

UUID of the snapshot.

class scaleway.mongodb.v1.types.DeleteUserRequest(instance_id: 'str', name: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance the user belongs to.

name: str

Name of the database user.

region: str | None

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

class scaleway.mongodb.v1.types.Endpoint(id: 'str', dns_record: 'str', port: 'int', private_network: 'Optional[EndpointPrivateNetworkDetails]', public_network: 'Optional[EndpointPublicNetworkDetails]')

Bases: object

dns_record: str

List of DNS records of the endpoint.

id: str

UUID of the endpoint.

port: int

TCP port of the endpoint.

private_network: EndpointPrivateNetworkDetails | None
public_network: EndpointPublicNetworkDetails | None
class scaleway.mongodb.v1.types.EndpointPrivateNetworkDetails(private_network_id: str)

Bases: object

Private Network details.

private_network_id: str

UUID of the Private Network.

class scaleway.mongodb.v1.types.EndpointPublicNetworkDetails

Bases: object

Public Access details.

class scaleway.mongodb.v1.types.EndpointSpec(public_network: 'Optional[EndpointSpecPublicNetworkDetails]', private_network: 'Optional[EndpointSpecPrivateNetworkDetails]')

Bases: object

private_network: EndpointSpecPrivateNetworkDetails | None
public_network: EndpointSpecPublicNetworkDetails | None
class scaleway.mongodb.v1.types.EndpointSpecPrivateNetworkDetails(private_network_id: 'str')

Bases: object

private_network_id: str

UUID of the Private Network.

class scaleway.mongodb.v1.types.EndpointSpecPublicNetworkDetails

Bases: object

class scaleway.mongodb.v1.types.GetInstanceCertificateRequest(instance_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance.

region: str | None

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

class scaleway.mongodb.v1.types.GetInstanceRequest(instance_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance.

region: str | None

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

class scaleway.mongodb.v1.types.GetSnapshotRequest(snapshot_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: str | None

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

snapshot_id: str

UUID of the snapshot.

class scaleway.mongodb.v1.types.Instance(id: 'str', name: 'str', project_id: 'str', organization_id: 'str', status: 'InstanceStatus', version: 'str', tags: 'List[str]', node_amount: 'int', node_type: 'str', endpoints: 'List[Endpoint]', region: 'ScwRegion', volume: 'Optional[Volume]', created_at: 'Optional[datetime]', snapshot_schedule: 'Optional[InstanceSnapshotSchedule]')

Bases: object

created_at: datetime | None

Creation date (must follow the ISO 8601 format).

endpoints: List[Endpoint]

List of Database Instance endpoints.

id: str

UUID of the Database Instance.

name: str

Name of the Database Instance.

node_amount: int

Number of node in the Database Instance.

node_type: str

Node type of the Database Instance.

organization_id: str

Organization ID the Database Instance belongs to.

project_id: str

Project ID the Database Instance belongs to.

region: str

Region the Database Instance is in.

snapshot_schedule: InstanceSnapshotSchedule | None

Snapshot schedule configuration of the Database Instance.

status: InstanceStatus

Status of the Database Instance.

tags: List[str]

List of tags applied to the Database Instance.

version: str

MongoDB® major engine version of the Database Instance.

volume: Volume | None

Volumes of the Database Instance.

class scaleway.mongodb.v1.types.InstanceSnapshotSchedule(frequency_hours: 'int', retention_days: 'int', enabled: 'bool', next_update: 'Optional[datetime]', last_run: 'Optional[datetime]')

Bases: object

enabled: bool
frequency_hours: int
last_run: datetime | None
next_update: datetime | None
retention_days: int
class scaleway.mongodb.v1.types.InstanceStatus(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CONFIGURING = 'configuring'
DELETING = 'deleting'
ERROR = 'error'
INITIALIZING = 'initializing'
LOCKED = 'locked'
PROVISIONING = 'provisioning'
READY = 'ready'
SNAPSHOTTING = 'snapshotting'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.mongodb.v1.types.ListDatabasesRequest(instance_id: 'str', region: 'Optional[ScwRegion]', order_by: 'Optional[ListDatabasesRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

instance_id: str

UUID of the Database Instance.

order_by: ListDatabasesRequestOrderBy | None

Criteria to use when requesting user listing.

page: int | None
page_size: int | None
region: str | None

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

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

Bases: str, Enum

NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.mongodb.v1.types.ListDatabasesResponse(databases: 'List[Database]', total_count: 'int')

Bases: object

databases: List[Database]

List of the databases.

total_count: int

Total count of databases present on a Database Instance.

class scaleway.mongodb.v1.types.ListInstancesRequest(region: 'Optional[ScwRegion]', tags: 'Optional[List[str]]', name: 'Optional[str]', order_by: 'Optional[ListInstancesRequestOrderBy]', organization_id: 'Optional[str]', project_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

name: str | None

Lists Database Instances that match a name pattern.

order_by: ListInstancesRequestOrderBy | None

Criteria to use when ordering Database Instance listings.

organization_id: str | None

Organization ID of the Database Instance.

page: int | None
page_size: int | None
project_id: str | None

Project ID to list the instances of.

region: str | None

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

tags: List[str] | None

List Database Instances that have a given tag.

class scaleway.mongodb.v1.types.ListInstancesRequestOrderBy(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'
STATUS_ASC = 'status_asc'
STATUS_DESC = 'status_desc'
class scaleway.mongodb.v1.types.ListInstancesResponse(instances: 'List[Instance]', total_count: 'int')

Bases: object

instances: List[Instance]

List of all Database Instances available in an Organization or Project.

total_count: int

Total count of Database Instances available in an Organization or Project.

class scaleway.mongodb.v1.types.ListNodeTypesRequest(region: 'Optional[ScwRegion]', include_disabled: 'Optional[bool]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

include_disabled: bool | None

Defines whether or not to include disabled types.

page: int | None
page_size: int | None
region: str | None

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

class scaleway.mongodb.v1.types.ListNodeTypesResponse(node_types: 'List[NodeType]', total_count: 'int')

Bases: object

node_types: List[NodeType]

Types of the node.

total_count: int

Total count of node-types available.

class scaleway.mongodb.v1.types.ListSnapshotsRequest(region: 'Optional[ScwRegion]', instance_id: 'Optional[str]', name: 'Optional[str]', order_by: 'Optional[ListSnapshotsRequestOrderBy]', organization_id: 'Optional[str]', project_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

instance_id: str | None

Instance ID the snapshots belongs to.

name: str | None

Lists database snapshots that match a name pattern.

order_by: ListSnapshotsRequestOrderBy | None

Criteria to use when ordering snapshot listings.

organization_id: str | None

Organization ID the snapshots belongs to.

page: int | None
page_size: int | None
project_id: str | None

Project ID to list the snapshots of.

region: str | None

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

class scaleway.mongodb.v1.types.ListSnapshotsRequestOrderBy(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'
EXPIRES_AT_ASC = 'expires_at_asc'
EXPIRES_AT_DESC = 'expires_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.mongodb.v1.types.ListSnapshotsResponse(snapshots: 'List[Snapshot]', total_count: 'int')

Bases: object

snapshots: List[Snapshot]

List of all database snapshots available in an Organization or Project.

total_count: int

Total count of database snapshots available in a Organization or Project.

class scaleway.mongodb.v1.types.ListUsersRequest(instance_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', order_by: 'Optional[ListUsersRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

instance_id: str

UUID of the Database Instance.

name: str | None

Name of the user.

order_by: ListUsersRequestOrderBy | None

Criteria to use when requesting user listing.

page: int | None
page_size: int | None
region: str | None

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

class scaleway.mongodb.v1.types.ListUsersRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.mongodb.v1.types.ListUsersResponse(users: 'List[User]', total_count: 'int')

Bases: object

total_count: int

Total count of users present on a Database Instance.

users: List[User]

List of users in a Database Instance.

class scaleway.mongodb.v1.types.ListVersionsRequest(region: 'Optional[ScwRegion]', version: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

page: int | None
page_size: int | None
region: str | None

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

version: str | None
class scaleway.mongodb.v1.types.ListVersionsResponse(versions: 'List[Version]', total_count: 'int')

Bases: object

total_count: int

Total count of MongoDB® major engine version available.

versions: List[Version]

Available MongoDB® major engine version.

class scaleway.mongodb.v1.types.NodeType(name: 'str', stock_status: 'NodeTypeStock', description: 'str', vcpus: 'int', memory_bytes: 'int', available_volume_types: 'List[NodeTypeVolumeType]', disabled: 'bool', beta: 'bool', instance_range: 'str')

Bases: object

available_volume_types: List[NodeTypeVolumeType]

Available storage options for the node type.

beta: bool

The node type is currently in beta.

description: str

Current specs of the offer.

disabled: bool

The node type is currently disabled.

instance_range: str

Instance range associated with the node type offer.

memory_bytes: int

Quantity of RAM.

name: str

Node type name identifier.

stock_status: NodeTypeStock

Current stock status for the node type.

vcpus: int

Number of virtual CPUs.

class scaleway.mongodb.v1.types.NodeTypeStock(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

AVAILABLE = 'available'
LOW_STOCK = 'low_stock'
OUT_OF_STOCK = 'out_of_stock'
UNKNOWN_STOCK = 'unknown_stock'
class scaleway.mongodb.v1.types.NodeTypeVolumeType(type_: 'VolumeType', description: 'str', min_size_bytes: 'int', max_size_bytes: 'int', chunk_size_bytes: 'int')

Bases: object

chunk_size_bytes: int

Minimum increment level for a Block Storage volume size.

description: str

The description of the volume.

max_size_bytes: int

Maximum size required for the volume.

min_size_bytes: int

Minimum size required for the volume.

type_: VolumeType

Volume Type.

class scaleway.mongodb.v1.types.RestoreSnapshotRequest(snapshot_id: 'str', instance_name: 'str', node_type: 'str', node_amount: 'int', volume_type: 'VolumeType', region: 'Optional[ScwRegion]')

Bases: object

instance_name: str

Name of the new Database Instance.

node_amount: int

Number of nodes to use for the new Database Instance.

node_type: str

Node type to use for the new Database Instance.

region: str | None

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

snapshot_id: str

UUID of the snapshot.

volume_type: VolumeType

Instance volume type.

class scaleway.mongodb.v1.types.SetUserRoleRequest(instance_id: 'str', user_name: 'str', region: 'Optional[ScwRegion]', roles: 'Optional[List[UserRole]]')

Bases: object

instance_id: str

UUID of the Database Instance the user belongs to.

region: str | None

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

roles: List[UserRole] | None

List of roles assigned to the user, along with the corresponding database where each role is granted.

user_name: str

Name of the database user.

class scaleway.mongodb.v1.types.Snapshot(id: 'str', name: 'str', status: 'SnapshotStatus', size_bytes: 'int', instance_name: 'str', node_type: 'str', volume_type: 'VolumeType', region: 'ScwRegion', instance_id: 'Optional[str]', expires_at: 'Optional[datetime]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: datetime | None

Creation date (must follow the ISO 8601 format).

expires_at: datetime | None

Expiration date (must follow the ISO 8601 format).

id: str

UUID of the snapshot.

instance_id: str | None

UUID of the Database Instance.

instance_name: str

Name of the Database Instance of the snapshot.

name: str

Name of the snapshot.

node_type: str

Source node type.

region: str

Region of the snapshot.

size_bytes: int

Size of the snapshot.

status: SnapshotStatus

Status of the snapshot.

updated_at: datetime | None

Updated date (must follow the ISO 8601 format).

volume_type: VolumeType

Type of volume where data is stored - sbs_5k or sbs_15k.

class scaleway.mongodb.v1.types.SnapshotStatus(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.mongodb.v1.types.UpdateInstanceRequest(instance_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', tags: 'Optional[List[str]]', snapshot_schedule_frequency_hours: 'Optional[int]', snapshot_schedule_retention_days: 'Optional[int]', is_snapshot_schedule_enabled: 'Optional[bool]')

Bases: object

instance_id: str

UUID of the Database Instance to update.

is_snapshot_schedule_enabled: bool | None

Defines whether or not the snapshot schedule is enabled.

name: str | None

Name of the Database Instance.

region: str | None

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

snapshot_schedule_frequency_hours: int | None

In hours.

snapshot_schedule_retention_days: int | None

In days.

tags: List[str] | None

Tags of a Database Instance.

class scaleway.mongodb.v1.types.UpdateSnapshotRequest(snapshot_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', expires_at: 'Optional[datetime]')

Bases: object

expires_at: datetime | None

Expiration date of the snapshot (must follow the ISO 8601 format).

name: str | None

Name of the snapshot.

region: str | None

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

snapshot_id: str

UUID of the Snapshot.

class scaleway.mongodb.v1.types.UpdateUserRequest(instance_id: 'str', name: 'str', region: 'Optional[ScwRegion]', password: 'Optional[str]')

Bases: object

instance_id: str

UUID of the Database Instance the user belongs to.

name: str

Name of the database user.

password: str | None

Password of the database user.

region: str | None

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

class scaleway.mongodb.v1.types.UpgradeInstanceRequest(instance_id: 'str', region: 'Optional[ScwRegion]', volume_size_bytes: 'Optional[int]')

Bases: object

instance_id: str

UUID of the Database Instance you want to upgrade.

region: str | None

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

volume_size_bytes: int | None
class scaleway.mongodb.v1.types.User(name: 'str', roles: 'List[UserRole]')

Bases: object

name: str

Name of the user (Length must be between 1 and 63 characters. First character must be an alphabet character (a-zA-Z). Only a-zA-Z0-9_$- characters are accepted).

roles: List[UserRole]

List of roles assigned to the user, along with the corresponding database where each role is granted.

class scaleway.mongodb.v1.types.UserRole(role: 'UserRoleRole', database_name: 'Optional[str]', any_database: 'Optional[bool]')

Bases: object

any_database: bool | None
database_name: str | None
role: UserRoleRole

Name of the preset role.

class scaleway.mongodb.v1.types.UserRoleRole(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

DB_ADMIN = 'db_admin'
READ = 'read'
READ_WRITE = 'read_write'
SYNC = 'sync'
UNKNOWN_ROLE = 'unknown_role'
class scaleway.mongodb.v1.types.Version(version: 'str', end_of_life_at: 'Optional[datetime]')

Bases: object

end_of_life_at: datetime | None

Date of End of Life.

version: str

MongoDB® major engine version.

class scaleway.mongodb.v1.types.Volume(type_: 'VolumeType', size_bytes: 'int')

Bases: object

size_bytes: int

Volume size.

type_: VolumeType

Type of volume where data is stored.

class scaleway.mongodb.v1.types.VolumeType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

SBS_15K = 'sbs_15k'
SBS_5K = 'sbs_5k'
UNKNOWN_TYPE = 'unknown_type'

Module contents

class scaleway.mongodb.v1.CreateEndpointRequest(instance_id: 'str', endpoint: 'EndpointSpec', region: 'Optional[ScwRegion]')

Bases: object

endpoint: EndpointSpec

EndpointSpec used to expose your Database Instance.

instance_id: str

UUID of the Database Instance.

region: str | None

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

class scaleway.mongodb.v1.CreateInstanceRequest(version: 'str', node_amount: 'int', node_type: 'str', user_name: 'str', password: 'str', region: 'Optional[ScwRegion]', project_id: 'Optional[str]', name: 'Optional[str]', tags: 'Optional[List[str]]', volume: 'Optional[Volume]', endpoints: 'Optional[List[EndpointSpec]]')

Bases: object

endpoints: List[EndpointSpec] | None

One or multiple EndpointSpec used to expose your Database Instance.

name: str | None

Name of the Database Instance.

node_amount: int

Number of node to use for the Database Instance.

node_type: str

Type of node to use for the Database Instance.

password: str

Password of the initial user.

project_id: str | None

The Project ID on which the Database Instance will be created.

region: str | None

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

tags: List[str] | None

Tags to apply to the Database Instance.

user_name: str

Username created when the Database Instance is created.

version: str

Major version of the MongoDB® engine.

volume: Volume | None

Instance volume information.

class scaleway.mongodb.v1.CreateSnapshotRequest(instance_id: 'str', name: 'str', region: 'Optional[ScwRegion]', expires_at: 'Optional[datetime]')

Bases: object

expires_at: datetime | None

Expiration date of the snapshot (must follow the ISO 8601 format).

instance_id: str

UUID of the Database Instance to snapshot.

name: str

Name of the snapshot.

region: str | None

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

class scaleway.mongodb.v1.CreateUserRequest(instance_id: 'str', name: 'str', password: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance the user belongs to.

name: str

Name of the database user.

password: str

Password of the database user.

region: str | None

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

class scaleway.mongodb.v1.Database(name: 'str')

Bases: object

name: str
class scaleway.mongodb.v1.DeleteEndpointRequest(endpoint_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

endpoint_id: str

UUID of the Endpoint to delete.

region: str | None

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

class scaleway.mongodb.v1.DeleteInstanceRequest(instance_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance to delete.

region: str | None

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

class scaleway.mongodb.v1.DeleteSnapshotRequest(snapshot_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: str | None

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

snapshot_id: str

UUID of the snapshot.

class scaleway.mongodb.v1.DeleteUserRequest(instance_id: 'str', name: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance the user belongs to.

name: str

Name of the database user.

region: str | None

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

class scaleway.mongodb.v1.Endpoint(id: 'str', dns_record: 'str', port: 'int', private_network: 'Optional[EndpointPrivateNetworkDetails]', public_network: 'Optional[EndpointPublicNetworkDetails]')

Bases: object

dns_record: str

List of DNS records of the endpoint.

id: str

UUID of the endpoint.

port: int

TCP port of the endpoint.

private_network: EndpointPrivateNetworkDetails | None
public_network: EndpointPublicNetworkDetails | None
class scaleway.mongodb.v1.EndpointPrivateNetworkDetails(private_network_id: str)

Bases: object

Private Network details.

private_network_id: str

UUID of the Private Network.

class scaleway.mongodb.v1.EndpointPublicNetworkDetails

Bases: object

Public Access details.

class scaleway.mongodb.v1.EndpointSpec(public_network: 'Optional[EndpointSpecPublicNetworkDetails]', private_network: 'Optional[EndpointSpecPrivateNetworkDetails]')

Bases: object

private_network: EndpointSpecPrivateNetworkDetails | None
public_network: EndpointSpecPublicNetworkDetails | None
class scaleway.mongodb.v1.EndpointSpecPrivateNetworkDetails(private_network_id: 'str')

Bases: object

private_network_id: str

UUID of the Private Network.

class scaleway.mongodb.v1.EndpointSpecPublicNetworkDetails

Bases: object

class scaleway.mongodb.v1.GetInstanceCertificateRequest(instance_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance.

region: str | None

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

class scaleway.mongodb.v1.GetInstanceRequest(instance_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

instance_id: str

UUID of the Database Instance.

region: str | None

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

class scaleway.mongodb.v1.GetSnapshotRequest(snapshot_id: 'str', region: 'Optional[ScwRegion]')

Bases: object

region: str | None

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

snapshot_id: str

UUID of the snapshot.

class scaleway.mongodb.v1.Instance(id: 'str', name: 'str', project_id: 'str', organization_id: 'str', status: 'InstanceStatus', version: 'str', tags: 'List[str]', node_amount: 'int', node_type: 'str', endpoints: 'List[Endpoint]', region: 'ScwRegion', volume: 'Optional[Volume]', created_at: 'Optional[datetime]', snapshot_schedule: 'Optional[InstanceSnapshotSchedule]')

Bases: object

created_at: datetime | None

Creation date (must follow the ISO 8601 format).

endpoints: List[Endpoint]

List of Database Instance endpoints.

id: str

UUID of the Database Instance.

name: str

Name of the Database Instance.

node_amount: int

Number of node in the Database Instance.

node_type: str

Node type of the Database Instance.

organization_id: str

Organization ID the Database Instance belongs to.

project_id: str

Project ID the Database Instance belongs to.

region: str

Region the Database Instance is in.

snapshot_schedule: InstanceSnapshotSchedule | None

Snapshot schedule configuration of the Database Instance.

status: InstanceStatus

Status of the Database Instance.

tags: List[str]

List of tags applied to the Database Instance.

version: str

MongoDB® major engine version of the Database Instance.

volume: Volume | None

Volumes of the Database Instance.

class scaleway.mongodb.v1.InstanceSnapshotSchedule(frequency_hours: 'int', retention_days: 'int', enabled: 'bool', next_update: 'Optional[datetime]', last_run: 'Optional[datetime]')

Bases: object

enabled: bool
frequency_hours: int
last_run: datetime | None
next_update: datetime | None
retention_days: int
class scaleway.mongodb.v1.InstanceStatus(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

CONFIGURING = 'configuring'
DELETING = 'deleting'
ERROR = 'error'
INITIALIZING = 'initializing'
LOCKED = 'locked'
PROVISIONING = 'provisioning'
READY = 'ready'
SNAPSHOTTING = 'snapshotting'
UNKNOWN_STATUS = 'unknown_status'
class scaleway.mongodb.v1.ListDatabasesRequest(instance_id: 'str', region: 'Optional[ScwRegion]', order_by: 'Optional[ListDatabasesRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

instance_id: str

UUID of the Database Instance.

order_by: ListDatabasesRequestOrderBy | None

Criteria to use when requesting user listing.

page: int | None
page_size: int | None
region: str | None

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

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

Bases: str, Enum

NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.mongodb.v1.ListDatabasesResponse(databases: 'List[Database]', total_count: 'int')

Bases: object

databases: List[Database]

List of the databases.

total_count: int

Total count of databases present on a Database Instance.

class scaleway.mongodb.v1.ListInstancesRequest(region: 'Optional[ScwRegion]', tags: 'Optional[List[str]]', name: 'Optional[str]', order_by: 'Optional[ListInstancesRequestOrderBy]', organization_id: 'Optional[str]', project_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

name: str | None

Lists Database Instances that match a name pattern.

order_by: ListInstancesRequestOrderBy | None

Criteria to use when ordering Database Instance listings.

organization_id: str | None

Organization ID of the Database Instance.

page: int | None
page_size: int | None
project_id: str | None

Project ID to list the instances of.

region: str | None

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

tags: List[str] | None

List Database Instances that have a given tag.

class scaleway.mongodb.v1.ListInstancesRequestOrderBy(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'
STATUS_ASC = 'status_asc'
STATUS_DESC = 'status_desc'
class scaleway.mongodb.v1.ListInstancesResponse(instances: 'List[Instance]', total_count: 'int')

Bases: object

instances: List[Instance]

List of all Database Instances available in an Organization or Project.

total_count: int

Total count of Database Instances available in an Organization or Project.

class scaleway.mongodb.v1.ListNodeTypesRequest(region: 'Optional[ScwRegion]', include_disabled: 'Optional[bool]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

include_disabled: bool | None

Defines whether or not to include disabled types.

page: int | None
page_size: int | None
region: str | None

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

class scaleway.mongodb.v1.ListNodeTypesResponse(node_types: 'List[NodeType]', total_count: 'int')

Bases: object

node_types: List[NodeType]

Types of the node.

total_count: int

Total count of node-types available.

class scaleway.mongodb.v1.ListSnapshotsRequest(region: 'Optional[ScwRegion]', instance_id: 'Optional[str]', name: 'Optional[str]', order_by: 'Optional[ListSnapshotsRequestOrderBy]', organization_id: 'Optional[str]', project_id: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

instance_id: str | None

Instance ID the snapshots belongs to.

name: str | None

Lists database snapshots that match a name pattern.

order_by: ListSnapshotsRequestOrderBy | None

Criteria to use when ordering snapshot listings.

organization_id: str | None

Organization ID the snapshots belongs to.

page: int | None
page_size: int | None
project_id: str | None

Project ID to list the snapshots of.

region: str | None

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

class scaleway.mongodb.v1.ListSnapshotsRequestOrderBy(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'
EXPIRES_AT_ASC = 'expires_at_asc'
EXPIRES_AT_DESC = 'expires_at_desc'
NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.mongodb.v1.ListSnapshotsResponse(snapshots: 'List[Snapshot]', total_count: 'int')

Bases: object

snapshots: List[Snapshot]

List of all database snapshots available in an Organization or Project.

total_count: int

Total count of database snapshots available in a Organization or Project.

class scaleway.mongodb.v1.ListUsersRequest(instance_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', order_by: 'Optional[ListUsersRequestOrderBy]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

instance_id: str

UUID of the Database Instance.

name: str | None

Name of the user.

order_by: ListUsersRequestOrderBy | None

Criteria to use when requesting user listing.

page: int | None
page_size: int | None
region: str | None

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

class scaleway.mongodb.v1.ListUsersRequestOrderBy(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

NAME_ASC = 'name_asc'
NAME_DESC = 'name_desc'
class scaleway.mongodb.v1.ListUsersResponse(users: 'List[User]', total_count: 'int')

Bases: object

total_count: int

Total count of users present on a Database Instance.

users: List[User]

List of users in a Database Instance.

class scaleway.mongodb.v1.ListVersionsRequest(region: 'Optional[ScwRegion]', version: 'Optional[str]', page: 'Optional[int]', page_size: 'Optional[int]')

Bases: object

page: int | None
page_size: int | None
region: str | None

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

version: str | None
class scaleway.mongodb.v1.ListVersionsResponse(versions: 'List[Version]', total_count: 'int')

Bases: object

total_count: int

Total count of MongoDB® major engine version available.

versions: List[Version]

Available MongoDB® major engine version.

class scaleway.mongodb.v1.MongodbV1API(client: Client, *, bypass_validation: bool = False)

Bases: API

This API allows you to manage your Managed Databases for MongoDB®.

create_endpoint(*, instance_id: str, endpoint: EndpointSpec, region: str | None = None) Endpoint

Create a new Instance endpoint. Create a new endpoint for a MongoDB® Database Instance. You can add public_network or private_network specifications to the body of the request. :param instance_id: UUID of the Database Instance. :param endpoint: EndpointSpec used to expose your Database Instance. :param region: Region to target. If none is passed will use default region from the config. :return: Endpoint

Usage:

result = api.create_endpoint(
    instance_id="example",
    endpoint=EndpointSpec(),
)
create_instance(*, version: str, node_amount: int, node_type: str, user_name: str, password: str, region: str | None = None, project_id: str | None = None, name: str | None = None, tags: List[str] | None = None, volume: Volume | None = None, endpoints: List[EndpointSpec] | None = None) Instance

Create a MongoDB® Database Instance. Create a new MongoDB® Database Instance. :param version: Major version of the MongoDB® engine. :param node_amount: Number of node to use for the Database Instance. :param node_type: Type of node to use for the Database Instance. :param user_name: Username created when the Database Instance is created. :param password: Password of the initial user. :param region: Region to target. If none is passed will use default region from the config. :param project_id: The Project ID on which the Database Instance will be created. :param name: Name of the Database Instance. :param tags: Tags to apply to the Database Instance. :param volume: Instance volume information. :param endpoints: One or multiple EndpointSpec used to expose your Database Instance. :return: Instance

Usage:

result = api.create_instance(
    version="example",
    node_amount=1,
    node_type="example",
    user_name="example",
    password="example",
)
create_snapshot(*, instance_id: str, name: str, region: str | None = None, expires_at: datetime | None = None) Snapshot

Create a Database Instance snapshot. Create a new snapshot of a Database Instance. You must define the name and instance_id parameters in the request. :param instance_id: UUID of the Database Instance to snapshot. :param name: Name of the snapshot. :param region: Region to target. If none is passed will use default region from the config. :param expires_at: Expiration date of the snapshot (must follow the ISO 8601 format). :return: Snapshot

Usage:

result = api.create_snapshot(
    instance_id="example",
    name="example",
)
create_user(*, instance_id: str, name: str, password: str, region: str | None = None) User

Create an user on a Database Instance. Create an user on a Database Instance. You must define the name, password of the user and instance_id parameters in the request. :param instance_id: UUID of the Database Instance the user belongs to. :param name: Name of the database user. :param password: Password of the database user. :param region: Region to target. If none is passed will use default region from the config. :return: User

Usage:

result = api.create_user(
    instance_id="example",
    name="example",
    password="example",
)
delete_endpoint(*, endpoint_id: str, region: str | None = None) None

Delete a Database Instance endpoint. Delete the endpoint of a Database Instance. You must specify the endpoint_id parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint. :param endpoint_id: UUID of the Endpoint to delete. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = api.delete_endpoint(
    endpoint_id="example",
)
delete_instance(*, instance_id: str, region: str | None = None) Instance

Delete a MongoDB® Database Instance. Delete a given MongoDB® Database Instance, specified by the region and instance_id parameters. Deleting a MongoDB® Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost. :param instance_id: UUID of the Database Instance to delete. :param region: Region to target. If none is passed will use default region from the config. :return: Instance

Usage:

result = api.delete_instance(
    instance_id="example",
)
delete_snapshot(*, snapshot_id: str, region: str | None = None) Snapshot

Delete a Database Instance snapshot. Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to delete. :param snapshot_id: UUID of the snapshot. :param region: Region to target. If none is passed will use default region from the config. :return: Snapshot

Usage:

result = api.delete_snapshot(
    snapshot_id="example",
)
delete_user(*, instance_id: str, name: str, region: str | None = None) None

Delete a user on a Database Instance. Delete an existing user on a Database Instance. :param instance_id: UUID of the Database Instance the user belongs to. :param name: Name of the database user. :param region: Region to target. If none is passed will use default region from the config.

Usage:

result = api.delete_user(
    instance_id="example",
    name="example",
)
get_instance(*, instance_id: str, region: str | None = None) Instance

Get a MongoDB® Database Instance. Retrieve information about a given MongoDB® Database Instance, specified by the region and instance_id parameters. Its full details, including name, status, IP address and port, are returned in the response object. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :return: Instance

Usage:

result = api.get_instance(
    instance_id="example",
)
get_instance_certificate(*, instance_id: str, region: str | None = None) ScwFile

Get the certificate of a Database Instance. Retrieve the certificate of a given Database Instance, specified by the instance_id parameter. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :return: ScwFile

Usage:

result = api.get_instance_certificate(
    instance_id="example",
)
get_snapshot(*, snapshot_id: str, region: str | None = None) Snapshot

Get a Database Instance snapshot. Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to retrieve. :param snapshot_id: UUID of the snapshot. :param region: Region to target. If none is passed will use default region from the config. :return: Snapshot

Usage:

result = api.get_snapshot(
    snapshot_id="example",
)
list_databases(*, instance_id: str, region: str | None = None, order_by: ListDatabasesRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None) ListDatabasesResponse

List databases in a Database Instance. List all databases of a given Database Instance. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Criteria to use when requesting user listing. :param page: :param page_size: :return: ListDatabasesResponse

Usage:

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

List databases in a Database Instance. List all databases of a given Database Instance. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :param order_by: Criteria to use when requesting user listing. :param page: :param page_size: :return: List[Database]

Usage:

result = api.list_databases_all(
    instance_id="example",
)
list_instances(*, region: str | None = None, tags: List[str] | None = None, name: str | None = None, order_by: ListInstancesRequestOrderBy | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None) ListInstancesResponse

List MongoDB® Database Instances. List all MongoDB® Database Instances in the specified region. By default, the MongoDB® Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as tags and name. 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 tags: List Database Instances that have a given tag. :param name: Lists Database Instances that match a name pattern. :param order_by: Criteria to use when ordering Database Instance listings. :param organization_id: Organization ID of the Database Instance. :param project_id: Project ID to list the instances of. :param page: :param page_size: :return: ListInstancesResponse

Usage:

result = api.list_instances()
list_instances_all(*, region: str | None = None, tags: List[str] | None = None, name: str | None = None, order_by: ListInstancesRequestOrderBy | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None) List[Instance]

List MongoDB® Database Instances. List all MongoDB® Database Instances in the specified region. By default, the MongoDB® Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as tags and name. 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 tags: List Database Instances that have a given tag. :param name: Lists Database Instances that match a name pattern. :param order_by: Criteria to use when ordering Database Instance listings. :param organization_id: Organization ID of the Database Instance. :param project_id: Project ID to list the instances of. :param page: :param page_size: :return: List[Instance]

Usage:

result = api.list_instances_all()
list_node_types(*, region: str | None = None, include_disabled: bool | None = None, page: int | None = None, page_size: int | None = None) ListNodeTypesResponse

List available node types. :param region: Region to target. If none is passed will use default region from the config. :param include_disabled: Defines whether or not to include disabled types. :param page: :param page_size: :return: ListNodeTypesResponse

Usage:

result = api.list_node_types()
list_node_types_all(*, region: str | None = None, include_disabled: bool | None = None, page: int | None = None, page_size: int | None = None) List[NodeType]

List available node types. :param region: Region to target. If none is passed will use default region from the config. :param include_disabled: Defines whether or not to include disabled types. :param page: :param page_size: :return: List[NodeType]

Usage:

result = api.list_node_types_all()
list_snapshots(*, region: str | None = None, instance_id: str | None = None, name: str | None = None, order_by: ListSnapshotsRequestOrderBy | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None) ListSnapshotsResponse

List snapshots. List snapshots. You can include the instance_id or project_id in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param instance_id: Instance ID the snapshots belongs to. :param name: Lists database snapshots that match a name pattern. :param order_by: Criteria to use when ordering snapshot listings. :param organization_id: Organization ID the snapshots belongs to. :param project_id: Project ID to list the snapshots of. :param page: :param page_size: :return: ListSnapshotsResponse

Usage:

result = api.list_snapshots()
list_snapshots_all(*, region: str | None = None, instance_id: str | None = None, name: str | None = None, order_by: ListSnapshotsRequestOrderBy | None = None, organization_id: str | None = None, project_id: str | None = None, page: int | None = None, page_size: int | None = None) List[Snapshot]

List snapshots. List snapshots. You can include the instance_id or project_id in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. :param region: Region to target. If none is passed will use default region from the config. :param instance_id: Instance ID the snapshots belongs to. :param name: Lists database snapshots that match a name pattern. :param order_by: Criteria to use when ordering snapshot listings. :param organization_id: Organization ID the snapshots belongs to. :param project_id: Project ID to list the snapshots of. :param page: :param page_size: :return: List[Snapshot]

Usage:

result = api.list_snapshots_all()
list_users(*, instance_id: str, region: str | None = None, name: str | None = None, order_by: ListUsersRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None) ListUsersResponse

List users of a Database Instance. List all users of a given Database Instance. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the user. :param order_by: Criteria to use when requesting user listing. :param page: :param page_size: :return: ListUsersResponse

Usage:

result = api.list_users(
    instance_id="example",
)
list_users_all(*, instance_id: str, region: str | None = None, name: str | None = None, order_by: ListUsersRequestOrderBy | None = None, page: int | None = None, page_size: int | None = None) List[User]

List users of a Database Instance. List all users of a given Database Instance. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the user. :param order_by: Criteria to use when requesting user listing. :param page: :param page_size: :return: List[User]

Usage:

result = api.list_users_all(
    instance_id="example",
)
list_versions(*, region: str | None = None, version: str | None = None, page: int | None = None, page_size: int | None = None) ListVersionsResponse

List available MongoDB® major versions. :param region: Region to target. If none is passed will use default region from the config. :param version: :param page: :param page_size: :return: ListVersionsResponse

Usage:

result = api.list_versions()
list_versions_all(*, region: str | None = None, version: str | None = None, page: int | None = None, page_size: int | None = None) List[Version]

List available MongoDB® major versions. :param region: Region to target. If none is passed will use default region from the config. :param version: :param page: :param page_size: :return: List[Version]

Usage:

result = api.list_versions_all()
restore_snapshot(*, snapshot_id: str, instance_name: str, node_type: str, node_amount: int, volume_type: VolumeType, region: str | None = None) Instance

Restore a Database Instance snapshot. Restore a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to restore, the instance_name of the new Database Instance, node_type of the new Database Instance and node_amount of the new Database Instance. :param snapshot_id: UUID of the snapshot. :param instance_name: Name of the new Database Instance. :param node_type: Node type to use for the new Database Instance. :param node_amount: Number of nodes to use for the new Database Instance. :param volume_type: Instance volume type. :param region: Region to target. If none is passed will use default region from the config. :return: Instance

Usage:

result = api.restore_snapshot(
    snapshot_id="example",
    instance_name="example",
    node_type="example",
    node_amount=1,
    volume_type=VolumeType.unknown_type,
)
set_user_role(*, instance_id: str, user_name: str, region: str | None = None, roles: List[UserRole] | None = None) User

Apply user roles. Apply preset roles for a user in a Database Instance. :param instance_id: UUID of the Database Instance the user belongs to. :param user_name: Name of the database user. :param region: Region to target. If none is passed will use default region from the config. :param roles: List of roles assigned to the user, along with the corresponding database where each role is granted. :return: User

Usage:

result = api.set_user_role(
    instance_id="example",
    user_name="example",
)
update_instance(*, instance_id: str, region: str | None = None, name: str | None = None, tags: List[str] | None = None, snapshot_schedule_frequency_hours: int | None = None, snapshot_schedule_retention_days: int | None = None, is_snapshot_schedule_enabled: bool | None = None) Instance

Update a MongoDB® Database Instance. Update the parameters of a MongoDB® Database Instance. :param instance_id: UUID of the Database Instance to update. :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the Database Instance. :param tags: Tags of a Database Instance. :param snapshot_schedule_frequency_hours: In hours. :param snapshot_schedule_retention_days: In days. :param is_snapshot_schedule_enabled: Defines whether or not the snapshot schedule is enabled. :return: Instance

Usage:

result = api.update_instance(
    instance_id="example",
)
update_snapshot(*, snapshot_id: str, region: str | None = None, name: str | None = None, expires_at: datetime | None = None) Snapshot

Update a Database Instance snapshot. Update the parameters of a snapshot of a Database Instance. You can update the name and expires_at parameters. :param snapshot_id: UUID of the Snapshot. :param region: Region to target. If none is passed will use default region from the config. :param name: Name of the snapshot. :param expires_at: Expiration date of the snapshot (must follow the ISO 8601 format). :return: Snapshot

Usage:

result = api.update_snapshot(
    snapshot_id="example",
)
update_user(*, instance_id: str, name: str, region: str | None = None, password: str | None = None) User

Update a user on a Database Instance. Update the parameters of a user on a Database Instance. You can update the password parameter, but you cannot change the name of the user. :param instance_id: UUID of the Database Instance the user belongs to. :param name: Name of the database user. :param region: Region to target. If none is passed will use default region from the config. :param password: Password of the database user. :return: User

Usage:

result = api.update_user(
    instance_id="example",
    name="example",
)
upgrade_instance(*, instance_id: str, region: str | None = None, volume_size_bytes: int | None = None) Instance

Upgrade a Database Instance. Upgrade your current Database Instance specifications like volume size. :param instance_id: UUID of the Database Instance you want to upgrade. :param region: Region to target. If none is passed will use default region from the config. :param volume_size_bytes: Increase your Block Storage volume size. One-Of (‘upgrade_target’): at most one of ‘volume_size_bytes’ could be set. :return: Instance

Usage:

result = api.upgrade_instance(
    instance_id="example",
)
wait_for_instance(*, instance_id: str, region: str | None = None, options: WaitForOptions[Instance, bool] | None = None) Instance

Get a MongoDB® Database Instance. Retrieve information about a given MongoDB® Database Instance, specified by the region and instance_id parameters. Its full details, including name, status, IP address and port, are returned in the response object. :param instance_id: UUID of the Database Instance. :param region: Region to target. If none is passed will use default region from the config. :return: Instance

Usage:

result = api.get_instance(
    instance_id="example",
)
wait_for_snapshot(*, snapshot_id: str, region: str | None = None, options: WaitForOptions[Snapshot, bool] | None = None) Snapshot

Get a Database Instance snapshot. Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the snapshot_id parameter of the snapshot you want to retrieve. :param snapshot_id: UUID of the snapshot. :param region: Region to target. If none is passed will use default region from the config. :return: Snapshot

Usage:

result = api.get_snapshot(
    snapshot_id="example",
)
class scaleway.mongodb.v1.NodeType(name: 'str', stock_status: 'NodeTypeStock', description: 'str', vcpus: 'int', memory_bytes: 'int', available_volume_types: 'List[NodeTypeVolumeType]', disabled: 'bool', beta: 'bool', instance_range: 'str')

Bases: object

available_volume_types: List[NodeTypeVolumeType]

Available storage options for the node type.

beta: bool

The node type is currently in beta.

description: str

Current specs of the offer.

disabled: bool

The node type is currently disabled.

instance_range: str

Instance range associated with the node type offer.

memory_bytes: int

Quantity of RAM.

name: str

Node type name identifier.

stock_status: NodeTypeStock

Current stock status for the node type.

vcpus: int

Number of virtual CPUs.

class scaleway.mongodb.v1.NodeTypeStock(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

AVAILABLE = 'available'
LOW_STOCK = 'low_stock'
OUT_OF_STOCK = 'out_of_stock'
UNKNOWN_STOCK = 'unknown_stock'
class scaleway.mongodb.v1.NodeTypeVolumeType(type_: 'VolumeType', description: 'str', min_size_bytes: 'int', max_size_bytes: 'int', chunk_size_bytes: 'int')

Bases: object

chunk_size_bytes: int

Minimum increment level for a Block Storage volume size.

description: str

The description of the volume.

max_size_bytes: int

Maximum size required for the volume.

min_size_bytes: int

Minimum size required for the volume.

type_: VolumeType

Volume Type.

class scaleway.mongodb.v1.RestoreSnapshotRequest(snapshot_id: 'str', instance_name: 'str', node_type: 'str', node_amount: 'int', volume_type: 'VolumeType', region: 'Optional[ScwRegion]')

Bases: object

instance_name: str

Name of the new Database Instance.

node_amount: int

Number of nodes to use for the new Database Instance.

node_type: str

Node type to use for the new Database Instance.

region: str | None

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

snapshot_id: str

UUID of the snapshot.

volume_type: VolumeType

Instance volume type.

class scaleway.mongodb.v1.SetUserRoleRequest(instance_id: 'str', user_name: 'str', region: 'Optional[ScwRegion]', roles: 'Optional[List[UserRole]]')

Bases: object

instance_id: str

UUID of the Database Instance the user belongs to.

region: str | None

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

roles: List[UserRole] | None

List of roles assigned to the user, along with the corresponding database where each role is granted.

user_name: str

Name of the database user.

class scaleway.mongodb.v1.Snapshot(id: 'str', name: 'str', status: 'SnapshotStatus', size_bytes: 'int', instance_name: 'str', node_type: 'str', volume_type: 'VolumeType', region: 'ScwRegion', instance_id: 'Optional[str]', expires_at: 'Optional[datetime]', created_at: 'Optional[datetime]', updated_at: 'Optional[datetime]')

Bases: object

created_at: datetime | None

Creation date (must follow the ISO 8601 format).

expires_at: datetime | None

Expiration date (must follow the ISO 8601 format).

id: str

UUID of the snapshot.

instance_id: str | None

UUID of the Database Instance.

instance_name: str

Name of the Database Instance of the snapshot.

name: str

Name of the snapshot.

node_type: str

Source node type.

region: str

Region of the snapshot.

size_bytes: int

Size of the snapshot.

status: SnapshotStatus

Status of the snapshot.

updated_at: datetime | None

Updated date (must follow the ISO 8601 format).

volume_type: VolumeType

Type of volume where data is stored - sbs_5k or sbs_15k.

class scaleway.mongodb.v1.SnapshotStatus(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.mongodb.v1.UpdateInstanceRequest(instance_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', tags: 'Optional[List[str]]', snapshot_schedule_frequency_hours: 'Optional[int]', snapshot_schedule_retention_days: 'Optional[int]', is_snapshot_schedule_enabled: 'Optional[bool]')

Bases: object

instance_id: str

UUID of the Database Instance to update.

is_snapshot_schedule_enabled: bool | None

Defines whether or not the snapshot schedule is enabled.

name: str | None

Name of the Database Instance.

region: str | None

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

snapshot_schedule_frequency_hours: int | None

In hours.

snapshot_schedule_retention_days: int | None

In days.

tags: List[str] | None

Tags of a Database Instance.

class scaleway.mongodb.v1.UpdateSnapshotRequest(snapshot_id: 'str', region: 'Optional[ScwRegion]', name: 'Optional[str]', expires_at: 'Optional[datetime]')

Bases: object

expires_at: datetime | None

Expiration date of the snapshot (must follow the ISO 8601 format).

name: str | None

Name of the snapshot.

region: str | None

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

snapshot_id: str

UUID of the Snapshot.

class scaleway.mongodb.v1.UpdateUserRequest(instance_id: 'str', name: 'str', region: 'Optional[ScwRegion]', password: 'Optional[str]')

Bases: object

instance_id: str

UUID of the Database Instance the user belongs to.

name: str

Name of the database user.

password: str | None

Password of the database user.

region: str | None

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

class scaleway.mongodb.v1.UpgradeInstanceRequest(instance_id: 'str', region: 'Optional[ScwRegion]', volume_size_bytes: 'Optional[int]')

Bases: object

instance_id: str

UUID of the Database Instance you want to upgrade.

region: str | None

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

volume_size_bytes: int | None
class scaleway.mongodb.v1.User(name: 'str', roles: 'List[UserRole]')

Bases: object

name: str

Name of the user (Length must be between 1 and 63 characters. First character must be an alphabet character (a-zA-Z). Only a-zA-Z0-9_$- characters are accepted).

roles: List[UserRole]

List of roles assigned to the user, along with the corresponding database where each role is granted.

class scaleway.mongodb.v1.UserRole(role: 'UserRoleRole', database_name: 'Optional[str]', any_database: 'Optional[bool]')

Bases: object

any_database: bool | None
database_name: str | None
role: UserRoleRole

Name of the preset role.

class scaleway.mongodb.v1.UserRoleRole(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

DB_ADMIN = 'db_admin'
READ = 'read'
READ_WRITE = 'read_write'
SYNC = 'sync'
UNKNOWN_ROLE = 'unknown_role'
class scaleway.mongodb.v1.Version(version: 'str', end_of_life_at: 'Optional[datetime]')

Bases: object

end_of_life_at: datetime | None

Date of End of Life.

version: str

MongoDB® major engine version.

class scaleway.mongodb.v1.Volume(type_: 'VolumeType', size_bytes: 'int')

Bases: object

size_bytes: int

Volume size.

type_: VolumeType

Type of volume where data is stored.

class scaleway.mongodb.v1.VolumeType(value: str, names: Any | None = None, *args: Any, **kwargs: Any)

Bases: str, Enum

SBS_15K = 'sbs_15k'
SBS_5K = 'sbs_5k'
UNKNOWN_TYPE = 'unknown_type'