Commit a1175610 authored by Janoš Guljaš's avatar Janoš Guljaš Committed by GitHub

update openapi specifications (#624)

Co-authored-by: default avatarMetacertain <metacertain@gmail.com>
parent 082629c3
...@@ -36,7 +36,26 @@ paths: ...@@ -36,7 +36,26 @@ paths:
post: post:
summary: 'Upload data' summary: 'Upload data'
tags: tags:
- 'Endpoints on local bee node' - Bytes
parameters:
- in: header
name: swarm-tag-uid
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: false
description: Associate upload with an existing Tag UID
- in: header
name: swarm-pin
schema:
type: boolean
required: false
description: Represents the pinning state of the bytes
- in: header
name: swarm-encrypt
schema:
type: boolean
required: false
description: Represents the encrypting state of the bytes
requestBody: requestBody:
content: content:
application/octet-stream: application/octet-stream:
...@@ -59,7 +78,7 @@ paths: ...@@ -59,7 +78,7 @@ paths:
get: get:
summary: 'Get referenced data' summary: 'Get referenced data'
tags: tags:
- 'Endpoints on local bee node' - Bytes
parameters: parameters:
- in: path - in: path
name: reference name: reference
...@@ -88,7 +107,7 @@ paths: ...@@ -88,7 +107,7 @@ paths:
get: get:
summary: 'Get Chunk' summary: 'Get Chunk'
tags: tags:
- 'Endpoints on local bee node' - Chunk
parameters: parameters:
- in: path - in: path
name: reference name: reference
...@@ -115,14 +134,14 @@ paths: ...@@ -115,14 +134,14 @@ paths:
post: post:
summary: 'Upload Chunk' summary: 'Upload Chunk'
tags: tags:
- 'Endpoints on local bee node' - Chunk
parameters: parameters:
- in: header - in: header
name: swarm-tag-uid name: swarm-tag-uid
schema: schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid' $ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: false required: false
description: Uid of chunk description: Associate upload with an existing Tag UID
- in: header - in: header
name: swarm-pin name: swarm-pin
schema: schema:
...@@ -159,7 +178,7 @@ paths: ...@@ -159,7 +178,7 @@ paths:
post: post:
summary: 'Upload file' summary: 'Upload file'
tags: tags:
- 'Endpoints on local bee node' - File
parameters: parameters:
- in: query - in: query
name: name name: name
...@@ -167,6 +186,24 @@ paths: ...@@ -167,6 +186,24 @@ paths:
$ref: 'SwarmCommon.yaml#/components/schemas/FileName' $ref: 'SwarmCommon.yaml#/components/schemas/FileName'
required: false required: false
description: Filename description: Filename
- in: header
name: swarm-tag-uid
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: false
description: Associate upload with an existing Tag UID
- in: header
name: swarm-pin
schema:
type: boolean
required: false
description: Represents the pinning state of the file
- in: header
name: swarm-encrypt
schema:
type: boolean
required: false
description: Represents the encrypting state of the file
requestBody: requestBody:
content: content:
multipart/form-data: multipart/form-data:
...@@ -199,7 +236,7 @@ paths: ...@@ -199,7 +236,7 @@ paths:
get: get:
summary: 'Get referenced file' summary: 'Get referenced file'
tags: tags:
- 'Endpoints on local bee node' - File
parameters: parameters:
- in: path - in: path
name: reference name: reference
...@@ -224,3 +261,192 @@ paths: ...@@ -224,3 +261,192 @@ paths:
$ref: 'SwarmCommon.yaml#/components/responses/500' $ref: 'SwarmCommon.yaml#/components/responses/500'
default: default:
description: Default response description: Default response
'/dirs':
post:
summary: 'Upload a collection'
tags:
- Collection
parameters:
- in: header
name: swarm-tag-uid
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: false
description: Associate upload with an existing Tag UID
- in: header
name: swarm-pin
schema:
type: boolean
required: false
description: Represents the pinning state of the collection
- in: header
name: swarm-encrypt
schema:
type: boolean
required: false
description: Represents the encrypting state of the collection
requestBody:
content:
application/x-tar:
schema:
type: string
format: binary
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/ReferenceResponse'
'400':
$ref: 'SwarmCommon.yaml#/components/responses/400'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
'/bzz/{reference}/{path}':
get:
summary: 'Get referenced file from a collection of files'
tags:
- Collection
parameters:
- in: path
name: reference
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/SwarmReference'
required: true
description: Swarm address of content
- in: path
name: path
schema:
type: string
required: true
description: Path to the file in the collection.
- in: query
name: targets
schema:
type: string
required: false
description: Global pinning targets prefix
responses:
'200':
description: Ok
content:
application/octet-stream:
schema:
type: string
format: binary
'400':
$ref: 'SwarmCommon.yaml#/components/responses/400'
'404':
$ref: 'SwarmCommon.yaml#/components/responses/404'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
'/tags':
post:
summary: 'Create Tag'
tags:
- Tag
parameters:
- in: query
name: name
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/TagName'
required: true
description: Tagname
responses:
'200':
description: New Tag Info
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/NewTagResponse'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
'/tags/{uid}':
get:
summary: 'Get Tag information using Uid'
tags:
- Tag
parameters:
- in: path
name: uid
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: true
description: Uid
responses:
'200':
description: Tag info
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/NewTagResponse'
'400':
$ref: 'SwarmCommon.yaml#/components/responses/400'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
delete:
summary: 'Delete Tag information using Uid'
tags:
- Tag
parameters:
- in: path
name: uid
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: true
description: Uid
responses:
'204':
$ref: 'SwarmCommon.yaml#/components/responses/204'
'400':
$ref: 'SwarmCommon.yaml#/components/responses/400'
'404':
$ref: 'SwarmCommon.yaml#/components/responses/404'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
patch:
summary: 'Update Total Count and swarm hash for a tag of an input stream of unknown size using Uid'
tags:
- Tag
parameters:
- in: path
name: uid
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: true
description: Uid
requestBody:
description: Can contain swarm hash to use for the tag
required: false
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Address'
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Status'
'404':
$ref: 'SwarmCommon.yaml#/components/responses/404'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
\ No newline at end of file
...@@ -206,7 +206,16 @@ components: ...@@ -206,7 +206,16 @@ components:
Uid: Uid:
type: integer type: integer
WelcomeMessage:
type: object
properties:
welcome_message:
type: string
responses: responses:
'204':
description: The resource was deleted successfully.
'400': '400':
description: Bad request description: Bad request
content: content:
......
...@@ -28,7 +28,7 @@ paths: ...@@ -28,7 +28,7 @@ paths:
get: get:
summary: Get overlay and underlay addresses of the node summary: Get overlay and underlay addresses of the node
tags: tags:
- Swarm Debug Endpoints - Connectivity
responses: responses:
'200': '200':
description: Own node underlay and overlay addresses description: Own node underlay and overlay addresses
...@@ -45,7 +45,7 @@ paths: ...@@ -45,7 +45,7 @@ paths:
get: get:
summary: Get the balances with all known peers summary: Get the balances with all known peers
tags: tags:
- Swarm Debug Endpoints - Balance
responses: responses:
'200': '200':
description: Own balances with all known peers description: Own balances with all known peers
...@@ -62,7 +62,7 @@ paths: ...@@ -62,7 +62,7 @@ paths:
get: get:
summary: Get the balances with a specific peer summary: Get the balances with a specific peer
tags: tags:
- Swarm Debug Endpoints - Balance
parameters: parameters:
- in: path - in: path
name: address name: address
...@@ -88,7 +88,31 @@ paths: ...@@ -88,7 +88,31 @@ paths:
get: get:
summary: Check if chunk at address exists locally summary: Check if chunk at address exists locally
tags: tags:
- Swarm Debug Endpoints - Chunk
parameters:
- in: path
name: address
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/SwarmAddress'
required: true
description: Swarm address of chunk
responses:
'200':
description: Chunk exists
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Response'
'400':
$ref: 'SwarmCommon.yaml#/components/responses/400'
'404':
$ref: 'SwarmCommon.yaml#/components/responses/404'
default:
description: Default response
delete:
summary: Delete a chunk from local storage
tags:
- Chunk
parameters: parameters:
- in: path - in: path
name: address name: address
...@@ -121,7 +145,7 @@ paths: ...@@ -121,7 +145,7 @@ paths:
post: post:
summary: Pin chunk with given address summary: Pin chunk with given address
tags: tags:
- Swarm Debug Endpoints - Chunk pinning
responses: responses:
'200': '200':
description: Pinning chunk with address description: Pinning chunk with address
...@@ -138,7 +162,7 @@ paths: ...@@ -138,7 +162,7 @@ paths:
delete: delete:
summary: Unpin chunk with given address summary: Unpin chunk with given address
tags: tags:
- Swarm Debug Endpoints - Chunk pinning
responses: responses:
'200': '200':
description: Unpinning chunk with address description: Unpinning chunk with address
...@@ -155,7 +179,7 @@ paths: ...@@ -155,7 +179,7 @@ paths:
get: get:
summary: Get pinning status of chunk with given address summary: Get pinning status of chunk with given address
tags: tags:
- Swarm Debug Endpoints - Chunk pinning
responses: responses:
'200': '200':
description: Pinning state of chunk with address description: Pinning state of chunk with address
...@@ -172,7 +196,7 @@ paths: ...@@ -172,7 +196,7 @@ paths:
get: get:
summary: Get list of pinned chunks summary: Get list of pinned chunks
tags: tags:
- Swarm Debug Endpoints - Chunk pinning
responses: responses:
'200': '200':
description: List of pinned chunks description: List of pinned chunks
...@@ -189,7 +213,7 @@ paths: ...@@ -189,7 +213,7 @@ paths:
post: post:
summary: Connect to address summary: Connect to address
tags: tags:
- Swarm Debug Endpoints - Connectivity
parameters: parameters:
- in: path - in: path
allowReserved: true allowReserved: true
...@@ -216,7 +240,7 @@ paths: ...@@ -216,7 +240,7 @@ paths:
get: get:
summary: Get health of node summary: Get health of node
tags: tags:
- Swarm Debug Endpoints - Status
responses: responses:
'200': '200':
description: Health State of node description: Health State of node
...@@ -231,7 +255,7 @@ paths: ...@@ -231,7 +255,7 @@ paths:
get: get:
summary: Get a list of peers summary: Get a list of peers
tags: tags:
- Swarm Debug Endpoints - Connectivity
responses: responses:
'200': '200':
description: Returns overlay addresses of connected peers description: Returns overlay addresses of connected peers
...@@ -246,7 +270,7 @@ paths: ...@@ -246,7 +270,7 @@ paths:
delete: delete:
summary: Remove peer summary: Remove peer
tags: tags:
- Swarm Debug Endpoints - Connectivity
parameters: parameters:
- in: path - in: path
name: address name: address
...@@ -272,7 +296,7 @@ paths: ...@@ -272,7 +296,7 @@ paths:
post: post:
summary: Try connection to node summary: Try connection to node
tags: tags:
- Swarm Debug Endpoints - Connectivity
parameters: parameters:
- in: path - in: path
name: peer-id name: peer-id
...@@ -296,12 +320,11 @@ paths: ...@@ -296,12 +320,11 @@ paths:
default: default:
description: Default response description: Default response
'/readiness': '/readiness':
get: get:
summary: Get readiness state of node summary: Get readiness state of node
tags: tags:
- Swarm Debug Endpoints - Status
responses: responses:
'200': '200':
description: Health State of node description: Health State of node
...@@ -312,67 +335,54 @@ paths: ...@@ -312,67 +335,54 @@ paths:
default: default:
description: Default response description: Default response
'/tags': '/topology':
post: get:
summary: 'Create Tag' description: Get topology of known network
tags: tags:
- Swarm Debug Endpoints - Connectivity
parameters:
- in: query
name: name
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/TagName'
required: true
description: Tagname
responses: responses:
'200': '200':
description: New Tag Info description: Swarm topology of the bee node
content: content:
application/json: application/json:
schema: schema:
$ref: 'SwarmCommon.yaml#/components/schemas/NewTagResponse' $ref: 'SwarmCommon.yaml#/components/schemas/BzzTopology'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
'/tags/{uid}': '/welcome-message':
get: get:
summary: 'Get Tag information using Uid' summary: Get configured P2P welcome message
tags: tags:
- Swarm Debug Endpoints - Connectivity
parameters:
- in: path
name: uid
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: true
description: Uid
responses: responses:
'200': '200':
description: Tag info description: Welcome message
content: content:
application/json: application/json:
schema: schema:
$ref: 'SwarmCommon.yaml#/components/schemas/NewTagResponse' $ref: 'SwarmCommon.yaml#/components/schemas/WelcomeMessage'
'400':
$ref: 'SwarmCommon.yaml#/components/responses/400'
'500': '500':
$ref: 'SwarmCommon.yaml#/components/responses/500' $ref: 'SwarmCommon.yaml#/components/responses/500'
default: default:
description: Default response description: Default response
post:
'/topology': summary: Set P2P welcome message
get:
description: Get topology of known network
tags: tags:
- Swarm Debug Endpoints - Connectivity
requestBody:
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/WelcomeMessage'
responses: responses:
'200': '200':
description: Swarm topology of the bee node description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: 'SwarmCommon.yaml#/components/schemas/BzzTopology' $ref: 'SwarmCommon.yaml#/components/schemas/Status'
'400':
$ref: 'SwarmCommon.yaml#/components/responses/400'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment