Endpoints

For next examples is used httpie.org.

/api/auth

$ http POST 10.10.10.126:9753/api/auth/ username=Foo password=Bar
HTTP/1.1 200 OK
Allow: POST, OPTIONS
Connection: close
Content-Type: application/json
Date: Sun, 07 Dec 2014 00:16:18 GMT
Server: gunicorn/18.0
Transfer-Encoding: chunked
Vary: Accept, Cookie

{
    "token": "221ef3709a9161b9f1f9df9a0a6388689abbc712"
}

/api/systems/

$ http 10.10.10.126:9753/api/systems/ 'Authorization:  Token 221ef3709a9161b9f1f9df9a0a6388689abbc712'
HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Type: application/json
Date: Sun, 07 Dec 2014 00:11:31 GMT
Server: gunicorn/18.0
Transfer-Encoding: chunked
Vary: Accept

[
    {
        "id": 3,
        "location": 7,
        "name": "ubuntu1",
        "plan": 1
    },
    {
        "id": 4,
        "location": 8,
        "name": "rabbitmq1.box.robotice.cz",
        "plan": 1
    }
]

/api/locations/

$ http 10.10.10.126:9753/api/locations/ 'Authorization:  Token 221ef3709a9161b9f1f9df9a0a6388689abbc712'
HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Type: application/json
Date: Sun, 07 Dec 2014 00:09:59 GMT
Server: gunicorn/18.0
Transfer-Encoding: chunked
Vary: Accept

[
    {
        "description": "simple test box",
        "id": 1,
        "name": "hklab_box1",
        "start": null
    }
]

/api/devices/real/

$ http 10.10.10.126:9753/api/devices/real/ 'Authorization:  Token 221ef3709a9161b9f1f9df9a0a6388689abbc712'
HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Type: application/json
Date: Sun, 07 Dec 2014 00:12:39 GMT
Server: gunicorn/18.0
Transfer-Encoding: chunked
Vary: Accept

[
    {
        "host": 5,
        "id": 37,
        "metric": "socket",
        "name": "relay2",
        "type": "actuators"
        "extra": {
            "device": "relay",
            "metric": "socket",
            "name": "relay2",
            "port": "P9_20",
            "type": "actuators"
        },
},
]

Table Of Contents

This Page