sshpoke/internal/api/rest/docs/swagger.json

242 lines
6.9 KiB
JSON

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