operator_dashboard.yaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # Copyright IBM Corp, All Rights Reserved.
  2. #
  3. # SPDX-License-Identifier: Apache-2.0
  4. #
  5. # this is an example of the Cello API
  6. # as a demonstration of an API spec in YAML
  7. swagger: '2.0'
  8. info:
  9. title: Cello API
  10. description: Cello API to manage cluster
  11. contact:
  12. name: Baohua Yang
  13. url: https://github.com/yeasy/cello
  14. email: yangbaohua@gmail.com
  15. license:
  16. name: Apache 2.0
  17. url: http://www.apache.org/licenses/LICENSE-2.0.html
  18. version: "1.0.0"
  19. # the domain of the service
  20. host: 9.186.100.88:80
  21. # array of all schemes that your API supports
  22. schemes:
  23. - http
  24. # will be prefixed to all paths
  25. basePath: /admin
  26. produces:
  27. - application/json
  28. paths:
  29. /clusters:
  30. get:
  31. summary: A list of all clusters
  32. description: |
  33. The Clusters endpoint returns information about all existing clusters.
  34. The response includes the display name
  35. and other details about each cluster, and lists the clusters in the
  36. proper display order.
  37. parameters:
  38. - name: worker_api
  39. in: query
  40. description: Filter clusters with specific worker_api.
  41. required: false
  42. type: string
  43. - name: user_id
  44. in: query
  45. description: Filter clusters with specific user_id.
  46. required: false
  47. type: string
  48. tags:
  49. - Clusters
  50. responses:
  51. 200:
  52. description: An array of clusters
  53. schema:
  54. type: array
  55. items:
  56. $ref: '#/definitions/Cluster'
  57. default:
  58. description: Unexpected error
  59. schema:
  60. $ref: '#/definitions/Error'
  61. /cluster:
  62. get:
  63. summary: Retrieve a special cluster
  64. description: |
  65. The endpoint returns information about specific cluster.
  66. The response includes necessary info.
  67. parameters:
  68. - name: cluster_id
  69. in: query
  70. description: Filter clusters with specific cluster_id.
  71. required: true
  72. type: string
  73. tags:
  74. - Cluster
  75. responses:
  76. 200:
  77. description: A cluster instance
  78. schema:
  79. $ref: '#/definitions/Cluster'
  80. default:
  81. description: Unexpected error
  82. schema:
  83. $ref: '#/definitions/Error'
  84. post:
  85. summary: Create a special cluster
  86. description: |
  87. The endpoint create a specific cluster
  88. The response includes necessary info.
  89. parameters:
  90. - name: worker_api
  91. in: query
  92. description: Given the worker_api to create at
  93. required: true
  94. type: string
  95. - name: cluster_name
  96. in: query
  97. description: Given the name
  98. required: false
  99. type: string
  100. tags:
  101. - Cluster
  102. responses:
  103. 200:
  104. description: A cluster instance created
  105. schema:
  106. $ref: '#/definitions/Cluster'
  107. default:
  108. description: Unexpected error
  109. schema:
  110. $ref: '#/definitions/Error'
  111. delete:
  112. summary: Delete a special cluster
  113. description: |
  114. The endpoint deletes a specific cluster
  115. The response includes necessary info.
  116. parameters:
  117. - name: cluster_id
  118. in: query
  119. description: Filter clusters with specific cluster_id.
  120. required: true
  121. type: string
  122. tags:
  123. - Cluster
  124. responses:
  125. 200:
  126. description: A cluster instance delete info
  127. type: string (TODO)
  128. default:
  129. description: Unexpected error
  130. schema:
  131. $ref: '#/definitions/Error'
  132. definitions:
  133. Cluster:
  134. type: object
  135. required: [id, user_id, api_url]
  136. properties:
  137. id:
  138. type: string
  139. description: Unique identifier representing a specific cluster.
  140. user_id:
  141. type: string
  142. description: User id who owns this cluster, empty by default
  143. api_url:
  144. type: string
  145. description: Cluster REST URL representing the cluster.
  146. worker_api:
  147. type: string
  148. description: Docker host daemon url
  149. name:
  150. type: string
  151. description: Display name of cluster.
  152. Error:
  153. type: object
  154. required: [code]
  155. properties:
  156. code:
  157. type: integer
  158. format: int32
  159. message:
  160. type: string
  161. fields:
  162. type: string