-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathapi.yaml
255 lines (242 loc) · 7.81 KB
/
api.yaml
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
openapi: 3.0.0
info:
version: 0.1.0
title: Management Api
tags:
- name: health
description: Healtcheck endpoints
- name: devices
description: Device related endpoints
- name: accessories
description: Accessories related endpoints
security:
- basicAuth: []
components:
schemas:
TraceState:
$ref: types.yaml#/TraceState
TraceParent:
$ref: types.yaml#/TraceParent
ServiceStatus:
$ref: components/schemas.yaml#/ServiceStatus
Device:
$ref: components/devices/schemas.yaml#/Device
Accessory:
$ref: components/accessories/schemas.yaml#/Accessory
AccessoryCreateError:
$ref: components/accessories/schemas.yaml#/CreateAccessoryError
responses:
# common
internalServerError500:
$ref: components/responses.yaml#/internalServerError500
forbidden403:
$ref: components/responses.yaml#/forbidden403
# health responses
livez200:
$ref: components/responses.yaml#/livez200
livez500:
$ref: components/responses.yaml#/livez500
readyz200:
$ref: components/responses.yaml#/readyz200
readyz500:
$ref: components/responses.yaml#/readyz500
# devices
getDevice200:
$ref: components/devices/responses.yaml#/getDevice200
getDevice400:
$ref: components/devices/responses.yaml#/getDevice400
listDevices200:
$ref: components/devices/responses.yaml#/listDevices200
listDevices400:
$ref: components/devices/responses.yaml#/listDevices400
createDevice201:
$ref: components/devices/responses.yaml#/createDevice201
createDevice400:
$ref: components/devices/responses.yaml#/createDevice400
# accessories
getAccessory200:
$ref: components/accessories/responses.yaml#/getAccessory200
getAccessoryLog200:
$ref: components/accessories/responses.yaml#/getAccessoryLog200
getAccessory400:
$ref: components/accessories/responses.yaml#/getAccessory400
createAccessory200:
$ref: components/accessories/responses.yaml#/createAccessory200
createAccessory409:
$ref: components/accessories/responses.yaml#/createAccessory409
createAccessory400:
$ref: components/accessories/responses.yaml#/createAccessory400
requestBodies:
createDevice:
$ref: components/devices/request-bodies.yaml#/createDevice
createAccessory:
$ref: components/accessories/request-bodies.yaml#/createAccessory
parameters:
traceParentHeader:
$ref: components/parameters.yaml#/traceParentHeader
traceStateHeader:
$ref: components/parameters.yaml#/traceStateHeader
listDevicesFilterQuery:
$ref: components/devices/parameters.yaml#/listDevicesFilterQuery
listDevicesSortQuery:
$ref: components/devices/parameters.yaml#/listDevicesSortQuery
listDevicesPageQuery:
$ref: components/devices/parameters.yaml#/listDevicesPageQuery
listDevicesForQuery:
$ref: components/devices/parameters.yaml#/listDevicesForQuery
deviceIdPath:
$ref: components/devices/parameters.yaml#/deviceIdPath
accessoryIdPath:
$ref: components/accessories/parameters.yaml#/accessoryIdPath
securitySchemes:
basicAuth:
type: http
scheme: basic
paths:
# healthchecks
/livez:
get:
tags:
- health
description: Indicates if service is working correctly.
operationId: isLive
security: [] # insecure
responses:
200:
$ref: '#/components/responses/livez200'
500:
$ref: '#/components/responses/livez500'
/readyz:
get:
tags:
- health
description: Indicates if service is ready to handle requests.
operationId: isReady
security: [] # insecure
responses:
200:
$ref: '#/components/responses/readyz200'
500:
$ref: '#/components/responses/readyz500'
# devices
/v1/devices:
get:
tags:
- devices
description: Get all devices
operationId: getDevices
responses:
200:
$ref: '#/components/responses/listDevices200'
400:
$ref: '#/components/responses/listDevices400'
403:
$ref: '#/components/responses/forbidden403'
500:
$ref: '#/components/responses/internalServerError500'
parameters:
- $ref: '#/components/parameters/traceParentHeader'
- $ref: '#/components/parameters/traceStateHeader'
- $ref: '#/components/parameters/listDevicesFilterQuery'
- $ref: '#/components/parameters/listDevicesSortQuery'
- $ref: '#/components/parameters/listDevicesPageQuery'
- $ref: '#/components/parameters/listDevicesForQuery'
post:
tags:
- devices
description: Create device
operationId: createDevice
responses:
201:
$ref: '#/components/responses/createDevice201'
400:
$ref: '#/components/responses/createDevice400'
403:
$ref: '#/components/responses/forbidden403'
500:
$ref: '#/components/responses/internalServerError500'
parameters:
- $ref: '#/components/parameters/traceParentHeader'
- $ref: '#/components/parameters/traceStateHeader'
requestBody:
$ref: '#/components/requestBodies/createDevice'
/v1/devices/{deviceId}:
get:
tags:
- devices
description: Get device by id
operationId: getDevice
responses:
200:
$ref: '#/components/responses/getDevice200'
400:
$ref: '#/components/responses/getDevice400'
403:
$ref: '#/components/responses/forbidden403'
500:
$ref: '#/components/responses/internalServerError500'
parameters:
- $ref: '#/components/parameters/traceParentHeader'
- $ref: '#/components/parameters/traceStateHeader'
- $ref: '#/components/parameters/deviceIdPath'
# accessories
/v1/accessories:
post:
tags:
- accessories
description: Create accessories
operationId: createAccessory
responses:
200:
$ref: '#/components/responses/createAccessory200'
400:
$ref: '#/components/responses/createAccessory400'
409:
$ref: '#/components/responses/createAccessory409'
403:
$ref: '#/components/responses/forbidden403'
500:
$ref: '#/components/responses/internalServerError500'
parameters:
- $ref: '#/components/parameters/traceParentHeader'
- $ref: '#/components/parameters/traceStateHeader'
requestBody:
$ref: '#/components/requestBodies/createAccessory'
/v1/accessories/{accessoryId}:
get:
tags:
- accessories
description: Get all accessories
operationId: getAccessory
responses:
200:
$ref: '#/components/responses/getAccessory200'
400:
$ref: '#/components/responses/getAccessory400'
403:
$ref: '#/components/responses/forbidden403'
500:
$ref: '#/components/responses/internalServerError500'
parameters:
- $ref: '#/components/parameters/traceParentHeader'
- $ref: '#/components/parameters/traceStateHeader'
- $ref: '#/components/parameters/accessoryIdPath'
/v1/accessories/{accessoryId}/log:
get:
tags:
- accessories
description: Get acessory log
operationId: getAccessoryLog
responses:
200:
$ref: '#/components/responses/getAccessoryLog200'
400:
$ref: '#/components/responses/getAccessory400'
403:
$ref: '#/components/responses/forbidden403'
500:
$ref: '#/components/responses/internalServerError500'
parameters:
- $ref: '#/components/parameters/traceParentHeader'
- $ref: '#/components/parameters/traceStateHeader'
- $ref: '#/components/parameters/accessoryIdPath'