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

데이터베이스 인스턴스 조회

원문 보기 위키 갱신

이름으로 개별 데이터베이스 인스턴스를 반환하는 API예요.

출처: 문서

본문

요청 예시:

curl -L https://api.turso.tech/v1/organizations/{organizationSlug}/databases/{databaseName}/instances/{instanceName} \
  -H 'Authorization: Bearer ***'

Node.js 요청 예시:

import { createClient } from "@tursodatabase/api";

const turso = createClient({
  org: "...",
  token: "",
});

const instance = await turso.databases.retrieveInstance(
  "my-db",
  "instanceName",
);

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}/databases/{databaseName}/instances/{instanceName}:
    get:
      summary: Retrieve Database Instance
      description: Return the individual database instance by name.
      operationId: getDatabaseInstance
      parameters:
        - $ref: '#/components/parameters/organizationSlug'
        - $ref: '#/components/parameters/databaseName'
        - $ref: '#/components/parameters/instanceName'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  instance:
                    $ref: '#/components/schemas/Instance'
components:
  parameters:
    organizationSlug:
      in: path
      name: organizationSlug
      required: true
      schema:
        type: string
      description: The slug of the organization or user account.
    databaseName:
      name: databaseName
      in: path
      required: true
      schema:
        type: string
      description: The name of the database.
    instanceName:
      name: instanceName
      in: path
      required: true
      schema:
        type: string
      description: The name of the instance (location code).
  schemas:
    Instance:
      type: object
      properties:
        uuid:
          type: string
          description: The instance universal unique identifier (UUID).
          example: 0be90471-6906-11ee-8553-eaa7715aeaf2
        name:
          type: string
          description: The name of the instance (location code).
          example: aws-us-east-1
        type:
          type: string
          description: The type of database instance this, will be `primary` or `replica`.
          enum:
            - primary
            - replica
          example: primary
        region:
          type: string
          description: The location code for the region this instance is located.
          example: aws-us-east-1
        hostname:
          type: string
          description: >-
            The DNS hostname used for client libSQL and HTTP connections
            (specific to this instance only).
          example: '[databaseName]-[organizationSlug].turso.io'

더 알아보기 (Learn more)