123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- openapi: 3.0.3
- info:
- title: Storage node API
- description: Storage node API
- contact:
- email: info@joystream.org
- license:
- name: MIT
- url: https://opensource.org/licenses/MIT
- version: 0.1.0
- externalDocs:
- description: Storage node API
- url: https://github.com/Joystream/joystream/issues/2224
- servers:
- - url: http://localhost:3333/api/v1/
- tags:
- - name: public
- description: Public storage node API
- paths:
- /files/{cid}:
- get:
- operationId: publicApi.files
- description: Returns a media file.
- tags:
- - public
- parameters:
- - name: cid
- required: true
- in: path
- description: Content ID
- schema:
- type: string
- responses:
- 200:
- description: Ok
- content:
- image/*:
- schema:
- type: string
- format: binary
- audio/*:
- schema:
- type: string
- format: binary
- video/*:
- schema:
- type: string
- format: binary
- 404:
- description: File not found
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- 410:
- description: File request problem
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- /upload:
- post:
- security:
- - UploadAuth: []
- description: Upload data
- operationId: publicApi.upload
- tags:
- - public
- requestBody:
- content:
- multipart/form-data:
- schema:
- type: object
- required:
- - dataObjectId
- - storageBucketId
- - bagId
- properties:
- file:
- description: Data file
- type: string
- format: binary
- dataObjectId:
- description: Data object runtime ID
- type: string
- pattern: '^\d+$' #integer
- storageBucketId:
- description: Storage bucket ID
- type: string
- pattern: '^\d+$' #integer
- bagId:
- description: Bag ID
- type: string
- required: true
- responses:
- 201:
- description: Created
- content:
- application/json:
- schema:
- type: object
- properties:
- status:
- type: string
- 401:
- description: Unauthorized
- 410:
- description: Upload request problem
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- /authToken:
- post:
- description: Get auth token from a server.
- operationId: publicApi.authToken
- tags:
- - public
- requestBody:
- description: Token request parameters,
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TokenRequest'
- responses:
- 201:
- description: Created
- content:
- application/json:
- schema:
- type: object
- properties:
- token:
- type: string
- 400:
- description: Bad request
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- 410:
- description: AuthToken request problem
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- components:
- securitySchemes:
- UploadAuth:
- type: apiKey
- in: header
- name: x-api-key
- schemas:
- TokenRequest:
- type: object
- required:
- - data
- - signature
- properties:
- data:
- type: object
- required:
- - memberId
- - accountId
- - dataObjectId
- - storageBucketId
- - bagId
- properties:
- memberId:
- type: integer
- format: int64
- accountId:
- type: string
- dataObjectId:
- type: integer
- format: int64
- storageBucketId:
- type: integer
- format: int64
- bagId:
- type: string
- signature:
- type: string
- ErrorResponse:
- type: object
- required:
- - message
- properties:
- type:
- type: string
- message:
- type: string
|