-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
224 lines (219 loc) · 5.43 KB
/
swagger.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
swagger: '2.0'
info:
title: Status
description: Status Dashboard API
version: "1.0.0"
# the domain of the service
host: example.com
# array of all schemes that your API supports
schemes:
- http
# will be prefixed to all paths
basePath: /api/v1
produces:
- application/json
paths:
/services:
get:
summary: All Services
description: |
Returns a list of all configured services.
tags:
- Services
responses:
200:
description: An array of services
schema:
$ref: '#/definitions/Services'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
summary: Create Service
description: Create a new service.
tags:
- Services
responses:
201:
description: Service created
headers:
Location:
description: Location of the newly created service
type: string
/services/{serviceId}:
get:
summary: Service Details
description: Returns specific service by id.
tags:
- Services
parameters:
- name: serviceId
in: path
required: true
description: The id of the service to retrieve
type: string
responses:
200:
description: The requested service
schema:
$ref: '#/definitions/Service'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/incidents:
get:
summary: Incidents List
description: Returns a list of all incidents
tags:
- Incidents
responses:
200:
description: A list of incidents
schema:
type: array
items:
$ref: '#/definitions/Incident'
post:
summary: Create a new incident
description: foo
tags:
- Incidents
parameters:
- name: incident
in: body
description: Incident to create
required: true
schema:
$ref: '#/definitions/NewIncident'
responses:
200:
description: foo
/incidents/{incidentId}:
get:
summary: Incident Details
description: Details about an incident and updates made to it.
tags:
- Incidents
parameters:
- name: incidentId
type: string
in: path
required: true
description: Unique ID of the incident
responses:
200:
description: The requested incident
post:
summary: Update Incident
description: Update the specified incident.
tags:
- Incidents
parameters:
- name: incidentId
in: path
description: Unique ID of the incident
required: true
type: string
- name: incidentUpdate
in: body
description: The update being made to the incident
required: true
schema:
$ref: '#/definitions/IncidentUpdate'
responses:
200:
description: The updated incident
schema:
$ref: '#/definitions/Incident'
definitions:
Services:
type: object
properties:
data:
type: array
items:
$ref: '#/definitions/Service'
bar:
type: string
Service:
type: object
properties:
id:
type: string
description: Unique identifier for the service.
name:
type: string
description: Short name for the service.
description:
type: string
description: Description of the service.
IncidentCommon:
type: object
properties:
title:
type: string
description: Title of the incident.
state:
type: string
description: The current state of the incident.
type:
type: string
description: The type of the incident.
serviceStatusId:
type: string
description: The current state of any affected services
affectedServiceIds:
type: array
description: A list of ids of affected services.
items:
type: string
description: The id of an affected service.
Incident:
allOf:
- $ref: '#/definitions/IncidentCommon'
- required:
- id
properties:
id:
type: string
description: Unique identifier for the incident.
incidentUpdates:
type: array
items:
$ref: '#/definitions/IncidentUpdate'
NewIncident:
allOf:
- $ref: '#/definitions/IncidentCommon'
- required:
- description
properties:
description:
type: string
description: Description to be applied to the initial update for the incident.
IncidentUpdate:
type: object
properties:
id:
type: string
description: Unique identifier for this incident update.
description:
type: string
description: A description for this update.
state:
type: string
description: The new state for this incident and affected services.
updatedBy:
type: string
description: Id of the user who created this incident.
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string