Repository navigation
Expand file tree
/
Copy pathswagger.yaml
More file actions
344 lines (344 loc) · 9.86 KB
/
Copy pathswagger.yaml
File metadata and controls
344 lines (344 loc) · 9.86 KB
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
---
swagger: '2.0'
info:
description: REST API provided by CLI to work with project metadata and migrations.
version: 1.0.0
title: CLI REST APIs
host: localhost:9693
tags:
- name: metadata
externalDocs:
description: Find out more about hasura metadata
url: https://hasura.io/docs/latest/graphql/core/migrations/index.html
- name: migrate
externalDocs:
description: Find out more about hasura migrations
url: https://hasura.io/docs/latest/graphql/core/migrations/index.html
schemes:
- http
paths:
"/apis/metadata":
get:
tags:
- metadata
summary: Export metadata
description: To export metadata to source
operationId: GETmetadata
produces:
- application/json
parameters:
- name: export
in: query
description: boolean whether the metadata needs to be exported or not
type: boolean
default: true
responses:
'200':
description: OK
schema:
type: object
properties:
metadata:
type: string
description: shows Success for metadata key
examples:
application/json:
metadata: Success
'500':
description: internal server error
schema:
type: object
properties:
code:
description: shows internal_error for code key
type: string
message:
description: shows error in message key
type: string
examples:
application/json:
code: internal_error
message: cannot export version from metadata
post:
tags:
- metadata
summary: Export metadata
description: export metadata with up and down yaml files in v1 config
operationId: POSTmetadata
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
"$ref": "#/definitions/RequestBody"
responses:
'200':
description: metadata is exported
schema:
type: object
properties:
message:
type: string
description: shows Success for message key
examples:
application/json:
message: Success
'400':
description: when migration mode is enabled
schema:
type: object
properties:
code:
description: shows migration_mode_disabled for code key
type: string
message:
description: shows Migration mode is disabled in message key
type: string
examples:
application/json:
code: migration_mode_enabled
message: Migration mode is enabled
'500':
description: internal server error
schema:
type: object
properties:
code:
description: shows internal_error for code key
type: string
message:
description: shows error in message key
type: string
examples:
application/json:
code: internal_error
message: '{"path":"$","error":"parsing RQLMetadata failed, expected
Object, but encountered Array","code":"parse-failed"}'
"/apis/migrate":
get:
tags:
- migrate
summary: For gettting the details of datasource
description: to get the details of a datasource and the status of migrations
inside the datasource
operationId: GETmigrate
produces:
- application/json
parameters:
- name: datasource
in: query
description: datasource on which api needs to be executed
required: true
type: string
default: default
responses:
'200':
description: successful operation
schema:
type: object
properties:
migrations:
type: array
description: list of migrations versions in the datasource mentioned
items:
type: integer
format: uint64
status:
type: object
description: Is a object with migrations are the keys and the values
are objects with keys database_status and source_status.
examples:
application/json:
migrations:
- 1613932441857
status:
'1613932441857':
database_status: false
source_status: true
'500':
description: internal server error
schema:
type: object
properties:
code:
description: shows internal_error for code key
type: string
message:
description: shows error in message key
type: string
examples:
application/json:
code: internal_error
message: datasource query parameter is required
post:
tags:
- migrate
summary: Creating migrations on source
description: It creates the migrations of a datasource on source directory and
outputs the directory name of migration.
operationId: POSTmigrate
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
required: true
schema:
"$ref": "#/definitions/RequestBody"
responses:
'200':
description: OK
schema:
type: object
properties:
name:
description: shows directory name of migration created for name key
type: string
examples:
application/json:
name: 0_test1
'400':
description: migration mode was not enabled
schema:
type: object
properties:
code:
description: shows migration_mode_disabled for code key
type: string
message:
description: shows Migration mode is disabled in message key
type: string
examples:
application/json:
code: migration_mode_disabled
message: Migration mode is disabled
'500':
description: internal server error
schema:
type: object
properties:
code:
description: shows internal_error for code key
type: string
message:
description: shows error in message key
type: string
examples:
application/json:
code: internal_error
message: datasource key not found in body
"/apis/migrate/settings":
get:
tags:
- migrate
summary: Get the status of migration_mode
description: It gets the status of migration_mode (true/false.)
operationId: GETsettings
produces:
- application/json
responses:
'200':
description: successful operation
schema:
type: object
properties:
migration_mode:
description: shows true/false for migration_mode key
type: boolean
examples:
application/json:
migration_mode: 'true'
'500':
description: internal server error
schema:
type: object
properties:
code:
description: shows internal_error for code key
type: string
message:
description: shows error in message key
type: string
examples:
application/json:
code: internal_error
message: Something went wrong
put:
tags:
- migrate
summary: To set the migration_mode
description: It sets the migration_mode (true/false)
operationId: PUTsettings
consumes:
- application/json
produces:
- application/json
parameters:
- name: body
in: body
required: true
schema:
type: object
properties:
name:
type: string
value:
type: string
example:
application/json:
name: migration_mode
value: 'true'
responses:
'200':
description: successful operation
schema:
type: object
properties:
message:
description: shows Successfuly set for message key
type: string
examples:
message: Successfuly set
'500':
description: internal server error
schema:
type: object
properties:
code:
description: shows internal_error for code key
type: string
message:
description: shows error in message key
type: string
examples:
application/json:
code: internal_error
message: Something went wrong
definitions:
RequestBody:
type: object
properties:
name:
type: string
example: test1
up:
type: array
items: {}
down:
type: array
items: {}
skip_execution:
type: boolean
example: true
datasource:
type: string
example: default
externalDocs:
description: Find out more about hasura
url: https://hasura.io