forked from Improwised/cantaloupe
-
Notifications
You must be signed in to change notification settings - Fork 1
/
incidents.apib
133 lines (91 loc) · 3.42 KB
/
incidents.apib
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
# Group Incidents
- **id** : Id of incident(string, Required)
- **component_id** : Id of component on which incident happened(string, Required)
- **component** : Name of incident on which incident happened(string, Required)
- **machine** : Name of Machine(string, Required)
- **title** : Brief title of incident(string, Required)
- **description** : Entire description of incident (string, Optional)
- **status** : status of comonent whether its in process or not(string, Required)
- **resolved_at** : Timestamp of resolved component(string, Required)
## Incidents [/incidents]
Incidents dealing with components.
### List Incidents [GET]
+ Response 200 (application/json)
+ Headers
+ Body
[{
"id" : 1,
"component_id" : 1,
"component" : "Mouse",
"machine" : "Mako",
"recorder" : "Rakshit Menpara",
"title" : "Component Damaged",
"description" : "component damaged Due to power cut",
"status" : "active",
"resolved_at" : "2016-08-08T02:15:15Z"
}]
### Add New Incident [POST]
+ Request (application/json)
+ Attributes
+ component_id: `1`
+ recorder: `Rakshit Menpara`
+ title: `Component Damaged`
+ description: `Component damaged Due to power cut`
+ Response 201
## Edit incident [/incidents/{incident_id}]
### Edit incident[PATCH]
+ Parameters
+ incident_id: 1 - Id of incident to be update
+ Request (application/json)
+ Attributes
+ component_id: `1`,
+ title: `Component Damaged`,
+ recorder: `Shailesh Davara`,
+ description: `Component damaged Due to power cut`
+ Response 200
### Delete Incident[DELETE]
+ Parameters
+ incident_id : 1 - id of incident to delete
+ Response 204
### Display Info of One Incident[GET]
+ Parameters
+ incident_id : 1 - Id of incident to display
+ Response 200 (application/json)
+ Headers
+ Body
{
"id" : 1,
"component_id" : 1,
"title" : "Component Damaged",
"description" : "component damaged Due to power cut",
"recorder" : "Rakshit Menpara",
"status" : "active",
"resolved_at" : "2016-08-08T02:15:15Z",
"created_at" : "2016-08-08T02:15:15Z",
"modified_at" : "2016-08-08T02:15:15Z"
}
## Update incident [/incidents/{incident_id}/update{?resolved}]
### Add incident update[POST]
+ Parameters
+ incident_id: 1 - Id of incident to be update
+ resolved: false - true If incident is resolved successfully or component replace with new component successfully.
+ Request (application/json)
+ Attributes
+ incident_id: `1`,
+ updated_by: `Rakshit Menpara`,
+ description: `Component has been depatured for replacement`
+ Response 200
###Add Replaced Component [/incidents/{incident_id}/addComponent]
## Add Replaced Component[POST]
+ Parameters
+ incident_id : 1 - id of incident to delete
+ Request (application/json)
+ Attributes
+ incident_id: `1`,
+ updated_by: `Rakshit Menpara`,
+ component(object)
- serial_no : `12SOECE11230`
- name : Mouse(string)
- category : 1
- description : 'This component has been replaced successfully after incident happened on it.'
+ Response 200