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:
post:
summary: 'Upload data'
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:
content:
application/octet-stream:
......@@ -59,7 +78,7 @@ paths:
get:
summary: 'Get referenced data'
tags:
- 'Endpoints on local bee node'
- Bytes
parameters:
- in: path
name: reference
......@@ -88,7 +107,7 @@ paths:
get:
summary: 'Get Chunk'
tags:
- 'Endpoints on local bee node'
- Chunk
parameters:
- in: path
name: reference
......@@ -115,14 +134,14 @@ paths:
post:
summary: 'Upload Chunk'
tags:
- 'Endpoints on local bee node'
- Chunk
parameters:
- in: header
name: swarm-tag-uid
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: false
description: Uid of chunk
description: Associate upload with an existing Tag UID
- in: header
name: swarm-pin
schema:
......@@ -159,7 +178,7 @@ paths:
post:
summary: 'Upload file'
tags:
- 'Endpoints on local bee node'
- File
parameters:
- in: query
name: name
......@@ -167,6 +186,24 @@ paths:
$ref: 'SwarmCommon.yaml#/components/schemas/FileName'
required: false
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:
content:
multipart/form-data:
......@@ -199,7 +236,7 @@ paths:
get:
summary: 'Get referenced file'
tags:
- 'Endpoints on local bee node'
- File
parameters:
- in: path
name: reference
......@@ -224,3 +261,192 @@ paths:
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
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:
Uid:
type: integer
WelcomeMessage:
type: object
properties:
welcome_message:
type: string
responses:
'204':
description: The resource was deleted successfully.
'400':
description: Bad request
content:
......
......@@ -28,7 +28,7 @@ paths:
get:
summary: Get overlay and underlay addresses of the node
tags:
- Swarm Debug Endpoints
- Connectivity
responses:
'200':
description: Own node underlay and overlay addresses
......@@ -45,7 +45,7 @@ paths:
get:
summary: Get the balances with all known peers
tags:
- Swarm Debug Endpoints
- Balance
responses:
'200':
description: Own balances with all known peers
......@@ -62,7 +62,7 @@ paths:
get:
summary: Get the balances with a specific peer
tags:
- Swarm Debug Endpoints
- Balance
parameters:
- in: path
name: address
......@@ -88,7 +88,31 @@ paths:
get:
summary: Check if chunk at address exists locally
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:
- in: path
name: address
......@@ -121,7 +145,7 @@ paths:
post:
summary: Pin chunk with given address
tags:
- Swarm Debug Endpoints
- Chunk pinning
responses:
'200':
description: Pinning chunk with address
......@@ -138,7 +162,7 @@ paths:
delete:
summary: Unpin chunk with given address
tags:
- Swarm Debug Endpoints
- Chunk pinning
responses:
'200':
description: Unpinning chunk with address
......@@ -155,7 +179,7 @@ paths:
get:
summary: Get pinning status of chunk with given address
tags:
- Swarm Debug Endpoints
- Chunk pinning
responses:
'200':
description: Pinning state of chunk with address
......@@ -172,7 +196,7 @@ paths:
get:
summary: Get list of pinned chunks
tags:
- Swarm Debug Endpoints
- Chunk pinning
responses:
'200':
description: List of pinned chunks
......@@ -189,7 +213,7 @@ paths:
post:
summary: Connect to address
tags:
- Swarm Debug Endpoints
- Connectivity
parameters:
- in: path
allowReserved: true
......@@ -216,7 +240,7 @@ paths:
get:
summary: Get health of node
tags:
- Swarm Debug Endpoints
- Status
responses:
'200':
description: Health State of node
......@@ -231,7 +255,7 @@ paths:
get:
summary: Get a list of peers
tags:
- Swarm Debug Endpoints
- Connectivity
responses:
'200':
description: Returns overlay addresses of connected peers
......@@ -246,7 +270,7 @@ paths:
delete:
summary: Remove peer
tags:
- Swarm Debug Endpoints
- Connectivity
parameters:
- in: path
name: address
......@@ -272,7 +296,7 @@ paths:
post:
summary: Try connection to node
tags:
- Swarm Debug Endpoints
- Connectivity
parameters:
- in: path
name: peer-id
......@@ -296,12 +320,11 @@ paths:
default:
description: Default response
'/readiness':
get:
summary: Get readiness state of node
tags:
- Swarm Debug Endpoints
- Status
responses:
'200':
description: Health State of node
......@@ -312,67 +335,54 @@ paths:
default:
description: Default response
'/tags':
post:
summary: 'Create Tag'
'/topology':
get:
description: Get topology of known network
tags:
- Swarm Debug Endpoints
parameters:
- in: query
name: name
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/TagName'
required: true
description: Tagname
- Connectivity
responses:
'200':
description: New Tag Info
description: Swarm topology of the bee node
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/NewTagResponse'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
$ref: 'SwarmCommon.yaml#/components/schemas/BzzTopology'
'/tags/{uid}':
'/welcome-message':
get:
summary: 'Get Tag information using Uid'
summary: Get configured P2P welcome message
tags:
- Swarm Debug Endpoints
parameters:
- in: path
name: uid
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Uid'
required: true
description: Uid
- Connectivity
responses:
'200':
description: Tag info
description: Welcome message
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/NewTagResponse'
'400':
$ref: 'SwarmCommon.yaml#/components/responses/400'
$ref: 'SwarmCommon.yaml#/components/schemas/WelcomeMessage'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
'/topology':
get:
description: Get topology of known network
post:
summary: Set P2P welcome message
tags:
- Swarm Debug Endpoints
- Connectivity
requestBody:
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/WelcomeMessage'
responses:
'200':
description: Swarm topology of the bee node
description: OK
content:
application/json:
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