Browse Source

Add unsafe routes to swagger (#4062)

* Add unsafe routes to swagger

- added `/dial_peers` & `dial_seeds` to swagger docs under unsafe tag

closes #4047

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* address comments

* Apply suggestions from code review

* fix swagger
pull/4068/head
Marko 5 years ago
committed by GitHub
parent
commit
32bafcb38c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 81 additions and 0 deletions
  1. +81
    -0
      rpc/swagger/swagger.yaml

+ 81
- 0
rpc/swagger/swagger.yaml View File

@ -409,6 +409,62 @@ paths:
description: empty error
schema:
$ref: "#/definitions/ErrorResponse"
/dial_seeds:
post:
summary: Dial Seeds (Unsafe)
operationId: dial_seeds
tags:
- unsafe
description: |
Dial a peer, this route in under unsafe, and has to manually enabled to use
consumes:
- application/json
parameters:
- description: string of possible peers
in: body
name: Array of peers to connect to
required: true
schema:
$ref: "#/definitions/dialSeedsPost"
produces:
- application/json
responses:
200:
description: Dialing seeds in progress. See /net_info for details
schema:
$ref: "#/definitions/dialResp"
500:
description: empty error
schema:
$ref: "#/definitions/ErrorResponse"
/dial_peers:
post:
summary: Add Peers/Persistent Peers (unsafe)
operationId: dial_peers
tags:
- unsafe
description: |
Set a persistent peer, this route in under unsafe, and has to manually enabled to use
consumes:
- application/json
parameters:
- description: string of possible peers, bool argument if they should be added as persistent
in: body
name: Array of peers to connect to & if they should be persistent
required: true
schema:
$ref: "#/definitions/dialPeersPost"
produces:
- application/json
responses:
200:
description: Dialing seeds in progress. See /net_info for details
schema:
$ref: "#/definitions/dialResp"
500:
description: empty error
schema:
$ref: "#/definitions/ErrorResponse"
/blockchain:
get:
summary: Get block headers for minHeight <= height <= maxHeight.
@ -2675,3 +2731,28 @@ definitions:
error:
type: "string"
example: ""
dialPeersPost:
type: object
properties:
Persistent:
type: boolean
example: false
Peers:
type: array
items:
type: "string"
example: ["6f172048b821e3b1ab98ffb0973ba737966eecf8@192.168.1.2:26656"]
dialSeedsPost:
type: object
properties:
Peers:
type: array
items:
type: "string"
example: ["6f172048b821e3b1ab98ffb0973ba737966eecf8@192.168.1.2:26656"]
dialResp:
type: object
properties:
Log:
type: string
x-example: "Dialing seeds in progress. See /net_info for details"

Loading…
Cancel
Save