/
good_raml.raml
205 lines (205 loc) · 5.33 KB
/
good_raml.raml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#%RAML 0.8
title: Congo API For Drone Deliveries
mediaType: application/json
/deliveries:
get:
description: Get a list of deliveries
queryParameters:
sinceDate:
type: date
example: Mon, 14 Jul 2014 07:00:00 GMT
throughDate:
type: date
example: Mon, 18 Jul 2014 07:00:00 GMT
responses:
200:
body:
example: |
[
{
"id": "4",
"at": "Tue, 08 Jul 2014 13:00:00 GMT",
"toAddressId": "gi6w4fgi",
"orderItemId": "6782798",
"status": "completed",
"droneId": "f"
},
{
"id": "137",
"at": "Sun, 20 Jul 2014 19:36:00 GMT",
"toAddressId": "6tg23d6i",
"orderItemId": "7626827",
"status": "scheduled",
"droneId": "a"
},
{
"id": "8",
"at": "Sun, 20 Jul 2014 21:20:00 GMT",
"toAddressId": "gi6w4fgi",
"orderItemId": "9877292",
"status": "scheduled",
"droneId": "f"
}
]
post:
description: Create/request a new delivery
body:
example: |
{
"at": "Sun, 20 Jul 2014 21:20:00 GMT",
"toAddressId": "273hh79",
"orderItemId": "736786"
}
responses:
201:
headers:
Location:
body:
example: |
{
"id": "987",
"at": "Sun, 20 Jul 2014 21:20:00 GMT",
"toAddressId": "273hh79",
"orderItemId": "736786",
"status": "scheduled",
"droneId": "f"
}
/{deliveryId}:
get:
description: Get information on a specific delivery
responses:
200:
body:
example: |
{
"id": "8",
"at": "Sun, 20 Jul 2014 21:20:00 GMT",
"toAddressId": "gi6w4fgi",
"orderItemId": "736786",
"status": "scheduled",
"droneId": "f"
}
patch:
description: Update the information on a specific delivery
body:
example: |
{
"at": "Mon, 21 Jul 2014 00:00:00 GMT"
}
responses:
200:
body:
example: |
{
"id": "8",
"at": "Mon, 21 Jul 2014 00:00:00 GMT",
"toAddressId": "gi6w4fgi",
"orderItemId": "736786",
"status": "scheduled",
"droneId": "f"
}
delete:
description: Cancel a specific delivery
responses:
204:
/drones:
get:
description: Get a list of drones
queryParameters:
atLatitude:
description: Latitude in decimal degrees
type: number
example: 37.8
atLongitude:
description: Longitude in decimal degrees
type: number
example: -122.3
atAltitude:
description: Altitude in meters above the [ellipsoid](http://www.w3.org/TR/geolocation-API/#ref-wgs)
type: number
example: 0
atRange:
description: Maximum distance from location, in meters
type: number
example: 50
default: 100
responses:
200:
body:
example: |
[
{
"id": "a",
"latitude": 37.787862,
"longitude": -122.404694,
"altitude": 28.3,
"name": "High Flyer"
},
{
"id": "f",
"latitude": 37.852519,
"longitude": -122.237390,
"altitude": 56.9,
"name": "Camelot"
}
]
post:
description: Add a new drone to the fleet
body:
example: |
{
"name": "Lancelot"
}
/{droneId}:
get:
description: Get information on a specific drone
responses:
200:
body:
example: |
{
"id": "f",
"latitude": 37.852519,
"longitude": -122.237390,
"altitude": 56.9,
"name": "Camelot"
}
patch:
description: Update the information on a specific drone
body:
example: |
{
"name": "Arthur"
}
responses:
200:
body:
example: |
{
"id": "f",
"latitude": 37.852519,
"longitude": -122.237390,
"altitude": 56.9,
"name": "Arthur"
}
delete:
description: Remove a drone from the fleet
responses:
204:
/deliveries:
get:
description: The deliveries scheduled for the current drone
responses:
200:
body:
example: |
[
{
"id": "8",
"at": "Sun, 20 Jul 2014 21:20:00 GMT",
"toAddressId": "gi6w4fgi",
"orderItemId": "736786",
"status": "scheduled",
"droneId": "f"
}
]