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:
lastsent:
$ref: '#/components/schemas/Cheque'
ChequebookBalance:
type: object
properties:
totalBalance:
type: integer
availableBalance:
type: integer
ChequebookAddress:
type: object
properties:
address:
$ref: '#/components/schemas/EthereumAddress'
DateTime:
type: string
format: date-time
......@@ -220,6 +234,28 @@ components:
status:
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:
type: string
pattern: '^[A-Fa-f0-9]{64}$'
......
......@@ -2,9 +2,7 @@ openapi: 3.0.0
info:
version: 0.1.0
title: Bee Debug API
description: >-
A list of the currently provided debug interfaces to interact with the bee
node
description: 'A list of the currently provided debug interfaces to interact with the bee node'
security:
- {}
......@@ -14,6 +12,7 @@ externalDocs:
url: 'https://docs.swarm.eth'
servers:
- url: 'http://{apiRoot}:{port}'
variables:
apiRoot:
......@@ -84,6 +83,36 @@ paths:
default:
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}':
get:
summary: Check if chunk at address exists locally
......@@ -260,6 +289,49 @@ paths:
default:
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':
get:
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