Test outlet is now functional
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
77
docs/api/test-rest-api.md
Normal file
77
docs/api/test-rest-api.md
Normal 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
|
||||
```
|
||||
Reference in New Issue
Block a user