A python ReST API using flask and dynamodb.
Based on Jake Wright's excellent video and home automation project https://youtu.be/4T5Gnrmzjak
Start the service using docker-compose
docker-compose build
docker-compose up
The project will be running on localhost:5000
Run integration tests with
python -m pytest -v
All responses will have the form
{
"data": "Mixed type holding the content of the response",
"message": "Description of what happened"
}
Subsequent response definitions will only detail the expected value of the data field
Definition
GET /items
Response
200 OK
on success
[
{
"identifier": "first",
"name": "First Item"
},
{
"identifier": "second",
"name": "Second Item"
}
]
Definition
POST /items
Arguments
"identifier":string
a globally unique identifier for this item"name":string
a friendly name for this item
If an item with the given identifier already exists, the existing device will be overwritten.
Response
201 Created
on success
{
"identifier": "third",
"name": "Third Item"
}
GET /item/<identifier>
Response
404 Not Found
if the device does not exist200 OK
on success
{
"identifier": "third",
"name": "Third Item"
}
Definition
DELETE /item/<identifier>
Response
204 No Content