2023-12-01 09:56:06 +01:00
|
|
|
{
|
|
|
|
"swagger": "2.0",
|
|
|
|
"info": {
|
|
|
|
"title": "LocalHostBunny",
|
|
|
|
"contact": {},
|
|
|
|
"version": "1.0"
|
|
|
|
},
|
|
|
|
"host": "localhost",
|
|
|
|
"basePath": "/api/v1/",
|
|
|
|
"paths": {
|
|
|
|
"/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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/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": {
|
|
|
|
"server": {
|
|
|
|
"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"
|
|
|
|
},
|
|
|
|
"ip": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|