Endpoints¶
Healthchecks¶
-
GET
/ping
¶ Quick healthcheck for app ‘liveness’.
Example Request:
GET /ping HTTP/1.1 Host: 0.0.0.0:8080 Accept: application/json
Example Response:
HTTP/1.1 200 OK Content-Type: text/plain; charset=utf-8 Content-Length: 4 Server: Python/3.6 aiohttp/3.2.1 pong
Response Headers: - Content-Type – text/plain
Status Codes: - 200 OK – no error
Metadata¶
-
GET
/version
¶ Get the running version of Gordon and its dependencies.
Example Request:
GET /version HTTP/1.1 Host: 0.0.0.0:8080 Accept: application/json
Example Response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 558 Server: Python/3.6 aiohttp/3.2.1 { "zope.interface": "4.5.0", "yarl": "1.2.4", "urllib3": "1.22", "ulogger": "1.0.1", "toml": "0.9.4", "six": "1.11.0", "setuptools": "28.8.0", "requests": "2.18.4", "pytest": "3.5.1", "pytest-aiohttp": "0.3.0", "py": "1.5.3", "pluggy": "0.6.0", "pip": "10.0.1", "multidict": "4.3.1", "more-itertools": "4.1.0", "idna": "2.6", "idna-ssl": "1.0.1", "click": "6.7", "chardet": "3.0.4", "certifi": "2018.4.16", "attrs": "18.1.0", "async-timeout": "3.0.0", "async-dns": "1.0.0", "aiohttp": "3.2.1", "gordon-dns": "0.0.1.dev1", "gordon-introspection": "0.0.1.dev0" }
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – no error
-
GET
/system
¶ Get system-related information.
Example Request:
GET /system HTTP/1.1 Host: 0.0.0.0:8080 Accept: application/json
Example Response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 1101 Server: Python/3.6 aiohttp/3.2.1 { "uptime": "18:05 up 43 days, 4:54, 8 users, load averages: 2.19 1.77 1.69", "system_time": "Wed May 30 18:05:45 EDT 2018", "pid": 65161, "python": { "version": "3.6.2 (default, Jul 22 2017, 12:07:11) \n[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)]", "executable": "executable": "/Users/lynn/.pyenv/versions/3.6.2/envs/gordon-introspection-test/bin/python", "pythonpath": [ "/Users/lynn/.pyenv/versions/3.6.2/envs/gordon-introspection-test/bin", "/Users/lynn/.pyenv/versions/3.6.2/lib/python36.zip", "/Users/lynn/.pyenv/versions/3.6.2/lib/python3.6", "/Users/lynn/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload", "/Users/lynn/.pyenv/versions/3.6.2/envs/gordon-introspection-test/lib/python3.6/site-packages", "/Users/lynn/Dev/spotify/alf/gordon/core", "/Users/lynn/Dev/spotify/alf/gordon/server/src" ], "version_info": { "major": 3, "minor": 6, "micro": 2, "releaselevel": "final", "serial": 0 } }, "os": { "platform": "darwin", "name": "posix", "uname": [ "Darwin", "nope.local", "16.7.0", "Darwin Kernel Version 16.7.0: Wed Oct 4 00:17:00 PDT 2017; root:xnu-3789.71.6~1/RELEASE_X86_64", "x86_64", "i386" ] } }
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – no error
Logging¶
-
GET
/logging
¶ Get all loggers.
Example Request:
GET /logging HTTP/1.1 Host: 0.0.0.0:8080 Accept: application/json
Example Response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 223 Server: Python/3.6 aiohttp/3.2.1 { "concurrent.futures": "NOTSET", "asyncio": "NOTSET", "aiohttp.access": "NOTSET", "aiohttp.client": "NOTSET", "aiohttp.internal": "NOTSET", "aiohttp.server": "NOTSET", "aiohttp.web": "NOTSET", "aiohttp.websocket": "NOTSET" }
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – no error
-
GET
/logging?logger=$NAME
¶ Get one logger.
Example Request:
GET /logging?logger=asyncio HTTP/1.1 Host: 0.0.0.0:8080 Accept: application/json
Example Response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 21 Server: Python/3.6 aiohttp/3.2.1 {"asyncio": "NOTSET"}
Query Parameters: - logger – target logger
Response Headers: - Content-Type – application/json
Status Codes: - 200 OK – no error
- 400 Bad Request – requested logger is a
logging.PlaceHolder
- 404 Not Found – logger not found
-
POST
/logging
¶ Set a logger’s level.
Example Request:
POST /logging?logger=asyncio&level=INFO HTTP/1.1 Host: 0.0.0.0:8080
Example Response:
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: application/octet-stream Server: Python/3.6 aiohttp/3.2.1
Query Parameters: - logger – target logger
- level – desired level
Response Headers: - Content-Type – application/json
Status Codes: - 204 No Content – logger level updated
- 400 Bad Request – malformed request
- 404 Not Found – logger and/or level not found
- 500 Internal Server Error – logger could not be updated to desired level