From 0d00968f2e748244c4231fc90b847e39b788a164 Mon Sep 17 00:00:00 2001 From: Ubergeek Date: Wed, 22 Jan 2020 13:31:10 -0500 Subject: [PATCH] Linked readme to wiki page --- README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 066ba26..6cadac3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,78 @@ -# thunix_api +# Thunix API -API for Thunix \ No newline at end of file +This is the working spec for the Thunix API. Until finalization, the spec will be consider v1. v1 of the API shall be considered unstable, and a work in progress. + +The API will be authenticated, at all times, using the user's credentials sent in the host headers. + +The API shall return a 200 for successful requests, with the JSON paylod. + +The API shall return a 400 for any endpoint not existent. + +The API shall return a 401 for unauthenticated requests. + +The API shall return a 403 for requests which are authenticated, but not permissible for the authenticated user. + +The API shall return a 418 for requests to the "/teapot" endpoint. + +The API shall return a 420 for requests exceeding the rate limits. + +The API shall return a 501 for requests which exist in the spec, but have not been implmented yet. + + +## API Format + +The API is a RESTful API, and the following URIs will be used: + +```https:{hostname}/api/1/{action}``` + + +## Informational APIs + +### ip_info + +This endpoint shall return a json struct containing interfaces, and IP addresses in CIDR format: + + +```{ + "Interfaces":[ + { + "Name":"eth0", + "Addresses":[ + "10.0.0.1/32", + "10.0.1.100/24" + ] + }, + { + "Name":"wg0", + "Addresses":[ + "192.168.0.1/24" + ] + } + ] +} +``` + +### uptime + +This will return a struct of system uptime: + +``` +{ + "days":164, + "hours":16, + "mins":22, + "secs":3 +} +``` + +### teapot + +This shall return a struct, describing the current tea making capabilities of the system: + +``` +{ + "tea" : "available", + "height" : "short", + "width" : "stout +} +```