본문 바로가기
WIKI 기술 지식 베이스

삭제된 데이터베이스 목록 조회

원문 보기 위키 갱신

최근 5일 이내에 삭제되어 아직 복원할 수 있는 데이터베이스를 반환하는 API예요. 유료 플랜이 필요해요. 조직에서 복구가 비활성화된 상태에서도 사용할 수 있어요.

출처: 문서

본문

v1 엔드포인트와 달리 이 엔드포인트는 조직을 UUID로 식별해요 — 조직 조회의 id 필드를 사용하세요.

요청 예시:

curl -L 'https://api.turso.tech/v3/organizations/{organizationId}/databases?deleted=true' \
  -H 'Authorization: Bearer ***'

OpenAPI

openapi: 3.0.1
info:
  title: Turso Platform API
  description: API description here
  license:
    name: MIT
  version: 0.1.0
servers:
  - url: https://api.turso.tech
    description: Turso's Platform API
security: []
paths:
  /v3/organizations/{organizationId}/databases:
    get:
      summary: List Deleted Databases
      description: >-
        Returns databases deleted within the last five days, which can still be
        restored. Requires a paid plan. Available even while recovery is
        disabled for the organization.
      operationId: listDeletedDatabases
      parameters:
        - $ref: '#/components/parameters/organizationId'
        - name: deleted
          in: query
          required: true
          schema:
            type: boolean
          description: Must be `true` to list deleted databases.
        - name: search
          in: query
          schema:
            type: string
          description: Filter deleted databases by name.
        - name: limit
          in: query
          schema:
            type: integer
            default: 100
          description: Page size, from 1 to 1000.
        - name: cursor
          in: query
          schema:
            type: string
          description: Opaque pagination cursor from the previous page's `pagination.next`.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  databases:
                    type: array
                    items:
                      $ref: '#/components/schemas/DeletedDatabase'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '403':
          description: The organization is on the free plan.
components:
  parameters:
    organizationId:
      name: organizationId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: >-
        The UUID of the organization. Retrieve it with the Retrieve Organization
        endpoint (the `id` field).
  schemas:
    DeletedDatabase:
      type: object
      properties:
        Name:
          type: string
          description: The database name.
        DbId:
          type: string
          format: uuid
          description: The database UUID. Use it to restore the database.
        Hostname:
          type: string
          description: >-
            The DNS hostname the database had, used for client and HTTP
            connections.
        group:
          type: string
          description: The name of the group the database belonged to.
        group_id:
          type: string
          format: uuid
          description: The UUID of the group the database belonged to.
        organization_id:
          type: string
          format: uuid
          description: The UUID of the organization.
        regions:
          type: array
          items:
            type: string
          description: The regions the database was located in.
        primaryRegion:
          type: string
          description: The primary region of the database.
        delete_protection:
          type: boolean
          description: Whether delete protection was enabled for the database.
        deleted_at:
          type: string
          format: date-time
          description: When the database was deleted.
        group_deleted_at:
          type: string
          format: date-time
          description: >-
            Set when the database's group was deleted with it. Restoring the
            database also restores the group.
    Pagination:
      type: object
      properties:
        next:
          type: string
          description: >-
            Opaque cursor for the next page. Pass it back as the `cursor` query
            parameter. Absent on the last page.

더 알아보기 (Learn more)