Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
feat: add sample responses
Browse files Browse the repository at this point in the history
  • Loading branch information
d1snin committed Oct 4, 2023
1 parent 4311959 commit a8833cc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
46 changes: 41 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,18 @@ Fetch current Master server status via `GET /status`:
```http request
GET https://rc.example.com/status
```
```
```http request
HTTP/1.1 200 OK
Content-Length: 43
Content-Length: 49
Content-Type: application/json
Connection: keep-alive
{
"version": "0.0.1",
"state": "UP",
"hosts": []
"hosts": [
"test"
]
}
```

Expand All @@ -109,7 +111,24 @@ Authorization: <token>
"host": "<host name (whoami)>"
}
```
```
```http request
HTTP/1.1 202 Accepted
Content-Length: 151
Content-Type: application/json
Connection: keep-alive
{
"id": "a34b4887-ec04-434a-b3ff-af426be4ec25",
"command": {
"name": "pwd",
"arguments": []
},
"host": "test",
"pid": null,
"output": null,
"status": null,
"error": null
}
```

Get run state via `GET /runs/{id}`
Expand All @@ -119,7 +138,24 @@ GET https://rc.example.com/runs/<run id>
Content-Type: application/json
Authorization: <token>
```
```
```http request
HTTP/1.1 200 OK
Content-Length: 148
Content-Type: application/json
Connection: keep-alive
{
"id": "a34b4887-ec04-434a-b3ff-af426be4ec25",
"command": {
"name": "pwd",
"arguments": []
},
"host": "test",
"pid": 51,
"output": "/",
"status": null,
"error": null
}
```

### Code of Conduct
Expand Down
4 changes: 2 additions & 2 deletions http/master.http
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WEBSOCKET ws://192.168.0.200:8070/session?whoami=test
GET http://192.168.0.200:8070/status

### GET Run
GET http://192.168.0.200:8070/runs/ea020c4e-d29b-4cd1-82d4-f46896818e03
GET http://192.168.0.200:8070/runs/a34b4887-ec04-434a-b3ff-af426be4ec25
Content-Type: application/json
Authorization: {{token}}

Expand All @@ -18,7 +18,7 @@ Authorization: {{token}}

{
"command": {
"name": "pwda",
"name": "pwd",
"arguments": [
]
},
Expand Down

0 comments on commit a8833cc

Please sign in to comment.