123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- openapi: 3.0.3
- info:
- title: Storage node API
- description: Storage node API
- contact:
- email: info@joystream.org
- license:
- name: GPL-3.0-only
- url: https://opensource.org/licenses/GPL-3.0
- 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: files
- description: Storage node Files API
- - name: state
- description: Storage node State API
- paths:
- /files/{id}:
- get:
- operationId: filesApi.getFile
- description: Returns a media file.
- tags:
- - files
- parameters:
- - name: id
- required: true
- in: path
- description: Data object ID
- schema:
- type: string
- responses:
- 200:
- description: Ok
- content:
- video/*:
- schema:
- type: string
- format: binary
- audio/*:
- schema:
- type: string
- format: binary
- image/*:
- schema:
- type: string
- format: binary
- application/octet-stream:
- schema:
- type: string
- format: binary
- 400:
- description: Bad request
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- 401:
- description: Unauthorized
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- 404:
- description: File not found
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- 500:
- description: Unknown server error
- head:
- operationId: filesApi.getFileHeaders
- description: Returns a media file headers.
- tags:
- - files
- parameters:
- - name: id
- required: true
- in: path
- description: Data object ID
- schema:
- type: string
- responses:
- 200:
- description: Ok
- 400:
- description: Bad request
- 404:
- description: File not found
- 500:
- description: Unknown server error
- /files:
- post:
- description: Upload data
- operationId: filesApi.uploadFile
- tags:
- - files
- 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:
- id:
- type: string
- 400:
- description: Bad request
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- /state/data-objects:
- get:
- operationId: stateApi.getAllLocalDataObjects
- description: Returns all local data objects.
- tags:
- - state
- responses:
- 200:
- description: Ok
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DataObjectResponse'
- /state/bags/{bagId}/data-objects:
- get:
- operationId: stateApi.getLocalDataObjectsByBagId
- description: Returns local data objects for the bag.
- tags:
- - state
- parameters:
- - name: bagId
- required: true
- in: path
- description: Bag ID
- schema:
- type: string
- responses:
- 200:
- description: Ok
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DataObjectResponse'
- /version:
- get:
- operationId: stateApi.getVersion
- description: Returns server version.
- tags:
- - state
- responses:
- 200:
- description: Ok
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/VersionResponse'
- /state/data:
- get:
- operationId: stateApi.getLocalDataStats
- description: Returns local uploading directory stats.
- tags:
- - state
- responses:
- 200:
- description: Ok
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DataStatsResponse'
- components:
- 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
- DataStatsResponse:
- type: object
- required:
- - totalSize
- - objectNumber
- properties:
- totalSize:
- type: integer
- format: int64
- objectNumber:
- type: integer
- format: int64
- tempDirSize:
- type: integer
- format: int64
- tempDownloads:
- type: integer
- format: int64
- VersionResponse:
- type: object
- required:
- - version
- properties:
- version:
- type: string
- userAgent:
- type: string
- DataObjectResponse:
- type: array
- items:
- type: string
|