Apache ShardingSphere Databases API

The Databases API from Apache ShardingSphere — 2 operation(s) for databases.

OpenAPI Specification

apache-shardingsphere-databases-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Apache ShardingSphere REST Cluster Databases API
  description: Apache ShardingSphere is a distributed SQL transaction and query engine that transforms any database into a distributed database system. This API provides REST endpoints for managing sharding rules, data sources, read-write splitting, and cluster configuration via DistSQL.
  version: 5.4.0
  contact:
    name: Apache ShardingSphere
    url: https://shardingsphere.apache.org/
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://shardingsphere.example.com/api
  description: Apache ShardingSphere REST API
tags:
- name: Databases
paths:
  /databases:
    get:
      operationId: listDatabases
      summary: Apache ShardingSphere List Databases
      description: List all logical databases registered in ShardingSphere.
      tags:
      - Databases
      x-microcks-operation:
        dispatcher: RANDOM
      responses:
        '200':
          description: List of databases
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseList'
    post:
      operationId: createDatabase
      summary: Apache ShardingSphere Create Database
      description: Register a new logical database in ShardingSphere.
      tags:
      - Databases
      x-microcks-operation:
        dispatcher: RANDOM
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatabaseRequest'
      responses:
        '200':
          description: Database created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
  /databases/{databaseName}:
    get:
      operationId: getDatabase
      summary: Apache ShardingSphere Get Database
      description: Get details of a specific ShardingSphere database.
      tags:
      - Databases
      x-microcks-operation:
        dispatcher: URI_PARTS
        dispatcherRules: databaseName
      parameters:
      - name: databaseName
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Database details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
    delete:
      operationId: deleteDatabase
      summary: Apache ShardingSphere Delete Database
      description: Unregister a logical database from ShardingSphere.
      tags:
      - Databases
      x-microcks-operation:
        dispatcher: URI_PARTS
        dispatcherRules: databaseName
      parameters:
      - name: databaseName
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Database deleted
components:
  schemas:
    DatabaseRequest:
      type: object
      description: Request to create a logical database
      required:
      - name
      properties:
        name:
          type: string
          description: Database name
    Database:
      type: object
      description: ShardingSphere logical database
      properties:
        name:
          type: string
          description: Database name
        dataSources:
          type: array
          items:
            type: string
          description: Registered data source names
    DatabaseList:
      type: object
      description: List of ShardingSphere logical databases
      properties:
        databases:
          type: array
          items:
            $ref: '#/components/schemas/Database'