-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-schedule-endpoints.http
59 lines (43 loc) · 1.56 KB
/
test-schedule-endpoints.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# install the vscode extension, REST Client by Huachao Mao to use this script
# use this if you wish to access the robot's scheduling server (needs vpn)
# @server = http://192.168.69.102:8091
# use this if you deployed the server using docker container
# @server = http://localhost:5001
# use this if you deployed the server using npm start
@server = http://localhost:8091
@schedule_id = 1337
@schedule_name = test_schedule
@crontab = 0 9 * * *
@cleaning_plan_name = test_cleaning_plan
# check if server is alive
GET {{server}}
###
# get all schedules
GET {{server}}/schedules
###
# create new schedule
POST {{server}}/schedules
Content-Type: application/json
{
"schedule_id": "{{schedule_id}}",
"schedule_name": "{{schedule_name}}",
"crontab": "{{crontab}}",
"cleaning_plan_name": "{{cleaning_plan_name}}",
"cleaning_receipt":{ "cleaning_zone_1": {"coordinates": "[[1.9424001779556277,-1.0545998667031526],[-1.8207998781204222,-1.0545998667031526],[-1.9743998804092404,-7.851399967983365],[1.8656001768112187,-7.851399967983365]]", "vacuum": "2", "repetition": "1", "roller": "1", "gutter": "1", "preset": "GlobotixFloor"} },
"expiration_date": "{{$localDatetime 'YYYY-MM-DDTHH:mm:ss.SSSZ' 0}}"
}
###
# get schedule by id
GET {{server}}/schedules/{{schedule_id}}
###
# update schedule
PUT {{server}}/schedules/{{schedule_id}}
Content-Type: application/json
{
"schedule_name": "{{schedule_name}}_new",
"crontab": "* * * * *",
"cleaning_plan_name": "{{cleaning_plan_name}}_new"
}
###
# delete schedule
DELETE {{server}}/schedules/{{schedule_id}}