-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 5e1c296 🚀
- Loading branch information
1 parent
af13a0d
commit 3152bbb
Showing
1 changed file
with
327 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,327 @@ | ||
openapi: '3.0.2' | ||
info: | ||
title: DispoAPI | ||
description: handles inventory changes in MyIT cmdb for DispoTool. | ||
version: '0.0.1' | ||
|
||
servers: | ||
- url: https://myit-dev.post.ch/api/x_ssagd_dispoapi/dispoapi | ||
description: development server | ||
|
||
security: | ||
- BasicAuth: [] | ||
|
||
paths: | ||
/switchDevice: | ||
patch: | ||
summary: Switches one device for another in the cmdb, including any children the old device might have had. | ||
description: tbd | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
inventoryNumber_old: | ||
description: "The asset tag of the old device." | ||
type: string | ||
inventoryNumber_new: | ||
description: "The asset tag of the new device." | ||
type: string | ||
storage_location: | ||
description: "The sys-id of the storage location of the old device." | ||
type: string | ||
technician: | ||
description: "The technician performing the action. This string will appear in the activity stream." | ||
type: string | ||
comment: | ||
description: "A comment composed by the technician that will appear in the activity stream." | ||
type: string | ||
required: | ||
- inventoryNumber_old | ||
- inventoryNumber_new | ||
- storage_location | ||
- technician | ||
- comment | ||
|
||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
example: "Device 23282978 was switched for 23271091 successfully." | ||
'400': | ||
description: bad request | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
example: "MyItRestException" | ||
message: | ||
type: string | ||
example: "inventoryNumber_old is missing or null in the request body." | ||
status: | ||
type: integer | ||
example: 400 | ||
'403': | ||
description: forbidden | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
clazz: | ||
type: string | ||
example: "IllegalAccessException" | ||
status: | ||
type: integer | ||
example: 403 | ||
message: | ||
type: string | ||
example: "You are not authorized to access this API" | ||
'500': | ||
description: Internal Server Error | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
clazz: | ||
type: string | ||
example: "MyItRestException" | ||
status: | ||
type: integer | ||
example: 500 | ||
message: | ||
type: string | ||
example: "something went wrong while writing data to the new device" | ||
|
||
/installDevice: | ||
patch: | ||
summary: Installs a device in the cmdb | ||
description: tbd | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
inventoryNumber: | ||
description: "The asset tag of the device." | ||
type: string | ||
location: | ||
description: "The location of the device." | ||
type: string | ||
technician: | ||
description: "The technician performing the action. This string will appear in the activity stream." | ||
type: string | ||
comment: | ||
description: "A comment composed by the technician that will appear in the activity stream." | ||
type: string | ||
assigned_to: | ||
description: "The sys-id of the user of the device." | ||
type: string | ||
cost_center: | ||
description: "The sys-id of the cost-center of the device." | ||
type: string | ||
children: | ||
description: "Any children to install alongside the device containing the sys-id of the child as well as the name of the relation." | ||
type: array | ||
example: [ | ||
{ | ||
"child" : "0007047387bb39d06dc863540cbb0000", | ||
"relation" : "Connects to::Connected by" | ||
}, | ||
{ | ||
"child" : "0007047387bb39d06dc863540cbb0001", | ||
"relation" : "Connects to::Connected by" | ||
} | ||
] | ||
parents: | ||
description: "Any parents the device has containing the sys-id of the parent as well as the name of the relation." | ||
type: array | ||
example: [ | ||
{ | ||
"parent" : "0007047387bb39d06dc863540cbb0000", | ||
"relation" : "Connects to::Connected by" | ||
} | ||
] | ||
required: | ||
- inventoryNumber | ||
- location | ||
- technician | ||
- comment | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
example: "Device 23282978 was installed successfully." | ||
'400': | ||
description: bad request | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
example: "MyItRestException" | ||
message: | ||
type: string | ||
example: "inventoryNumber is missing or null in the request body." | ||
status: | ||
type: integer | ||
example: 400 | ||
'403': | ||
description: forbidden | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
clazz: | ||
type: string | ||
example: "IllegalAccessException" | ||
status: | ||
type: integer | ||
example: 403 | ||
message: | ||
type: string | ||
example: "You are not authorized to access this API" | ||
'500': | ||
description: Internal Server Error | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
clazz: | ||
type: string | ||
example: "MyItRestException" | ||
status: | ||
type: integer | ||
example: 500 | ||
message: | ||
type: string | ||
example: "something went wrong writing data to the new device" | ||
|
||
/uninstallDevice: | ||
patch: | ||
summary: Uninstalls a device in the cmdb including any children passed in the request. | ||
description: tbd | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
inventoryNumber: | ||
description: "The asset tag of the device." | ||
type: string | ||
storage_location: | ||
description: "The sys-id of the storage location of the device." | ||
type: string | ||
technician: | ||
description: "The technician performing the action. This string will appear in the activity stream." | ||
type: string | ||
comment: | ||
description: "A comment composed by the technician that will appear in the activity stream." | ||
type: string | ||
children: | ||
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." | ||
type: array | ||
example: [ | ||
{ | ||
"child" : "0007047387bb39d06dc863540cbb0000" | ||
}, | ||
{ | ||
"child" : "0007047387bb39d06dc863540cbb0001" | ||
} | ||
] | ||
|
||
required: | ||
- inventoryNumber | ||
- storage_location | ||
- technician | ||
- comment | ||
|
||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
message: | ||
type: string | ||
example: "Device 23282978 was uninstalled successfully." | ||
'400': | ||
description: bad request | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
example: "MyItRestException" | ||
message: | ||
type: string | ||
example: "inventoryNumber is missing or null in the request body." | ||
status: | ||
type: integer | ||
example: 400 | ||
'403': | ||
description: forbidden | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
clazz: | ||
type: string | ||
example: "IllegalAccessException" | ||
status: | ||
type: integer | ||
example: 403 | ||
message: | ||
type: string | ||
example: "You are not authorized to access this API" | ||
'500': | ||
description: Internal Server Error | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
clazz: | ||
type: string | ||
example: "MyItRestException" | ||
status: | ||
type: integer | ||
example: 500 | ||
message: | ||
type: string | ||
example: "something went wrong writing data to the device" | ||
|
||
components: | ||
securitySchemes: | ||
BasicAuth: | ||
type: http | ||
scheme: basic | ||
|