openapi.yaml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. openapi: 3.0.3
  2. info:
  3. title: Storage node API
  4. description: Storage node API
  5. contact:
  6. email: info@joystream.org
  7. license:
  8. name: MIT
  9. url: https://opensource.org/licenses/MIT
  10. version: 0.1.0
  11. externalDocs:
  12. description: Storage node API
  13. url: https://github.com/Joystream/joystream/issues/2224
  14. servers:
  15. - url: http://localhost:3333/api/v1/
  16. tags:
  17. - name: public
  18. description: Public storage node API
  19. paths:
  20. /files/{cid}:
  21. get:
  22. operationId: publicApi.files
  23. description: Returns a media file.
  24. tags:
  25. - public
  26. parameters:
  27. - name: cid
  28. required: true
  29. in: path
  30. description: Content ID
  31. schema:
  32. type: string
  33. responses:
  34. 200:
  35. description: Ok
  36. content:
  37. image/*:
  38. schema:
  39. type: string
  40. format: binary
  41. audio/*:
  42. schema:
  43. type: string
  44. format: binary
  45. video/*:
  46. schema:
  47. type: string
  48. format: binary
  49. 404:
  50. description: File not found
  51. content:
  52. application/json:
  53. schema:
  54. $ref: '#/components/schemas/ErrorResponse'
  55. 410:
  56. description: File request problem
  57. content:
  58. application/json:
  59. schema:
  60. $ref: '#/components/schemas/ErrorResponse'
  61. /upload:
  62. post:
  63. security:
  64. - UploadAuth: []
  65. description: Upload data
  66. operationId: publicApi.upload
  67. tags:
  68. - public
  69. requestBody:
  70. content:
  71. multipart/form-data:
  72. schema:
  73. type: object
  74. required:
  75. - dataObjectId
  76. - storageBucketId
  77. - bagId
  78. properties:
  79. file:
  80. description: Data file
  81. type: string
  82. format: binary
  83. dataObjectId:
  84. description: Data object runtime ID
  85. type: string
  86. pattern: '^\d+$' #integer
  87. storageBucketId:
  88. description: Storage bucket ID
  89. type: string
  90. pattern: '^\d+$' #integer
  91. bagId:
  92. description: Bag ID
  93. type: string
  94. required: true
  95. responses:
  96. 201:
  97. description: Created
  98. content:
  99. application/json:
  100. schema:
  101. type: object
  102. properties:
  103. status:
  104. type: string
  105. 401:
  106. description: Unauthorized
  107. 410:
  108. description: Upload request problem
  109. content:
  110. application/json:
  111. schema:
  112. $ref: '#/components/schemas/ErrorResponse'
  113. /authToken:
  114. post:
  115. description: Get auth token from a server.
  116. operationId: publicApi.authToken
  117. tags:
  118. - public
  119. requestBody:
  120. description: Token request parameters,
  121. content:
  122. application/json:
  123. schema:
  124. $ref: '#/components/schemas/TokenRequest'
  125. responses:
  126. 201:
  127. description: Created
  128. content:
  129. application/json:
  130. schema:
  131. type: object
  132. properties:
  133. token:
  134. type: string
  135. 400:
  136. description: Bad request
  137. content:
  138. application/json:
  139. schema:
  140. $ref: '#/components/schemas/ErrorResponse'
  141. 410:
  142. description: AuthToken request problem
  143. content:
  144. application/json:
  145. schema:
  146. $ref: '#/components/schemas/ErrorResponse'
  147. components:
  148. securitySchemes:
  149. UploadAuth:
  150. type: apiKey
  151. in: header
  152. name: x-api-key
  153. schemas:
  154. TokenRequest:
  155. type: object
  156. required:
  157. - data
  158. - signature
  159. properties:
  160. data:
  161. type: object
  162. required:
  163. - memberId
  164. - accountId
  165. - dataObjectId
  166. - storageBucketId
  167. - bagId
  168. properties:
  169. memberId:
  170. type: integer
  171. format: int64
  172. accountId:
  173. type: string
  174. dataObjectId:
  175. type: integer
  176. format: int64
  177. storageBucketId:
  178. type: integer
  179. format: int64
  180. bagId:
  181. type: string
  182. signature:
  183. type: string
  184. ErrorResponse:
  185. type: object
  186. required:
  187. - message
  188. properties:
  189. type:
  190. type: string
  191. message:
  192. type: string