Commit 6fb789fd authored by Pavle Batuta's avatar Pavle Batuta Committed by GitHub

Update openapi definitions for debugapi /settlements/ and /chequebook/ endpoints (#757)

Co-authored-by: default avatarMetacertain <metacertain@gmail.com>
parent 7060397e
...@@ -117,6 +117,20 @@ components: ...@@ -117,6 +117,20 @@ components:
lastsent: lastsent:
$ref: '#/components/schemas/Cheque' $ref: '#/components/schemas/Cheque'
ChequebookBalance:
type: object
properties:
totalBalance:
type: integer
availableBalance:
type: integer
ChequebookAddress:
type: object
properties:
address:
$ref: '#/components/schemas/EthereumAddress'
DateTime: DateTime:
type: string type: string
format: date-time format: date-time
...@@ -220,6 +234,28 @@ components: ...@@ -220,6 +234,28 @@ components:
status: status:
type: string type: string
Settlement:
type: object
properties:
peer:
$ref: "#/components/schemas/SwarmAddress"
received:
type: integer
sent:
type: integer
Settlements:
type: object
properties:
totalreceived:
type: integer
totalsent:
type: integer
settlements:
type: array
items:
$ref: '#/components/schemas/Settlement'
SwarmAddress: SwarmAddress:
type: string type: string
pattern: '^[A-Fa-f0-9]{64}$' pattern: '^[A-Fa-f0-9]{64}$'
......
...@@ -2,9 +2,7 @@ openapi: 3.0.0 ...@@ -2,9 +2,7 @@ openapi: 3.0.0
info: info:
version: 0.1.0 version: 0.1.0
title: Bee Debug API title: Bee Debug API
description: >- description: 'A list of the currently provided debug interfaces to interact with the bee node'
A list of the currently provided debug interfaces to interact with the bee
node
security: security:
- {} - {}
...@@ -14,6 +12,7 @@ externalDocs: ...@@ -14,6 +12,7 @@ externalDocs:
url: 'https://docs.swarm.eth' url: 'https://docs.swarm.eth'
servers: servers:
- url: 'http://{apiRoot}:{port}' - url: 'http://{apiRoot}:{port}'
variables: variables:
apiRoot: apiRoot:
...@@ -84,6 +83,36 @@ paths: ...@@ -84,6 +83,36 @@ paths:
default: default:
description: Default response description: Default response
'/chequebook/address':
get:
summary: Get the address of the chequebook contract used
tags:
- Chequebook
responses:
'200':
description: Ethereum address of chequebook contract
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/ChequebookAddress'
'/chequebook/balance':
get:
summary: Get the balance of the chequebook
tags:
- Chequebook
responses:
'200':
description: Balance of the chequebook
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/ChequebookBalance'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
'/chunks/{address}': '/chunks/{address}':
get: get:
summary: Check if chunk at address exists locally summary: Check if chunk at address exists locally
...@@ -260,6 +289,49 @@ paths: ...@@ -260,6 +289,49 @@ paths:
default: default:
description: Default response description: Default response
'/settlements/{address}':
get:
summary: Get amount of sent and received from settlements with a peer
tags:
- Settlements
parameters:
- in: path
name: address
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/SwarmAddress'
required: true
description: Swarm address of peer
responses:
'200':
description: Amount of sent or received from settlements with a peer
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Settlement'
'404':
$ref: 'SwarmCommon.yaml#/components/responses/404'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
'/settlements':
get:
summary: Get settlements with all known peers and total amount sent or received
tags:
- Settlements
responses:
'200':
description: Settlements with all known peers and total amount sent or received
content:
application/json:
schema:
$ref: 'SwarmCommon.yaml#/components/schemas/Settlements'
'500':
$ref: 'SwarmCommon.yaml#/components/responses/500'
default:
description: Default response
'/topology': '/topology':
get: get:
description: Get topology of known network description: Get topology of known network
......
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