-
Notifications
You must be signed in to change notification settings - Fork 1
/
api_docs.json
256 lines (255 loc) · 6.59 KB
/
api_docs.json
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
256
{
"swagger": "2.0",
"info": {
"title": "Cranecloud status backend API",
"description": "Backend API for Cranecloud application status",
"version": "1.0.0",
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"basePath": "/",
"paths": {
"/api/v1/statuses": {
"get": {
"tags": ["status"],
"summary": "Get system status",
"description": "Get cranecloud service statuses",
"operationId": "getStatuses",
"produces": ["application/json"],
"responses": {
"200": {
"description": "Successfully retrieved System statuses"
},
"500": {
"description": "Internal Server error"
}
}
}
},
"/api/v1/statuses/series": {
"post": {
"tags": ["status"],
"summary": "Get and save current status",
"description": "Save current service statuses",
"operationId": "postStatusesSeries",
"produces": ["application/json"],
"responses": {
"201": {
"description": "Successfully saved System statuses"
},
"500": {
"description": "Internal Server error"
}
}
},
"get": {
"tags": ["status"],
"summary": "Get system status series",
"description": "Get service statuses series",
"parameters": [
{
"name": "series",
"in": "query",
"type": "boolean",
"description": "if set to true returns series data"
},
{
"name": "type",
"in": "query",
"type": "string",
"description": "The type of status"
},
{
"name": "start",
"in": "query",
"type": "number",
"description": "The start period of the data (timestamp)"
},
{
"name": "end",
"in": "query",
"type": "number",
"description": "The end period of the data (timestamp)"
}
],
"operationId": "getStatusesSeries",
"produces": ["application/json"],
"responses": {
"200": {
"description": "Successfully retrieved System statuses"
},
"500": {
"description": "Internal Server error"
}
}
}
},
"/api/v1/clusters": {
"get": {
"tags": ["clusters"],
"summary": "Gets all Clusters",
"produces": ["application/json"],
"responses": {
"201": {
"description": "Successfully gets Clusters"
},
"401": {
"description": "invalid input, object invalid"
},
"500": {
"description": "Server error"
}
}
},
"post": {
"tags": ["clusters"],
"summary": "Add a new cluster",
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"in": "body",
"name": "Cluster params",
"required": true,
"schema": {
"$ref": "#/definitions/cluster"
}
}
],
"responses": {
"201": {
"description": "Successfully added new cluster"
},
"401": {
"description": "invalid input, object invalid"
},
"500": {
"description": "Server error"
}
}
}
},
"/api/v1/clusters/{cluster_id}": {
"get": {
"tags": ["clusters"],
"summary": "Gets a single cluster",
"produces": ["application/json"],
"parameters": [
{
"in": "path",
"name": "cluster_id",
"required": true
}
],
"responses": {
"201": {
"description": "Successfully gets a single Cluster"
},
"401": {
"description": "invalid input, object invalid"
},
"404": {
"description": "Resource not found"
},
"500": {
"description": "Server error"
}
}
},
"patch": {
"tags": ["clusters"],
"summary": "Updates cluster info",
"consumes": ["application/json"],
"produces": ["application/json"],
"parameters": [
{
"in": "path",
"name": "cluster_id",
"required": true
},
{
"in": "body",
"name": "cluster params",
"required": false,
"schema": {
"$ref": "#/definitions/cluster"
}
}
],
"responses": {
"201": {
"description": "Successfully updates existing Cluster"
},
"401": {
"description": "invalid input, object invalid"
},
"404": {
"description": "Resource not found"
},
"500": {
"description": "Server error"
}
}
}
},
"/api/v1/uptime":{
"get": {
"tags": ["uptime"],
"summary": "Get system resources uptime",
"description": "Get service uptime percentages",
"parameters": [
{
"name": "resource_name",
"in": "query",
"type": "string",
"description": "A resource name such as cranecloud-frontend"
}
],
"operationId": "getSystemUptime",
"produces": ["application/json"],
"responses": {
"200": {
"description": "Successfully retrieved System Uptime"
},
"500": {
"description": "Internal Server error"
}
}
}
}
},
"definitions": {
"cluster": {
"type": "object",
"required": ["name", "host", "token", "description"],
"properties": {
"name": {
"type": "string",
"example": "cluster product"
},
"host": {
"type": "string",
"example": "cluster host url"
},
"token": {
"type": "string",
"example": "cluster token"
},
"description": {
"type": "string",
"example": "cluster description"
},
"prometheus_url": {
"type": "string",
"example": "cluster prometheus url"
},
"cost_modal_url": {
"type": "string",
"example": "cluster cost modal url"
}
}
}
}
}