123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- # Copyright IBM Corp, All Rights Reserved.
- #
- # SPDX-License-Identifier: Apache-2.0
- #
- # this is an example of the Cello API
- # as a demonstration of an API spec in YAML
- swagger: '2.0'
- info:
- title: Cello API
- description: Cello API to manage cluster
- contact:
- name: Baohua Yang
- url: https://github.com/yeasy/cello
- email: yangbaohua@gmail.com
- license:
- name: Apache 2.0
- url: http://www.apache.org/licenses/LICENSE-2.0.html
- version: "1.0.0"
- # the domain of the service
- host: 9.186.100.88:80
- # array of all schemes that your API supports
- schemes:
- - http
- # will be prefixed to all paths
- basePath: /admin
- produces:
- - application/json
- paths:
- /clusters:
- get:
- summary: A list of all clusters
- description: |
- The Clusters endpoint returns information about all existing clusters.
- The response includes the display name
- and other details about each cluster, and lists the clusters in the
- proper display order.
- parameters:
- - name: worker_api
- in: query
- description: Filter clusters with specific worker_api.
- required: false
- type: string
- - name: user_id
- in: query
- description: Filter clusters with specific user_id.
- required: false
- type: string
- tags:
- - Clusters
- responses:
- 200:
- description: An array of clusters
- schema:
- type: array
- items:
- $ref: '#/definitions/Cluster'
- default:
- description: Unexpected error
- schema:
- $ref: '#/definitions/Error'
- /cluster:
- get:
- summary: Retrieve a special cluster
- description: |
- The endpoint returns information about specific cluster.
- The response includes necessary info.
- parameters:
- - name: cluster_id
- in: query
- description: Filter clusters with specific cluster_id.
- required: true
- type: string
- tags:
- - Cluster
- responses:
- 200:
- description: A cluster instance
- schema:
- $ref: '#/definitions/Cluster'
- default:
- description: Unexpected error
- schema:
- $ref: '#/definitions/Error'
- post:
- summary: Create a special cluster
- description: |
- The endpoint create a specific cluster
- The response includes necessary info.
- parameters:
- - name: worker_api
- in: query
- description: Given the worker_api to create at
- required: true
- type: string
- - name: cluster_name
- in: query
- description: Given the name
- required: false
- type: string
- tags:
- - Cluster
- responses:
- 200:
- description: A cluster instance created
- schema:
- $ref: '#/definitions/Cluster'
- default:
- description: Unexpected error
- schema:
- $ref: '#/definitions/Error'
- delete:
- summary: Delete a special cluster
- description: |
- The endpoint deletes a specific cluster
- The response includes necessary info.
- parameters:
- - name: cluster_id
- in: query
- description: Filter clusters with specific cluster_id.
- required: true
- type: string
- tags:
- - Cluster
- responses:
- 200:
- description: A cluster instance delete info
- type: string (TODO)
- default:
- description: Unexpected error
- schema:
- $ref: '#/definitions/Error'
- definitions:
- Cluster:
- type: object
- required: [id, user_id, api_url]
- properties:
- id:
- type: string
- description: Unique identifier representing a specific cluster.
- user_id:
- type: string
- description: User id who owns this cluster, empty by default
- api_url:
- type: string
- description: Cluster REST URL representing the cluster.
- worker_api:
- type: string
- description: Docker host daemon url
- name:
- type: string
- description: Display name of cluster.
- Error:
- type: object
- required: [code]
- properties:
- code:
- type: integer
- format: int32
- message:
- type: string
- fields:
- type: string
|