{ "swagger": "2.0", "info": { "contact": {} }, "paths": { "/call": { "post": { "description": "Make a http call to another service and send the response\nSupports all REST operations", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Feature" ], "summary": "Call a http endpoint", "parameters": [ { "description": "'{url: http://httpbin.org/post, method: POST, body: {key: value}}' will make a post request to http://httpbin.org/post", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.CallRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } } } } }, "/control/crash": { "put": { "description": "Make Dobby kill itself", "consumes": [ "application/json" ], "tags": [ "Control" ], "summary": "Suicide", "responses": {} } }, "/control/goturbo/cpu": { "put": { "description": "Make Dobby create a CPU spike", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Control" ], "summary": "CPU Spike", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.ControlSuccess" } } } } }, "/control/goturbo/memory": { "put": { "description": "Make Dobby create a memory spike", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Control" ], "summary": "Memory Spike", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.ControlSuccess" } } } } }, "/control/health/perfect": { "put": { "description": "Make Dobby healthy", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Control" ], "summary": "Make Healthy", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.ControlSuccess" } } } } }, "/control/health/sick": { "put": { "description": "Make Dobby sick or unhealthy", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Control" ], "summary": "Make Unhealthy", "parameters": [ { "type": "integer", "description": "Recover health after sometime (seconds) - E.g. 2", "name": "resetInSeconds", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.ControlSuccess" } } } } }, "/control/ready/perfect": { "put": { "description": "Make Dobby ready", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Control" ], "summary": "Make Ready", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.ControlSuccess" } } } } }, "/control/ready/sick": { "put": { "description": "Make Dobby unready", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Control" ], "summary": "Make Unready", "parameters": [ { "type": "integer", "description": "Recover readiness after sometime (seconds) - E.g. 2", "name": "resetInSeconds", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.ControlSuccess" } } } } }, "/health": { "get": { "description": "Get Dobby's health status", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Status" ], "summary": "Dobby Health", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Health" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/model.Health" } } } } }, "/meta": { "get": { "description": "Get Dobby's metadata", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Status" ], "summary": "Dobby Metadata", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Metadata" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/model.Error" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/model.Error" } } } } }, "/proxy": { "post": { "description": "Configure proxy route to another endpoint\nSupports all REST operations", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Feature" ], "summary": "Add proxy to any http endpoint", "parameters": [ { "description": "'{path:/time, method: GET, proxy: {url:http://worldtimeapi.org/api/timezone/asia/kolkata, method:GET}}'", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.proxyRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } } } }, "delete": { "description": "Delete configured proxy route to another endpoint\nSupports all REST operations", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Feature" ], "summary": "Delete configured proxy to any http endpoint", "parameters": [ { "description": "'{path:/time, method: GET, proxy: {url:http://worldtimeapi.org/api/timezone/asia/kolkata, method:GET}}'", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handler.proxyRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } } } } }, "/ready": { "get": { "description": "Get Dobby's readiness", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Status" ], "summary": "Dobby Ready", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Ready" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/model.Ready" } } } } }, "/return/{statusCode}": { "get": { "description": "Ask Dobby to return the status code sent by the client", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Status" ], "summary": "Repeat Status", "parameters": [ { "type": "integer", "description": "Status Code - E.g. 200", "name": "statusCode", "in": "path", "required": true }, { "type": "integer", "description": "Dela(milliseconds) - E.g. 1000", "name": "delay", "in": "query" } ], "responses": { "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/model.Error" } } } } }, "/version": { "get": { "description": "Get Dobby's version", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Status" ], "summary": "Dobby Version", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Version" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/model.Error" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/model.Error" } } } } } }, "definitions": { "handler.proxy": { "type": "object", "properties": { "method": { "type": "string" }, "url": { "type": "string" } } }, "handler.proxyRequest": { "type": "object", "properties": { "method": { "type": "string" }, "path": { "type": "string" }, "proxy": { "$ref": "#/definitions/handler.proxy" } } }, "model.CallRequest": { "type": "object", "properties": { "body": {}, "method": { "type": "string" }, "url": { "type": "string" } } }, "model.ControlSuccess": { "type": "object", "properties": { "status": { "type": "string", "example": "success" } } }, "model.Error": { "type": "object", "properties": { "error": { "type": "string", "example": "something went wrong" } } }, "model.Health": { "type": "object", "properties": { "healthy": { "type": "boolean" } } }, "model.Metadata": { "type": "object", "properties": { "hostname": { "type": "string", "example": "dobby" }, "ip": { "type": "string", "example": "192.168.1.100" } } }, "model.Ready": { "type": "object", "properties": { "ready": { "type": "boolean" } } }, "model.Version": { "type": "object", "properties": { "version": { "type": "string", "example": "1.0.0" } } } } }