swagger.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. paths:
  2. /collections:
  3. get:
  4. tags:
  5. - Collection
  6. description: Get all or loaded collection
  7. parameters:
  8. - in: query
  9. name: type
  10. type: number
  11. description: If type is 1 return loaded collections, otherwise return all collections.
  12. responses:
  13. 200:
  14. description: CollectionList
  15. schema:
  16. type: object
  17. post:
  18. tags:
  19. - Collection
  20. description: Create collection in milvus
  21. requestBody:
  22. description: Create collection request body
  23. required: true
  24. content:
  25. application/json:
  26. schema:
  27. $ref: '#/definitions/CreateCollection'
  28. responses:
  29. 200:
  30. schema:
  31. type: object
  32. /collections/statistics:
  33. get:
  34. tags:
  35. - Collection
  36. description: Get all collections statistics like row count
  37. responses:
  38. 200:
  39. schema:
  40. type: object
  41. /collections/{name}/statistics:
  42. get:
  43. tags:
  44. - Collection
  45. description: Get single collection statistics like row count
  46. parameters:
  47. - $ref: '#/definitions/CollectionName'
  48. responses:
  49. 200:
  50. schema:
  51. type: object
  52. /collections/indexes/status:
  53. get:
  54. tags:
  55. - Collection
  56. description: Get all collections index status
  57. responses:
  58. 200:
  59. schema:
  60. type: object
  61. /collections/{name}:
  62. delete:
  63. tags:
  64. - Collection
  65. description: Delete collection by name
  66. parameters:
  67. - $ref: '#/definitions/CollectionName'
  68. responses:
  69. 200:
  70. schema:
  71. type: object
  72. get:
  73. tags:
  74. - Collection
  75. description: Get single collection informations like schema, name, id
  76. parameters:
  77. - $ref: '#/definitions/CollectionName'
  78. responses:
  79. 200:
  80. schema:
  81. type: object
  82. /collections/{name}/load:
  83. put:
  84. tags:
  85. - Collection
  86. description: Load data to cache
  87. parameters:
  88. - $ref: '#/definitions/CollectionName'
  89. responses:
  90. 200:
  91. schema:
  92. type: object
  93. /collections/{name}/release:
  94. put:
  95. tags:
  96. - Collection
  97. description: Release data from cache
  98. parameters:
  99. - $ref: '#/definitions/CollectionName'
  100. responses:
  101. 200:
  102. schema:
  103. type: object
  104. /collections/{name}/insert:
  105. post:
  106. tags:
  107. - Collection
  108. description: Insert data into collection
  109. parameters:
  110. - $ref: '#/definitions/CollectionName'
  111. requestBody:
  112. description: Insert data into collection
  113. required: true
  114. content:
  115. application/json:
  116. schema:
  117. $ref: '#/definitions/Insert'
  118. responses:
  119. 200:
  120. schema:
  121. type: object
  122. /collections/{name}/search:
  123. post:
  124. tags:
  125. - Collection
  126. description: Vector search
  127. parameters:
  128. - $ref: '#/definitions/CollectionName'
  129. requestBody:
  130. description: Do vector search
  131. required: true
  132. content:
  133. application/json:
  134. schema:
  135. $ref: '#/definitions/Search'
  136. responses:
  137. 200:
  138. schema:
  139. type: object
  140. /collections/{name}/query:
  141. post:
  142. tags:
  143. - Collection
  144. description: query data
  145. parameters:
  146. - $ref: '#/definitions/CollectionName'
  147. requestBody:
  148. description: query data body
  149. required: true
  150. content:
  151. application/json:
  152. schema:
  153. type: object
  154. required:
  155. - "expr"
  156. properties:
  157. expr:
  158. type: string
  159. example: id in [1]
  160. responses:
  161. 200:
  162. schema:
  163. type: object
  164. /collections/{name}/alias:
  165. post:
  166. tags:
  167. - Collection
  168. description: Create alias for collection
  169. parameters:
  170. - $ref: '#/definitions/CollectionName'
  171. requestBody:
  172. description: alias name
  173. required: true
  174. content:
  175. application/json:
  176. schema:
  177. type: object
  178. required:
  179. - "alias"
  180. properties:
  181. alias:
  182. type: string
  183. example: collection_alias
  184. responses:
  185. 200:
  186. schema:
  187. type: object
  188. definitions:
  189. CollectionName:
  190. in: path
  191. name: name
  192. type: string
  193. description: Collection name
  194. CreateCollection:
  195. type: object
  196. required:
  197. - "collection_name"
  198. - "fields"
  199. properties:
  200. collection_name:
  201. type: string
  202. example: collection_01
  203. fields:
  204. type: array
  205. example: []
  206. Insert:
  207. type: object
  208. required:
  209. - "fields_data"
  210. properties:
  211. partition_name:
  212. type: string
  213. example: _default
  214. fields_data:
  215. type: array
  216. example: []
  217. hash_keys:
  218. type: array
  219. example: []
  220. Search:
  221. type: object
  222. required:
  223. - "vectors"
  224. - "vector_type"
  225. - "search_params"
  226. properties:
  227. vectors:
  228. type: array
  229. example: []
  230. vector_type:
  231. description: BinaryVector - 100 , FloatVector - 101
  232. type: number
  233. example: 100
  234. search_params:
  235. type: object
  236. example: {"anns_field":"","topk":10,"metric_type":"L2","params":""}