openapi: 3.1.0
info:
  title: Serverless SQL Databases API
  description: "Scaleway's Serverless SQL DB is a fully-managed and flexible service
    offering SQL Databases. It provides elastic scaling and a pay-per-use model, ensuring
    you pay only for the queries you run and storage you consume.\n\nDesigned to free
    you from administrative and configuration tasks, it lets you focus solely on your
    data and application development. We handle high availability, regular backups,
    and configuration.\n\nYour database only runs when in use, hosted in our energy-efficient
    datacenters in Europe, reducing your carbon footprint. Data is kept securely within
    our regions in Paris, Amsterdam, and Warsaw. Serverless SQL DB by Scaleway is
    a smart choice for efficient and sustainable database management.\n\n \n\n## Concepts\n\nRefer
    to our [dedicated concepts page](https://www.scaleway.com/en/docs/serverless/sqldb/concepts/)
    to find definitions of the different terms referring to Serverless SQL DB.\n\n\n\n\n##
    Quickstart\n\n1. Configure your environment variables.\n   <Message type=\"note\">\n
    \  This is an optional step that seeks to simplify your usage of the APIs.\n   </Message>\n\n
    \   ```bash\n    export SCW_ACCESS_KEY=\"<API access key>\"\n    export SCW_SECRET_KEY=\"<API
    secret key>\"\n    export SCW_REGION=\"<Scaleway region>\"\n    ```\n2. Edit the
    POST request payload you will use to create your Serverless SQL DB Database. Replace
    the parameters in the following example:\n    ```json\n        {\n          \"organization_id\":
    \"895693aa-3915-4896-8761-c2923b008be7\",\n          \"project_id\": \"d8e65f2b-cce9-40b7-80fc-6a2902db6826\",\n
    \         \"name\": \"myDB\",\n          \"cpu_min\": 0,\n          \"cpu_max\":
    5\n        }\n    ```\n\n   | Parameter         | Description                                                                                                                                                                                                                                                                                 |\n
    \  |:------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n
    \  | `organization_id` | Your Organization ID. It must be in UUID format. To find
    your Organization ID, you can consult the **[Scaleway console](https://console.scaleway.com/organization/settings)**.
    \                                                                                                             |\n
    \  | `project_id`      | The ID of the Project you want to create your Serverless
    SQL DB Database in. To find your Project ID you can **[list the projects](/api/account#path-projects-list-all-projects-of-an-organization)**
    or consult the **[Scaleway console](https://console.scaleway.com/project/settings)**.
    |\n   | `name`            | Name of the Serverless SQL DB Database                                                                                                                                                                                                                                                      |\n
    \  | `cpu_min`         | The minimum number of CPUs units your Serverless SQL
    DB Database can scale down to.                                                                                                                                                                                                         |\n
    \  | `cpu_max`         | The maximum number of CPUs units your Serverless SQL
    DB Database can scale up to.                                                                                                                                                                                                           |\n3.
    Create a Database by running the following command. Make sure you include the
    payload you edited in the previous step.\n    ```bash\n    curl -X POST \\\n      -H
    \"X-Auth-Token: $SCW_SECRET_KEY\" \\\n      \"Content-Type: application/json\"
    \\\n      https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/$SCW_REGION/databases
    \\\n      -d '{\n          \"organization_id\": \"895693aa-3915-4896-8761-c2923b008be7\",\n
    \         \"project_id\": \"d8e65f2b-cce9-40b7-80fc-6a2902db6826\",\n          \"name\":
    \"myDB\",\n          \"cpu_min\": 0,\n          \"cpu_max\": 5\n        }'\n    ```\n4.
    List your Databases.\n    ```bash\n    curl -X GET \\\n      -H \"Content-Type:
    application/json\" \\\n      -H \"X-Auth-Token: $SCW_SECRET_KEY\" https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/$SCW_REGION/databases\n
    \   ```\n\n   You should get a response like the following:\n\n    <Message type=\"note\">\n
    \   This is a response example, the UUIDs and IP address displayed are not real.\n
    \   </Message>\n\n    ```json\n    {\n          \"id\": \"f5122f66-fb50-4cef-aa02-487ef4fc1af0\",\n
    \         \"name\": \"myDB\",\n          \"organization_id\": \"895693aa-3915-4896-8761-c2923b008be7\",\n
    \         \"project_id\": \"d8e65f2b-cce9-40b7-80fc-6a2902db6826\",\n          \"status\":
    \"ready\",\n          \"endpoint\": \"postgres://f5122f66-fb50-4cef-aa02-487ef4fc1af0.pg.sdb.fr-par.scw.cloud/myDB\",\n
    \         \"created_at\": \"2019-04-19T16:24:52.591417Z\",\n          \"region\":
    \"fr-par\"\n    }\n    ```\n5. Retrieve your Serverless SQL DB endpoint from the
    response.\n   <Message type=\"note\">\n   In the example above, the Endpoint is
    `postgres://f5122f66-fb50-4cef-aa02-487ef4fc1af0.pg.sdb.fr-par.scw.cloud/myDB`.\n
    \  </Message>\n6. Connect to your Database with the psql database client using
    the endpoint and one of your IAM principals:\n\n    ```bash\n    psql postgres://<iam-principal>:<iam-api-key>@f5122f66-fb50-4cef-aa02-487ef4fc1af0.pg.sdb.fr-par.scw.cloud/myDB\n
    \   ```\n\n\n\n<Message type=\"requirement\">\nTo perform the following steps,
    you must first ensure that:\n- you have an account and are logged into the [Scaleway
    console](https://console.scaleway.com/organization)\n- you have created an [API
    key](https://www.scaleway.com/en/docs/iam/how-to/create-api-keys/) and that the
    API key has sufficient [IAM permissions](https://www.scaleway.com/en/docs/iam/reference-content/permission-sets/)
    to perform the actions described on this page.\n- you have [installed `curl`](https://curl.se/download.html)\n
    \ </Message>\n  \n\n## Technical Information\n\n### Regions\n\nScaleway's infrastructure
    is spread across different [regions and Availability Zones](https://www.scaleway.com/en/docs/account/reference-content/products-availability/).\n\nServerless
    SQL DB is available in the Paris region, which is represented by the following
    path parameters:\n\n- `fr-par`\n\n### PostgreSQL specifications\n\n#### Versions\n\nScaleway
    Serverless SQL DB supports PostgreSQL version 14.\n\n\n## Technical Limitations\n\n####
    User Management\n\n- users do NOT have `SUPERUSER` nor `REPLICATION` privileges.\n\n[//]:
    # (TODO: add details to User Management limitations)\n\n\n\n## Going Further\n\nFor
    more information about Serverless SQL DB , you can check out the following pages:\n\n*
    [Serverless SQL DB Documentation](https://www.scaleway.com/en/docs/serverless/sqldb/)\n*
    [Scaleway Slack Community](https://scaleway-community.slack.com/) join the #database
    channel\n* [Contact our support team](https://console.scaleway.com/support/tickets)."
  version: v1alpha1
servers:
- url: https://api.scaleway.com
tags:
- name: Serverless SQL Databases
- name: Serverless SQL Databases Backups
components:
  schemas:
    scaleway.serverless_sqldb.v1alpha1.Database:
      type: object
      properties:
        id:
          type: string
          description: UUID that uniquely identifies your Serverless SQL DB Database.
        name:
          type: string
          description: Name of the database.
        status:
          type: string
          description: Status of the Serverless SQL Ddatabase. One of `unknown_status`
            | `ready` | `creating` | `deleting` | `error` | `restoring` | `locked`.
          enum:
          - unknown_status
          - error
          - creating
          - ready
          - deleting
          - restoring
          - locked
          default: unknown_status
        endpoint:
          type: string
          description: Endpoint of the database.
        organization_id:
          type: string
          description: The ID of your Scaleway organization.
        project_id:
          type: string
          description: Project ID the database belongs to.
        region:
          type: string
          description: Region of the database.
        created_at:
          type: string
          description: Creation date. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        cpu_min:
          type: integer
          description: The minimum number of CPU units for your Serverless SQL Database.
          format: uint32
        cpu_max:
          type: integer
          description: The maximum number of CPU units for your Serverless SQL Database.
          format: uint32
        cpu_current:
          type: integer
          description: The current number of CPU units allocated to your Serverless
            SQL Database.
          format: uint32
        started:
          type: boolean
          description: Whether your Serverless SQL Database is running or not.
        engine_major_version:
          type: integer
          description: The major version of the underlying database engine.
          format: uint32
      x-properties-order:
      - id
      - name
      - status
      - endpoint
      - organization_id
      - project_id
      - region
      - created_at
      - cpu_min
      - cpu_max
      - cpu_current
      - started
      - engine_major_version
    scaleway.serverless_sqldb.v1alpha1.DatabaseBackup:
      type: object
      properties:
        id:
          type: string
          description: UUID that uniquely identifies a Serverless SQL Database backup.
        status:
          type: string
          description: Status of the Serverless SQL Database backup. One of `unknown_status`
            | `error` | `ready` | `locked`.
          enum:
          - unknown_status
          - error
          - ready
          - locked
          default: unknown_status
        organization_id:
          type: string
          description: The ID of your Scaleway organization.
        project_id:
          type: string
          description: UUID of the Scaleway project.
        database_id:
          type: string
          description: UUID of the source Serverless SQL Database the backup is created
            from.
        created_at:
          type: string
          description: Creation date. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        expires_at:
          type: string
          description: Expiration date. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        size:
          type: integer
          description: Size (in bytes) of the database backup file. (in bytes)
          format: uint64
          nullable: true
        db_size:
          type: integer
          description: Size (in bytes) of the database when backup has been done.
            (in bytes)
          format: uint64
          nullable: true
        download_url:
          type: string
          description: Download URL of the exported database backup.
          nullable: true
        download_url_expires_at:
          type: string
          description: Expiration date of the download URL. (RFC 3339 format)
          format: date-time
          example: "2022-03-22T12:34:56.123456Z"
          nullable: true
        region:
          type: string
          description: Region of the database backup.
      x-properties-order:
      - id
      - status
      - organization_id
      - project_id
      - database_id
      - created_at
      - expires_at
      - size
      - db_size
      - download_url
      - download_url_expires_at
      - region
    scaleway.serverless_sqldb.v1alpha1.ListDatabaseBackupsResponse:
      type: object
      properties:
        backups:
          type: array
          description: List of the backups.
          items:
            $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.DatabaseBackup'
        total_count:
          type: integer
          description: Length of the backups list.
          format: uint64
      x-properties-order:
      - backups
      - total_count
    scaleway.serverless_sqldb.v1alpha1.ListDatabasesResponse:
      type: object
      properties:
        databases:
          type: array
          description: List of the databases.
          items:
            $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.Database'
        total_count:
          type: integer
          description: Total count of Serverless SQL Databases.
          format: uint64
      x-properties-order:
      - databases
      - total_count
  securitySchemes:
    scaleway:
      in: header
      name: X-Auth-Token
      type: apiKey
paths:
  /serverless-sqldb/v1alpha1/regions/{region}/backups:
    get:
      tags:
      - Serverless SQL Databases Backups
      operationId: ListDatabaseBackups
      summary: List your Serverless SQL Database backups
      description: 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.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: organization_id
        description: Filter by the UUID of the Scaleway organization. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: project_id
        description: Filter by the UUID of the Scaleway project. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: database_id
        description: Filter by the UUID of the Serverless SQL Database.
        required: true
        schema:
          type: string
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Page size.
        schema:
          type: integer
          format: uint32
      - in: query
        name: order_by
        description: Sorting criteria. One of `created_at_asc`, `created_at_desc`.
        schema:
          type: string
          enum:
          - created_at_desc
          - created_at_asc
          default: created_at_desc
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.ListDatabaseBackupsResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/backups?database_id=string&page=42&page_size=42"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/backups" \
            X-Auth-Token:$SCW_SECRET_KEY \
            database_id==string \
            page==42 \
            page_size==42
  /serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}:
    get:
      tags:
      - Serverless SQL Databases Backups
      operationId: GetDatabaseBackup
      summary: Get a database backup information
      description: Retrieve information about your Serverless SQL Database backup.
        You must provide the `backup_id` parameter.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: backup_id
        description: UUID of the Serverless SQL Database backup.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.DatabaseBackup'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}/export:
    post:
      tags:
      - Serverless SQL Databases Backups
      operationId: ExportDatabaseBackup
      summary: Export a database backup
      description: Export a database backup providing a download link once the export
        process is completed. You must provide the `backup_id` parameter.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: backup_id
        description: UUID of the Serverless SQL Database backup.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.DatabaseBackup'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}/export"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}/export" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-sqldb/v1alpha1/regions/{region}/databases:
    get:
      tags:
      - Serverless SQL Databases
      operationId: ListDatabases
      summary: List your Serverless SQL Databases
      description: 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.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: query
        name: organization_id
        description: Filter by the UUID of the Scaleway organization. (UUID format)
        schema:
          type: string
          example: 6170692e-7363-616c-6577-61792e636f6d
      - in: query
        name: project_id
        description: UUID of the Scaleway project.
        required: true
        schema:
          type: string
      - in: query
        name: page
        description: Page number.
        schema:
          type: integer
          format: int32
      - in: query
        name: page_size
        description: Page size.
        schema:
          type: integer
          format: uint32
      - in: query
        name: name
        description: Filter by the name of the database.
        schema:
          type: string
      - in: query
        name: order_by
        description: Sorting criteria. One of `created_at_asc`, `created_at_desc`,
          `name_asc`, `name_desc`.
        schema:
          type: string
          enum:
          - created_at_asc
          - created_at_desc
          - name_asc
          - name_desc
          default: created_at_asc
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.ListDatabasesResponse'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases?page=42&page_size=42&project_id=string"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases" \
            X-Auth-Token:$SCW_SECRET_KEY \
            page==42 \
            page_size==42 \
            project_id==string
    post:
      tags:
      - Serverless SQL Databases
      operationId: CreateDatabase
      summary: Create a new Serverless SQL Database
      description: '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.'
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.Database'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  description: The ID of your Scaleway project.
                name:
                  type: string
                  description: The name of the Serverless SQL Database to be created.
                cpu_min:
                  type: integer
                  description: The minimum number of CPU units for your Serverless
                    SQL Database.
                  format: uint32
                cpu_max:
                  type: integer
                  description: The maximum number of CPU units for your Serverless
                    SQL Database.
                  format: uint32
                from_backup_id:
                  type: string
                  description: The ID of the backup to create the database from.
                  nullable: true
              required:
              - project_id
              - name
              - cpu_min
              - cpu_max
              x-properties-order:
              - project_id
              - name
              - cpu_min
              - cpu_max
              - from_backup_id
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "cpu_max": 42,
              "cpu_min": 42,
              "name": "string",
              "project_id": "string"
            }' \
            "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases" \
            X-Auth-Token:$SCW_SECRET_KEY \
            cpu_max:=42 \
            cpu_min:=42 \
            name="string" \
            project_id="string"
  /serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}:
    get:
      tags:
      - Serverless SQL Databases
      operationId: GetDatabase
      summary: Get a database information
      description: Retrieve information about your Serverless SQL Database. You must
        provide the `database_id` parameter.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: database_id
        description: UUID of the Serverless SQL DB database.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.Database'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X GET \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}"
      - lang: HTTPie
        source: |-
          http GET "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    patch:
      tags:
      - Serverless SQL Databases
      operationId: UpdateDatabase
      summary: Update database information
      description: Update CPU limits of your Serverless SQL Database. You must provide
        the `database_id` parameter.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: database_id
        description: UUID of the Serverless SQL Database.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.Database'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                cpu_min:
                  type: integer
                  description: The minimum number of CPU units for your Serverless
                    SQL Database.
                  format: uint32
                  nullable: true
                cpu_max:
                  type: integer
                  description: The maximum number of CPU units for your Serverless
                    SQL Database.
                  format: uint32
                  nullable: true
              x-properties-order:
              - cpu_min
              - cpu_max
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X PATCH \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{}' \
            "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}"
      - lang: HTTPie
        source: |-
          http PATCH "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
    delete:
      tags:
      - Serverless SQL Databases
      operationId: DeleteDatabase
      summary: Delete a database
      description: Deletes a database. You must provide the `database_id` parameter.
        All data stored in the database will be permanently deleted.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: database_id
        description: UUID of the Serverless SQL Database.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.Database'
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X DELETE \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}"
      - lang: HTTPie
        source: |-
          http DELETE "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}" \
            X-Auth-Token:$SCW_SECRET_KEY
  /serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}/restore:
    post:
      tags:
      - Serverless SQL Databases
      operationId: RestoreDatabaseFromBackup
      summary: Restore a database from a backup
      description: Restore a database from a backup. You must provide the `backup_id`
        parameter.
      parameters:
      - in: path
        name: region
        description: The region you want to target
        required: true
        schema:
          type: string
          enum:
          - fr-par
      - in: path
        name: database_id
        description: UUID of the Serverless SQL Database.
        required: true
        schema:
          type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scaleway.serverless_sqldb.v1alpha1.Database'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                backup_id:
                  type: string
                  description: UUID of the Serverless SQL Database backup to restore.
              required:
              - backup_id
              x-properties-order:
              - backup_id
      security:
      - scaleway: []
      x-codeSamples:
      - lang: cURL
        source: |-
          curl -X POST \
            -H "X-Auth-Token: $SCW_SECRET_KEY" \
            -H "Content-Type: application/json" \
            -d '{"backup_id":"string"}' \
            "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}/restore"
      - lang: HTTPie
        source: |-
          http POST "https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}/restore" \
            X-Auth-Token:$SCW_SECRET_KEY \
            backup_id="string"
