{
"openapi": "3.0.0",
"info": {
"title": "ip-allocator-webserver",
"version": "0.1.0"
},
"paths": {
"/borrow": {
"get": {
"description": "Borrow an item from the freelist\n\nOptional query parameter `wait` specifies the maximum number of seconds to wait for an item to become available. If not specified, returns immediately. If specified, the request will block until an item becomes available or the timeout is reached.",
"operationId": "handlers_ip_borrow",
"parameters": [
{
"name": "wait",
"in": "query",
"schema": {
"type": "integer",
"format": "uint64",
"minimum": 0.0,
"nullable": true
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BorrowOutput"
}
}
}
},
"400": {
"description": "# [400 Bad Request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400)\nThe request given is wrongly formatted or data asked could not be fulfilled. "
},
"404": {
"description": "# [404 Not Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)\nThis response is given when you request a page that does not exists."
},
"422": {
"description": "# [422 Unprocessable Entity](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422)\nThis response is given when you request body is not correctly formatted. "
},
"500": {
"description": "# [500 Internal Server Error](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500)\nThis response is given when something wend wrong on the server. "
},
"503": {
"description": "# [503 Service Unavailable](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503)\nThis response is given when the requested resource is temporarily unavailable. For example, when trying to borrow an IP but none are currently available in the freelist. Clients should retry after a delay."
}
}
}
},
"/return": {
"post": {
"description": "Return an item to the freelist",
"operationId": "handlers_ip_return_item",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReturnInput"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OperationRef"
}
}
}
},
"400": {
"description": "# [400 Bad Request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400)\nThe request given is wrongly formatted or data asked could not be fulfilled. "
},
"404": {
"description": "# [404 Not Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)\nThis response is given when you request a page that does not exists."
},
"422": {
"description": "# [422 Unprocessable Entity](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422)\nThis response is given when you request body is not correctly formatted. "
},
"500": {
"description": "# [500 Internal Server Error](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500)\nThis response is given when something wend wrong on the server. "
},
"503": {
"description": "# [503 Service Unavailable](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503)\nThis response is given when the requested resource is temporarily unavailable. For example, when trying to borrow an IP but none are currently available in the freelist. Clients should retry after a delay."
}
}
}
},
"/operations/{id}": {
"get": {
"description": "Poll the status of an async operation",
"operationId": "handlers_ip_get_operation_status",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OperationStatusOutput"
}
}
}
},
"400": {
"description": "# [400 Bad Request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400)\nThe request given is wrongly formatted or data asked could not be fulfilled. "
},
"404": {
"description": "# [404 Not Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404)\nThis response is given when you request a page that does not exists."
},
"422": {
"description": "# [422 Unprocessable Entity](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422)\nThis response is given when you request body is not correctly formatted. "
},
"500": {
"description": "# [500 Internal Server Error](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500)\nThis response is given when something wend wrong on the server. "
},
"503": {
"description": "# [503 Service Unavailable](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503)\nThis response is given when the requested resource is temporarily unavailable. For example, when trying to borrow an IP but none are currently available in the freelist. Clients should retry after a delay."
}
}
}
}
},
"components": {
"schemas": {
"BorrowOutput": {
"type": "object",
"required": [
"item"
],
"properties": {
"item": {}
}
},
"OperationRef": {
"type": "object",
"required": [
"operation_id",
"status"
],
"properties": {
"operation_id": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"ReturnInput": {
"type": "object",
"required": [
"item"
],
"properties": {
"item": {}
}
},
"OperationStatusOutput": {
"type": "object",
"required": [
"operation_id",
"status"
],
"properties": {
"operation_id": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": "string",
"nullable": true
}
}
}
}
}
}