Skip to content

Commit 5e1c296

Browse files
committed
Added DispoAPI documentation for DispoTool
1 parent 5197ffa commit 5e1c296

File tree

1 file changed

+327
-0
lines changed

1 file changed

+327
-0
lines changed

dispoAPI/DispoAPI.yml

+327
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,327 @@
1+
openapi: '3.0.2'
2+
info:
3+
title: DispoAPI
4+
description: handles inventory changes in MyIT cmdb for DispoTool.
5+
version: '0.0.1'
6+
7+
servers:
8+
- url: https://myit-dev.post.ch/api/x_ssagd_dispoapi/dispoapi
9+
description: development server
10+
11+
security:
12+
- BasicAuth: []
13+
14+
paths:
15+
/switchDevice:
16+
patch:
17+
summary: Switches one device for another in the cmdb, including any children the old device might have had.
18+
description: tbd
19+
requestBody:
20+
content:
21+
application/json:
22+
schema:
23+
type: object
24+
properties:
25+
inventoryNumber_old:
26+
description: "The asset tag of the old device."
27+
type: string
28+
inventoryNumber_new:
29+
description: "The asset tag of the new device."
30+
type: string
31+
storage_location:
32+
description: "The sys-id of the storage location of the old device."
33+
type: string
34+
technician:
35+
description: "The technician performing the action. This string will appear in the activity stream."
36+
type: string
37+
comment:
38+
description: "A comment composed by the technician that will appear in the activity stream."
39+
type: string
40+
required:
41+
- inventoryNumber_old
42+
- inventoryNumber_new
43+
- storage_location
44+
- technician
45+
- comment
46+
47+
responses:
48+
'200':
49+
description: OK
50+
content:
51+
application/json:
52+
schema:
53+
type: object
54+
properties:
55+
message:
56+
type: string
57+
example: "Device 23282978 was switched for 23271091 successfully."
58+
'400':
59+
description: bad request
60+
content:
61+
application/json:
62+
schema:
63+
type: object
64+
properties:
65+
name:
66+
type: string
67+
example: "MyItRestException"
68+
message:
69+
type: string
70+
example: "inventoryNumber_old is missing or null in the request body."
71+
status:
72+
type: integer
73+
example: 400
74+
'403':
75+
description: forbidden
76+
content:
77+
application/json:
78+
schema:
79+
type: object
80+
properties:
81+
clazz:
82+
type: string
83+
example: "IllegalAccessException"
84+
status:
85+
type: integer
86+
example: 403
87+
message:
88+
type: string
89+
example: "You are not authorized to access this API"
90+
'500':
91+
description: Internal Server Error
92+
content:
93+
application/json:
94+
schema:
95+
type: object
96+
properties:
97+
clazz:
98+
type: string
99+
example: "MyItRestException"
100+
status:
101+
type: integer
102+
example: 500
103+
message:
104+
type: string
105+
example: "something went wrong while writing data to the new device"
106+
107+
/installDevice:
108+
patch:
109+
summary: Installs a device in the cmdb
110+
description: tbd
111+
requestBody:
112+
content:
113+
application/json:
114+
schema:
115+
type: object
116+
properties:
117+
inventoryNumber:
118+
description: "The asset tag of the device."
119+
type: string
120+
location:
121+
description: "The location of the device."
122+
type: string
123+
technician:
124+
description: "The technician performing the action. This string will appear in the activity stream."
125+
type: string
126+
comment:
127+
description: "A comment composed by the technician that will appear in the activity stream."
128+
type: string
129+
assigned_to:
130+
description: "The sys-id of the user of the device."
131+
type: string
132+
cost_center:
133+
description: "The sys-id of the cost-center of the device."
134+
type: string
135+
children:
136+
description: "Any children to install alongside the device containing the sys-id of the child as well as the name of the relation."
137+
type: array
138+
example: [
139+
{
140+
"child" : "0007047387bb39d06dc863540cbb0000",
141+
"relation" : "Connects to::Connected by"
142+
},
143+
{
144+
"child" : "0007047387bb39d06dc863540cbb0001",
145+
"relation" : "Connects to::Connected by"
146+
}
147+
]
148+
parents:
149+
description: "Any parents the device has containing the sys-id of the parent as well as the name of the relation."
150+
type: array
151+
example: [
152+
{
153+
"parent" : "0007047387bb39d06dc863540cbb0000",
154+
"relation" : "Connects to::Connected by"
155+
}
156+
]
157+
required:
158+
- inventoryNumber
159+
- location
160+
- technician
161+
- comment
162+
responses:
163+
'200':
164+
description: OK
165+
content:
166+
application/json:
167+
schema:
168+
type: object
169+
properties:
170+
message:
171+
type: string
172+
example: "Device 23282978 was installed successfully."
173+
'400':
174+
description: bad request
175+
content:
176+
application/json:
177+
schema:
178+
type: object
179+
properties:
180+
name:
181+
type: string
182+
example: "MyItRestException"
183+
message:
184+
type: string
185+
example: "inventoryNumber is missing or null in the request body."
186+
status:
187+
type: integer
188+
example: 400
189+
'403':
190+
description: forbidden
191+
content:
192+
application/json:
193+
schema:
194+
type: object
195+
properties:
196+
clazz:
197+
type: string
198+
example: "IllegalAccessException"
199+
status:
200+
type: integer
201+
example: 403
202+
message:
203+
type: string
204+
example: "You are not authorized to access this API"
205+
'500':
206+
description: Internal Server Error
207+
content:
208+
application/json:
209+
schema:
210+
type: object
211+
properties:
212+
clazz:
213+
type: string
214+
example: "MyItRestException"
215+
status:
216+
type: integer
217+
example: 500
218+
message:
219+
type: string
220+
example: "something went wrong writing data to the new device"
221+
222+
/uninstallDevice:
223+
patch:
224+
summary: Uninstalls a device in the cmdb including any children passed in the request.
225+
description: tbd
226+
requestBody:
227+
content:
228+
application/json:
229+
schema:
230+
type: object
231+
properties:
232+
inventoryNumber:
233+
description: "The asset tag of the device."
234+
type: string
235+
storage_location:
236+
description: "The sys-id of the storage location of the device."
237+
type: string
238+
technician:
239+
description: "The technician performing the action. This string will appear in the activity stream."
240+
type: string
241+
comment:
242+
description: "A comment composed by the technician that will appear in the activity stream."
243+
type: string
244+
children:
245+
description: "The list of sys-id's of children to uninstall alongside the parent-device. This has to exactly match the existing children in the cmdb."
246+
type: array
247+
example: [
248+
{
249+
"child" : "0007047387bb39d06dc863540cbb0000"
250+
},
251+
{
252+
"child" : "0007047387bb39d06dc863540cbb0001"
253+
}
254+
]
255+
256+
required:
257+
- inventoryNumber
258+
- storage_location
259+
- technician
260+
- comment
261+
262+
responses:
263+
'200':
264+
description: OK
265+
content:
266+
application/json:
267+
schema:
268+
type: object
269+
properties:
270+
message:
271+
type: string
272+
example: "Device 23282978 was uninstalled successfully."
273+
'400':
274+
description: bad request
275+
content:
276+
application/json:
277+
schema:
278+
type: object
279+
properties:
280+
name:
281+
type: string
282+
example: "MyItRestException"
283+
message:
284+
type: string
285+
example: "inventoryNumber is missing or null in the request body."
286+
status:
287+
type: integer
288+
example: 400
289+
'403':
290+
description: forbidden
291+
content:
292+
application/json:
293+
schema:
294+
type: object
295+
properties:
296+
clazz:
297+
type: string
298+
example: "IllegalAccessException"
299+
status:
300+
type: integer
301+
example: 403
302+
message:
303+
type: string
304+
example: "You are not authorized to access this API"
305+
'500':
306+
description: Internal Server Error
307+
content:
308+
application/json:
309+
schema:
310+
type: object
311+
properties:
312+
clazz:
313+
type: string
314+
example: "MyItRestException"
315+
status:
316+
type: integer
317+
example: 500
318+
message:
319+
type: string
320+
example: "something went wrong writing data to the device"
321+
322+
components:
323+
securitySchemes:
324+
BasicAuth:
325+
type: http
326+
scheme: basic
327+

0 commit comments

Comments
 (0)