Test outlet is now functional
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
NADAL Jean-Baptiste
2020-02-24 16:39:30 +01:00
parent e4de72a4f6
commit 8e7e94568f
14 changed files with 456 additions and 81 deletions

77
docs/api/test-rest-api.md Normal file
View File

@@ -0,0 +1,77 @@
# Test all the REST API of domo.
## Outlets
### list
```
curl -v http://localhost:34000/v1/outlets
```
```json
{
"id": "",
"outlets": [
{
"id": 1,
"name": "Bureau JB",
"sender": 12797322,
"speech_name": "bureau",
"state": true,
"switch": 0
},
{
"id": 2,
"name": "Salon",
"sender": 12797322,
"speech_name": "salon",
"state": false,
"switch": 1
},
{
"id": 3,
"name": "Sapin",
"sender": 12797322,
"speech_name": "sapin",
"state": false,
"switch": 2
}
],
"response_code": 200,
"status": "passed"
}
```
### read
```
curl -v http://localhost:34000/v1/outlets/2
```
```json
{
"id": 2,
"name": "Salon",
"sender": 12797322,
"speech_name": "salon",
"state": false,
"switch": 1
}
```
### create
```
curl -X POST -v http://localhost:34000/v1/outlets -d "{\"name\":\"test\", \"sender\": 12797322, \"switch\": 4}"
```
### update
```
curl -X PUT -v http://localhost:34000/v1/outlets/4 -d "{\"name\":\"test1\", \"sender\": 1, \"switch\": 2}"
```
### delete
```
curl -v http://localhost:34000/v1/outlets/2
```