Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] Develop HTTP API for UI. #344

Closed
19 tasks done
dongzl opened this issue Aug 6, 2022 · 3 comments
Closed
19 tasks done

[UI] Develop HTTP API for UI. #344

dongzl opened this issue Aug 6, 2022 · 3 comments
Assignees
Labels
config Config center.

Comments

@dongzl
Copy link
Contributor

dongzl commented Aug 6, 2022

What would you like to be added:

Why is this needed:

  • Tenants

    • List all tenants
    • Create a tenant
    • Get a tenant
    • Update a tenant
  • Nodes

    • List mysql nodes
    • Create mysql node
    • Get a mysql node
    • Delete a mysql node
    • Update a mysql node
  • DB Group

    • Create a DB group
    • List all DB groups
    • Get a DB group
    • Update a DB group
    • Delete a DB group
  • Clusters

    • Create a cluster
    • List all clusters
    • Get a cluster
    • Update a cluster
    • Delete a cluster
openapi: 3.0.3
info:
  title: Arana
  description: Arana
  version: 1.0.0
servers:
  - url: 'http://127.0.0.1:8080/'
paths:
  /tenants:
    get:
      operationId: listTenants
      summary: List all tenants
      responses:
        '200':
          description: All Tenants
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tenants'

    post:
      operationId: createTenant
      summary: Create a tenant
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Tenant'
      responses:
        '201':
          description: OK

  /tenants/{tenantName}:
    get:
      operationId: getTenant
      summary: Get a tenant
      responses:
        '200':
          description: Single Tenant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tenant'
    delete:
      operationId: deleteTenant
      summary: Delete a tenant
      responses:
        '204':
          description: NONE
    put:
      operationId: putTenant
      summary: Update a tenant
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Tenant'
      responses:
        '200':
          description: OK

  /tenants/{tenantName}/nodes:
    get:
      operationId: listNodes
      summary: List mysql nodes
      responses:
        '200':
          description: All MySQL Nodes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Nodes'

    post:
      operationId: createNode
      summary: Create mysql node
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Node'
      responses:
        '200':
          description: OK

  /tenants/{tenantName}/nodes/{nodeName}:
    get:
      operationId: getNode
      summary: Get a mysql node
      responses:
        '200':
          description: Single MySQL Node
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Node'
    delete:
      operationId: deleteNode
      summary: Delete a mysql node
      responses:
        '204':
          description: NONE

    put:
      operationId: putNode
      summary: Update a mysql node
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Node'
      responses:
        '200':
          description: OK

  /tenants/{tenantName}/groups:
    post:
      operationId: createGroup
      summary: Create a DB group
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Group'
      responses:
        '201':
          description: OK

    get:
      operationId: listGroups
      summary: List all DB groups
      responses:
        '200':
          description: All groups
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Groups'

  /tenants/{tenantName}/groups/{groupName}:
    get:
      operationId: getGroup
      summary: Get a DB group
      responses:
        '200':
          description: Single DB group
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
    put:
      operationId: putGroup
      summary: Update a DB group
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Group'
      responses:
        '200':
          description: OK

    delete:
      operationId: deleteGroup
      summary: Delete a DB group
      responses:
        '204':
          description: NONE

  /tenants/{tenantName}/clusters:
    post:
      operationId: createCluster
      summary: Create a cluster
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Cluster'
      responses:
        '200':
          description: OK

    get:
      operationId: listClusters
      summary: List all clusters
      responses:
        '200':
          description: All Clusters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Clusters'

  /tenants/{tenantName}/clusters/{clusterName}:
    get:
      operationId: getCluster
      summary: Get a cluster
      responses:
        '200':
          description: Single Cluster
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cluster'

    put:
      operationId: putCluster
      summary: Update a cluster
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Cluster'
      responses:
        '200':
          description: OK

    delete:
      operationId: deleteCluster
      summary: Delete a cluster
      responses:
        '204':
          description: NONE

