162 lines
3.4 KiB
YAML
162 lines
3.4 KiB
YAML
basePath: /api/v1
|
|
definitions:
|
|
config.API:
|
|
properties:
|
|
plugin:
|
|
$ref: '#/definitions/config.PluginAPI'
|
|
rest:
|
|
$ref: '#/definitions/config.WebAPI'
|
|
type: object
|
|
config.Config:
|
|
properties:
|
|
api:
|
|
$ref: '#/definitions/config.API'
|
|
debug:
|
|
type: boolean
|
|
default_server:
|
|
type: string
|
|
docker:
|
|
$ref: '#/definitions/config.DockerConfig'
|
|
servers:
|
|
items:
|
|
$ref: '#/definitions/config.Server'
|
|
type: array
|
|
type: object
|
|
config.DockerConfig:
|
|
properties:
|
|
cert_path:
|
|
type: string
|
|
from_env:
|
|
type: boolean
|
|
host:
|
|
type: string
|
|
tls_verify:
|
|
type: boolean
|
|
version:
|
|
type: string
|
|
type: object
|
|
config.DriverParams:
|
|
additionalProperties: true
|
|
type: object
|
|
config.DriverType:
|
|
enum:
|
|
- ssh
|
|
- plugin
|
|
- nil
|
|
type: string
|
|
x-enum-varnames:
|
|
- DriverSSH
|
|
- DriverPlugin
|
|
- DriverNil
|
|
config.PluginAPI:
|
|
properties:
|
|
port:
|
|
maximum: 65535
|
|
minimum: 0
|
|
type: integer
|
|
type: object
|
|
config.Server:
|
|
properties:
|
|
driver:
|
|
$ref: '#/definitions/config.DriverType'
|
|
name:
|
|
type: string
|
|
params:
|
|
$ref: '#/definitions/config.DriverParams'
|
|
required:
|
|
- name
|
|
type: object
|
|
config.WebAPI:
|
|
properties:
|
|
port:
|
|
maximum: 65535
|
|
minimum: 0
|
|
type: integer
|
|
token:
|
|
type: string
|
|
type: object
|
|
dto.Container:
|
|
properties:
|
|
domain:
|
|
example: https://service.localhost.run
|
|
type: string
|
|
id:
|
|
example: 49ec97b6a12560f98fe21a20a88c37d289c83b14cc0ada2a62b0e404512905ed
|
|
type: string
|
|
ip:
|
|
format: ipv4
|
|
type: string
|
|
names:
|
|
example:
|
|
- service-web-1
|
|
items:
|
|
type: string
|
|
type: array
|
|
port:
|
|
example: 80
|
|
type: integer
|
|
remote_host:
|
|
example: hostname
|
|
type: string
|
|
type: object
|
|
server.Connections:
|
|
additionalProperties:
|
|
$ref: '#/definitions/dto.Container'
|
|
type: object
|
|
server.ServerStatus:
|
|
properties:
|
|
connections:
|
|
$ref: '#/definitions/server.Connections'
|
|
name:
|
|
type: string
|
|
type: object
|
|
info:
|
|
contact: {}
|
|
title: sshpoke REST API
|
|
version: "1.0"
|
|
paths:
|
|
/config:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Prints app configuration in JSON format.
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/config.Config'
|
|
"400":
|
|
description: Bad Request
|
|
security:
|
|
- Bearer: []
|
|
summary: App configuration.
|
|
/status:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Returns forwards in JSON format. Forwards without domain may be
|
|
inactive or not active yet.
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
additionalProperties:
|
|
$ref: '#/definitions/server.ServerStatus'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
security:
|
|
- Bearer: []
|
|
summary: Forwards & servers status.
|
|
securityDefinitions:
|
|
Bearer:
|
|
description: Rest API token (leave empty if it's not provided in config).
|
|
in: header
|
|
name: Authorization
|
|
type: apiKey
|
|
swagger: "2.0"
|