-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdns.yaml
More file actions
479 lines (477 loc) · 12.7 KB
/
dns.yaml
File metadata and controls
479 lines (477 loc) · 12.7 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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
openapi: 3.0.1
info:
title: DNS
description: |-
Manage dns zones and records
Parameters:
- `teamID`: To access services in a team
termsOfService: '#'
contact:
email: info@liara.ir
version: 1.0.0
externalDocs:
description: Find out more about DNS
url: http://liara.ir
servers:
- url: https://dns-service.iran.liara.ir
security:
- jwt: []
tags:
- name: Zone
description: Everything about your Zones
- name: Check Name Servers
description: Check Name Servers endpoints
- name: Dns Record
description: Dns Record of your zones
paths:
/api/v1/zones:
get:
tags:
- Zone
summary: List all zones
description: list all zones that user owns
operationId: getListZones
responses:
200:
description: An server
content:
application/json:
schema:
$ref: '#/components/schemas/Zones'
post:
tags:
- Zone
summary: Create Zone
description: creates a new zone on dns server
operationId: createZone
requestBody:
description: The zone to create
content:
application/json:
schema:
required:
- name
type: object
properties:
name:
type: string
required: true
responses:
201:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Create-zone'
400:
description: Bad Request
content: {}
401:
description: Missing authentication
content: {}
409:
description: Conflict
content: {}
500:
description: server does not response
content: {}
x-codegen-request-body-name: zone_struct
'/api/v1/zones/{zone}':
get:
tags:
- Zone
summary: Get Zone
description: Get this zone, all dns records
operationId: getZone
parameters:
- name: zone
in: path
description: The name of the zone
required: true
schema:
type: string
responses:
200:
description: zone details
content:
application/json:
schema:
$ref: '#/components/schemas/Create-zone'
401:
description: Missing authentication
content: {}
404:
description: Zone does not exists.
content: {}
delete:
tags:
- Zone
summary: Delete Zone
description: Deletes this zone, all dns records
operationId: deleteZone
parameters:
- name: zone
in: path
description: The name of the zone to delete
required: true
schema:
type: string
responses:
200:
description: Your request has been submitted.
content:
application/json:
schema:
$ref: '#/components/schemas/Submitted'
204:
description: Zone deleted.
content: {}
401:
description: Missing authentication
content: {}
404:
description: Zone does not exists.
content: {}
'/api/v1/zones/{zone}/check':
put:
tags:
- Check Name Servers
summary: check nameserver
description: check nameserver of zone
operationId: checkNameServer
parameters:
- name: zone
in: path
description: The name of the zone to check status
required: true
schema:
type: string
responses:
201:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Submitted'
400:
description: bad request maybe validation error on zone name
content: {}
401:
description: Missing authentication
content: {}
404:
description: Zone does not exists or its status is not pending
content: {}
406:
description: Please try later.
content: {}
500:
description: server does not response
content: {}
'/api/v1/zones/{zone}/dns-records':
get:
tags:
- Dns Record
summary: Get all dns record
description: Get all Dns Records on this zone
operationId: getListDnsRecords
parameters:
- name: zone
in: path
description: The name of the zone to see all dns records
required: true
schema:
type: string
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/All-dns-record-response'
400:
description: Bad request
content: {}
401:
description: Missing authentication
content: {}
404:
description: Zone Not Found
content: {}
post:
tags:
- Dns Record
summary: Create dns record
description: Creates a new dns record, returns the dns record on creation
operationId: createDnsRecord
parameters:
- name: zone
in: path
description: The name of the zone to create dns record
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Dns-record'
required: true
responses:
201:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Dns-record-response'
400:
description: Bad request
content: {}
401:
description: Missing authentication
content: {}
404:
description: Zone does not exists.
content: {}
409:
description: Conflict
content: {}
x-codegen-request-body-name: dns record
'/api/v1/zones/{zone}/dns-records/{id}':
get:
tags:
- Dns Record
summary: Get dns record
description: Get Dns Record data on this zone
operationId: getDnsRecord
parameters:
- name: zone
in: path
description: The name of the zone to see dns record
required: true
schema:
type: string
- name: id
in: path
description: The id of dns record to see its data
required: true
schema:
type: string
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Dns-record-response'
400:
description: Bad request
content: {}
401:
description: Missing authentication
content: {}
404:
description: Zone or dns record Not Found
content: {}
put:
tags:
- Dns Record
summary: edit dns record
description: you can not edit type of dns record
operationId: editDnsRecord
parameters:
- name: zone
in: path
description: The name of the zone to edit dns record
required: true
schema:
type: string
- name: id
in: path
description: The id of dns record to edit its data
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Dns-record'
required: true
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Dns-record-response'
400:
description: Bad request
content: {}
401:
description: Missing authentication
content: {}
404:
description: Zone does not exists.
content: {}
409:
description: Conflict
content: {}
x-codegen-request-body-name: dns record
delete:
tags:
- Dns Record
summary: delete dns record
description: Delete dns record from this zone
operationId: deleteDnsRecord
parameters:
- name: zone
in: path
description: The name of the zone to delete dns record
required: true
schema:
type: string
- name: id
in: path
description: The id of dns record to delete its data
required: true
schema:
type: string
responses:
204:
description: Successful operation
content: {}
400:
description: Bad request
content: {}
401:
description: Missing authentication
content: {}
404:
description: Zone does not exists.
content: {}
components:
schemas:
Zone:
type: object
properties:
id:
type: string
name:
type: string
description: 'The name of the zone, “liara.ir”, max length: 253, pattern:
^([a-zA-Z0-9][\-a-zA-Z0-9]*\.)+[\-a-zA-Z0-9]{2,20}$'
status:
type: string
description: 'The status of the zone, valid values: [CREATING, PENDING,
ACTIVE, DELETING]'
currentNameServers:
type: array
items:
type: string
nameServers:
type: array
items:
type: string
lastCheckAt:
type: string
description: Last time when zones nameservers was checked
createdAt:
type: string
description: Time when zone was created
Create-zone:
type: object
properties:
status:
type: string
data:
$ref: '#/components/schemas/Zone'
Zones:
type: object
properties:
status:
type: string
data:
type: array
items:
$ref: '#/components/schemas/Zone'
Dns-record:
type: object
properties:
name:
type: string
description: The name of dns record, "@" for zone name(root level), "*"
for wild card and any valid value with RFC 1123
type:
type: string
description: 'The type of dns record, valid values: [A, AAAA, TXT, CNAME,
ALIAS, MX, SRV, SPF, PTR]'
ttl:
type: number
description: 'The ttl of dns record, is not required, valid values: [120,
180, 300, 600, 900, 1800, 3600, 7200, 18000, 43200, 86400, 172800, 432000]'
contents:
type: array
description: Array of content of dns record, change base on type of dns
record
items:
type: object
properties: {}
Dns-record-id:
type: object
properties:
id:
type: string
description: The id of dns record which need in PUT, DELETE and GET method
name:
type: string
description: The name of dns record, "@" for zone name(root level), "*"
for wild card and any valid value with RFC 1123
type:
type: string
description: 'The type of dns record, valid values: [A, AAAA, TXT, CNAME,
ALIAS, MX, SRV, CAA]'
ttl:
type: number
description: 'The ttl of dns record, is not required, valid values: [120,
180, 300, 600, 900, 1800, 3600, 7200, 18000, 43200, 86400, 172800, 432000]'
contents:
type: array
description: Array of content of dns record, change base on type of dns
record
items:
type: object
properties: {}
Dns-record-response:
type: object
properties:
status:
type: string
description: success
data:
$ref: '#/components/schemas/Dns-record-id'
All-dns-record-response:
type: object
properties:
status:
type: string
description: success
data:
type: array
items:
$ref: '#/components/schemas/Dns-record-id'
Submitted:
type: object
properties:
status:
type: string
description: succes
data:
type: string
description: Your request has been submitted.
securitySchemes:
jwt:
type: apiKey
description: 'Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345". #'
name: Authorization
in: header