components:
  schemas:
    Tenant:
      type: object
      properties:
        name:
          type: string
        users:
          type: array
          items:
            type: object
            properties:
              username:
                type: string
              password:
                type: string
      example:
        name: "foobar"
        users:
          - username: "tom"
            password: "12345678"
          - username: "john"
            password: "12345678"
    Tenants:
      type: array
      items:
        $ref: '#/components/schemas/Tenant'

    Node:
      type: object
      required:
        - name
        - host
        - username
        - password
        - database
        - weight
      properties:
        name:
          type: string
        host:
          type: string
        port:
          type: integer
        username:
          type: string
        password:
          type: string
        database:
          type: string
        weight:
          type: string
        parameters:
          type: object
      example:
        name: mysql-axfwq87
        host: 1.2.3.4
        port: 3306
        username: root
        password: 12345678
        database: employees_0000
        weight: r10w10

    Nodes:
      type: array
      items:
        $ref: '#/components/schemas/Node'

    Group:
      type: object
      required:
        - name
        - nodes
      properties:
        name:
          type: string
        nodes:
          type: array
          items:
            type: string
      example:
        name: employees_0000
        nodes:
          - mysql-fwijfo8
          - mysql-we7nvil
          - mysql-vjm24if

    Groups:
      type: array
      items:
        $ref: '#/components/schemas/Group'

    Cluster:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        groups:
          type: array
          items:
            type: string
      example:
        name: employees
        type: mysql
        groups:
          - employees_0000
          - employees_0001
          - employees_0002
          - employees_0003
          - employees_0004
          - employees_0005
          - employees_0006
          - employees_0007

    Clusters:
      type: array
      items:
        $ref: '#/components/schemas/Cluster'
@dongzl dongzl added the config Config center. label Aug 6, 2022
@gongna-au
Copy link
Contributor

Nodes

@JasonZhang95
Copy link
Contributor

Tenants

@dongzl
Copy link
Contributor Author

dongzl commented Aug 12, 2022

Clusters

@dongzl dongzl self-assigned this Aug 12, 2022
@gongna-au gongna-au removed their assignment Aug 13, 2022
jettcc pushed a commit to jettcc/arana that referenced this issue Aug 22, 2022
jjeffcaii pushed a commit that referenced this issue Aug 31, 2022
* add: missing interfaces in proto files and discovery files

* feat: group api in file db_groups.go (#344)

* style: add license header and add tool: imports-formatter

* style: fix import
chuntaojun pushed a commit to chuntaojun/arana that referenced this issue Sep 4, 2022
* add: missing interfaces in proto files and discovery files

* feat: group api in file db_groups.go (arana-db#344)

* style: add license header and add tool: imports-formatter

* style: fix import
jjeffcaii added a commit that referenced this issue Sep 4, 2022
* feat: add group api for UI module #344 (#373)

* add: missing interfaces in proto files and discovery files

* feat: group api in file db_groups.go (#344)

* style: add license header and add tool: imports-formatter

* style: fix import

* feat: support notify event

* refactor:config center

* none

* feat: none

* refactor:split config and add change watch

* style: fix code style

* fix: fix func call error

* fix: ci error

* style:fix code style

* fix: fix code style

* refactor: rebase upstream

* fix:add cluster info to list groups

Co-authored-by: chovychan <51713304+chovychan@users.noreply.github.com>
Co-authored-by: Jeffsky <jjeffcaii@outlook.com>
AlexStocks pushed a commit that referenced this issue Sep 10, 2022
* feat: add admin api server skeleton (#330)

* feat(config): add config updater api (#336)

* add http server api for cluster. (#352)

* add http server api for tenant (#366)

* add http server api for tenant

* fix import format

* fix go format

Co-authored-by: Zhang Aphelios <aphelios.zhang@shopee.com>

* add  http api for nodes#344 (#371)

* add  http api for nodes

* fix:bug

* fix:bug

* fix:bug

* fix:bug

* feat: add arana-admin into docker compose file

* fix 🐛  HTTP API For UI (#399)

* change

* change

* feat(config): support new config & Feat config listener (#374)

* feat: add group api for UI module #344 (#373)

* add: missing interfaces in proto files and discovery files

* feat: group api in file db_groups.go (#344)

* style: add license header and add tool: imports-formatter

* style: fix import

* feat: support notify event

* refactor:config center

* none

* feat: none

* refactor:split config and add change watch

* style: fix code style

* fix: fix func call error

* fix: ci error

* style:fix code style

* fix: fix code style

* refactor: rebase upstream

* fix:add cluster info to list groups

Co-authored-by: chovychan <51713304+chovychan@users.noreply.github.com>
Co-authored-by: Jeffsky <jjeffcaii@outlook.com>

* fix: compile failure

* fix:unit test (#403)

* Feat/admin api (#404)

* Feat/admin api (#406)

* fix:unit test

* fix:unit test

* fix:file unit test

Co-authored-by: Zonglei Dong <dongzonglei@apache.org>
Co-authored-by: Aphelios <996933971@qq.com>
Co-authored-by: Zhang Aphelios <aphelios.zhang@shopee.com>
Co-authored-by: 龚娜 <2036479155@qq.com>
Co-authored-by: liaochuntao <liaochuntao@live.com>
Co-authored-by: chovychan <51713304+chovychan@users.noreply.github.com>
@dongzl dongzl closed this as completed Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Config center.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants