그룹 생성
조직이나 사용자 계정에 새 그룹을 만드는 API예요. 그룹은 여러 데이터베이스를 묶어 위치와 확장 기능을 함께 관리하는 단위라고 생각하면 쉬워요.
출처: 문서
본문
조직이나 사용자를 위한 새 그룹을 만들어요.
Warning: 그룹을 둘 이상 만드는 것은 Scaler, Pro, Enterprise 플랜에서만 가능해요.
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/groups' \
-H 'Authorization: Bearer ***' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-group",
"location": "lhr"
}'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const group = await turso.groups.create("new-group", {
location: "lhr",
extensions: ["vector", "uuid"], // 'all'
});
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:
/v1/organizations/{organizationSlug}/groups:
post:
summary: Create Group
description: Creates a new group for the organization or user.
operationId: createGroup
parameters:
- $ref: '#/components/parameters/organizationSlug'
requestBody:
description: Group data to create a new group
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewGroup'
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
group:
$ref: '#/components/schemas/Group'
description: The newly created group
'409':
description: Conflict
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: The error message
example: group already exists
components:
parameters:
organizationSlug:
in: path
name: organizationSlug
required: true
schema:
type: string
description: The slug of the organization or user account.
schemas:
NewGroup:
type: object
properties:
name:
type: string
description: The name of the new group.
location:
type: string
description: The location key for the new group.
extensions:
$ref: '#/components/schemas/Extensions'
required:
- name
- location
example:
name: new-group
location: aws-us-east-1
Group:
allOf:
- $ref: '#/components/schemas/BaseGroup'
- type: object
Extensions:
oneOf:
- type: string
enum:
- all
description: Set to `all` to enable all extensions.
- type: array
items:
type: string
enum:
- vector
- crypto
- fuzzy
- math
- stats
- text
- unicode
- uuid
- regexp
- vec
description: Array of extensions to enable.
description: >-
The extensions to enable for new databases created in this group. Users
looking to enable vector extensions should instead use the native
[libSQL vector datatype](/features/ai-and-embeddings).
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