LocalhostBunny/swagger/swagger.json

358 lines
11 KiB
JSON
Raw Normal View History

2023-12-01 09:56:06 +01:00
{
"swagger": "2.0",
"info": {
"title": "LocalHostBunny",
"contact": {},
"version": "1.0"
},
"host": "localhost",
"basePath": "/api/v1/",
"paths": {
2023-12-01 13:44:58 +01:00
"/": {
"get": {
"summary": "(Website)",
"responses": {}
}
},
2023-12-01 09:56:06 +01:00
"/api/health": {
"get": {
"tags": [
"Common"
],
"summary": "Server Health-checks",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.Health.response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
}
},
"/api/ping": {
"get": {
"tags": [
"Common"
],
"summary": "Simple endpoint to test connection (any http method)",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.pingResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
},
"put": {
"tags": [
"Common"
],
"summary": "Simple endpoint to test connection (any http method)",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.pingResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
},
"post": {
"tags": [
"Common"
],
"summary": "Simple endpoint to test connection (any http method)",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.pingResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
},
"delete": {
"tags": [
"Common"
],
"summary": "Simple endpoint to test connection (any http method)",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.pingResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
},
"patch": {
"tags": [
"Common"
],
"summary": "Simple endpoint to test connection (any http method)",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.pingResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
}
},
"/api/sleep/:secs": {
"post": {
"tags": [
"Common"
],
"summary": "Return 200 after x seconds",
"parameters": [
{
"type": "number",
"description": "sleep delay (in seconds)",
"name": "secs",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.Sleep.response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/models.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
}
},
"/icon/:cs": {
"get": {
"summary": "Get Icon",
"parameters": [
{
"type": "number",
"description": "Icon Checksum",
"name": "cs",
"in": "path",
"required": true
}
],
"responses": {}
}
},
2023-12-01 13:44:58 +01:00
"/index.html": {
"get": {
"summary": "(Website)",
"responses": {}
}
},
"/scripts.script.js": {
"get": {
"summary": "(Website)",
"responses": {}
}
},
2023-12-01 09:56:06 +01:00
"/server": {
"get": {
"summary": "List running server",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.ListServer.response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/models.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/models.APIError"
}
}
}
}
}
},
"definitions": {
"handler.Health.response": {
"type": "object",
"properties": {
"status": {
"type": "string"
}
}
},
"handler.ListServer.response": {
"type": "object",
"properties": {
2023-12-13 22:41:44 +01:00
"servers": {
2023-12-01 09:56:06 +01:00
"type": "array",
"items": {
"$ref": "#/definitions/models.Server"
}
}
}
},
"handler.Sleep.response": {
"type": "object",
"properties": {
"duration": {
"type": "number"
},
"end": {
"type": "string"
},
"start": {
"type": "string"
}
}
},
"handler.pingResponse": {
"type": "object",
"properties": {
"info": {
"$ref": "#/definitions/handler.pingResponseInfo"
},
"message": {
"type": "string"
}
}
},
"handler.pingResponseInfo": {
"type": "object",
"properties": {
"addr": {
"type": "string"
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"method": {
"type": "string"
},
"request": {
"type": "string"
},
"uri": {
"type": "string"
}
}
},
"models.APIError": {
"type": "object",
"properties": {
"errorcode": {
"type": "string"
},
"fapiMessage": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"models.Server": {
"type": "object",
"properties": {
2023-12-01 11:24:22 +01:00
"contentType": {
"type": "string"
},
"icon": {
"type": "string"
},
2023-12-01 11:24:22 +01:00
"ip": {
"type": "string"
},
2023-12-02 01:01:16 +01:00
"name": {
"type": "string"
},
2023-12-01 11:24:22 +01:00
"pid": {
"type": "integer"
},
2023-12-01 09:56:06 +01:00
"port": {
"type": "integer"
2023-12-01 11:24:22 +01:00
},
"process": {
"type": "string"
},
"protocol": {
"type": "string"
},
"response": {
"type": "string"
},
"sockState": {
"type": "string"
},
"statusCode": {
"type": "integer"
},
"uid": {
"type": "integer"
2023-12-01 09:56:06 +01:00
}
}
}
}
}