System¶
Authentication¶
-
POST/api/v1/login¶ Response JSON Object: - isAdmin (boolean) – is administrator group or not
- username (string) – request username
Example request
$ curl -sq -XPOST -c cookies.txt -d 'username=admin&password=admin' \ http://${QIP}:${QPORT}/api/v1/login
Example response
{ "anonymous": false, "isAdmin": false, "logintime": "2015-05-19 08:05:54", "username": "nobody" }
-
GET/api/v1/login_refresh¶ Response JSON Object: - isAdmin (boolean) – is administrator group or not
- username (string) – request username
Example request
$ curl -sq -XGET -b cookies.txt http://${QIP}:${QPORT}/api/v1/login_refresh
Example response
{ "anonymous": false, "isAdmin": false, "logintime": "2015-05-19 08:05:54", "username": "nobody" }
-
PUT/api/v1/logout¶ Response JSON Object: - username (string) – request username
Example request
$ curl -sq -XPUT -b cookies.txt http://${QIP}:${QPORT}/api/v1/logout
Example response
{ "username": "nobody" }
System Information¶
-
GET/api/v1/system¶ Response JSON Object: - cpu_core (int) – CPU core count
- cpu_thread (int) – Total CPU thread count
- hostname (string) – Device hostname
- processor (string) – Processor information
- machine (string) – Machine type, e.g. ‘x86_64’, ‘armv7l’. An empty string is returned if the value cannot be determined.
- version (object) – Version of Docker, LXC, and container-station-web
Example request
$ curl -sq -b cookies.txt http://${QIP}:${QPORT}/api/v1/system
Example response
{ "cpu_core": 2, "cpu_thread": 2, "hostname": "vagrant-ubuntu-trusty-64", "machine": "amd64", "processor": "Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz", "version": { "docker_version": "1.6.1", "lxc_version": "1.0.7", "web": "unknown" } }
-
GET/api/v1/system/resource¶ Response JSON Object: - cpu_usage (string) – CPU usage in percentage
- memory_usage (object) – Memory usage in MB
Example request
$ curl -sq http://${QIP}:${QPORT}/api/v1/system/resource
Example response
{ "cpu_usage": "0.0", "memory_usage": { "buffers": 125, "cached": 1634, "percent": 23, "percent_buffers": 3, "percent_cached": 41, "total": 3953, "used": 913 } }
System Port¶
-
GET/api/v1/system/port/(string: protocol)/(string: port)¶ Response JSON Object: - used (boolean) – The port has been used or not.
Example request
$ curl -sq -b cookies.txt http://${QIP}:${QPORT}/api/v1/system/port/tcp/5000 $ curl -sq -b cookies.txt http://${QIP}:${QPORT}/api/v1/system/port/udp/33806
Example response
{ "used": true } { "used": false }