그룹 복구
최근 5일 안에 삭제된 그룹을, 함께 삭제된 멤버 데이터베이스까지 되돌려 주는 API예요. 유료 플랜이고 조직의 admin 또는 owner여야 하고, 조직에 복구 기능이 켜져 있어야 해요. 일부 데이터베이스 복구에 실패하더라도 그룹 자체는 활성화되니, 실패한 데이터베이스 UUID는 Restore Database로 하나씩 다시 시도하면 돼요.
출처: 문서
본문
최근 5일 내에 삭제된 그룹을, 함께 삭제된 멤버 데이터베이스와 함께 복구해요. 유료 플랜, 조직의 admin 또는 owner, 조직에 활성화된 복구 기능이 필요해요. 일부 데이터베이스 복구에 실패해도 그룹은 활성 상태가 돼요: 실패한 데이터베이스 UUID는 Restore Database로 개별적으로 재시도하세요.
Note: v1 엔드포인트와 달리 이 엔드포인트는 조직과 그룹을 UUID로 식별해요 — 조직 조회의 id 필드와 삭제된 그룹 목록 조회의 uuid 필드를 사용하세요.
curl -L -X POST 'https://api.turso.tech/v3/organizations/{organizationId}/groups/{groupId}/restore' \
-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}/groups/{groupId}/restore:
post:
summary: Restore Group
description: >-
Restore a group deleted within the last five days, along with the member
databases that were deleted with it. Requires a paid plan, an admin or
owner of the organization, and recovery enabled for the organization. If
some databases fail to restore, the group still becomes active: retry
the failed database UUIDs individually with Restore Database.
operationId: restoreGroup
parameters:
- $ref: '#/components/parameters/organizationId'
- $ref: '#/components/parameters/groupId'
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
group:
$ref: '#/components/schemas/Group'
description: The restored group.
databases:
type: array
items:
$ref: '#/components/schemas/DeletedDatabase'
description: >-
The member databases restored with the group, in restore
order.
failures:
type: object
additionalProperties:
type: string
description: >-
Maps database UUID to error message for members whose
restore failed. Retry them individually with Restore
Database.
'400':
description: >-
Recovery is disabled for the organization, or the request is
invalid.
'403':
description: >-
The organization is on the free plan, or the caller is not an admin
or owner.
'404':
description: >-
No deleted group with this UUID exists, or its recovery window has
passed.
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).
groupId:
name: groupId
in: path
required: true
schema:
type: string
format: uuid
description: >-
The UUID of the group, as returned when listing deleted groups (the
`uuid` field).
schemas:
Group:
allOf:
- $ref: '#/components/schemas/BaseGroup'
- type: object
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.
BaseGroup:
type: object
properties:
name:
type: string
description: The group name, unique across your organization.
example: default
version:
type: string
description: >-
The current libSQL server version the databases in that group are
running.
example: v0.23.7
deprecated: true
uuid:
type: string
description: The group universal unique identifier (UUID).
example: 0a28102d-6906-11ee-8553-eaa7715aeaf2
locations:
type: array
items:
type: string
description: An array of location keys the group is located.
example:
- aws-us-east-1
deprecated: true
primary:
type: string
description: The primary location key.
example: us-east-1
delete_protection:
type: boolean
description: >-
The current status for delete protection. If enabled, the group and
all its databases cannot be deleted.
example: false