]> git.ipfire.org Git - thirdparty/pdns.git/blame - docs/http-api/swagger/authoritative-api-swagger.yaml
auth: api, remove set-ptr
[thirdparty/pdns.git] / docs / http-api / swagger / authoritative-api-swagger.yaml
CommitLineData
0e66609b
AJS
1swagger: '2.0'
2info:
c670db3a 3 version: "0.0.13"
0e66609b
AJS
4 title: PowerDNS Authoritative HTTP API
5 license:
6 name: MIT
7host: localhost:8081
8basePath: /api/v1
9schemes:
10 - http
11consumes:
12 - application/json
13produces:
14 - application/json
15securityDefinitions:
16 # X-API-Key: abcdef12345
17 APIKeyHeader:
18 type: apiKey
19 in: header
20 name: X-API-Key
21security:
22 - APIKeyHeader: []
23
24# Overall TODOS:
25# TODO: Return types are not consistent across documentation
26# We need to look at the code and figure out the default HTTP response
27# codes and adjust docs accordingly.
28paths:
29 '/servers':
30 get:
31 summary: List all servers
32 operationId: listServers
33 tags:
34 - servers
35 responses:
36 '200':
37 description: An array of servers
38 schema:
39 type: array
40 items:
41 $ref: '#/definitions/Server'
42
43 '/servers/{server_id}':
44 get:
45 summary: List a server
46 operationId: listServer
47 tags:
48 - servers
49 parameters:
50 - name: server_id
51 in: path
52 required: true
53 description: The id of the server to retrieve
54 type: string
55 responses:
56 '200':
57 description: An server
58 schema:
59 $ref: '#/definitions/Server'
60
7a93af1e
PL
61 '/servers/{server_id}/cache/flush':
62 put:
63 summary: Flush a cache-entry by name
64 operationId: cacheFlushByName
65 tags:
66 - servers
67 parameters:
68 - name: server_id
69 in: path
70 required: true
71 description: The id of the server to retrieve
72 type: string
73 - name: domain
74 in: query
75 required: true
76 description: The domain name to flush from the cache
77 type: string
78 responses:
79 '200':
80 description: Flush successful
81 schema:
82 $ref: '#/definitions/CacheFlushResult'
83
0e66609b
AJS
84 '/servers/{server_id}/zones':
85 get:
86 summary: List all Zones in a server
87 operationId: listZones
88 tags:
89 - zones
90 parameters:
91 - name: server_id
92 in: path
93 required: true
94 description: The id of the server to retrieve
95 type: string
76e96a86
PL
96 - name: zone
97 in: query
98 required: false
99 type: string
100 description: |
101 When set to the name of a zone, only this zone is returned.
102 If no zone with that name exists, the response is an empty array.
103 This can e.g. be used to check if a zone exists in the database without having to guess/encode the zone's id or to check if a zone exists.
4a3ce69b
PD
104 - name: dnssec
105 in: query
106 required: false
107 type: boolean
108 default: true
109 description: '“true” (default) or “false”, whether to include the “dnssec” and ”edited_serial” fields in the Zone objects. Setting this to ”false” will make the query a lot faster.'
0e66609b
AJS
110 responses:
111 '200':
112 description: An array of Zones
113 schema:
114 type: array
115 items:
116 $ref: '#/definitions/Zone'
117 post:
118 summary: Creates a new domain, returns the Zone on creation.
119 operationId: createZone
120 tags:
121 - zones
122 parameters:
123 - name: server_id
124 in: path
125 required: true
126 description: The id of the server to retrieve
127 type: string
128 - name: rrsets
129 in: query
130 description: '“true” (default) or “false”, whether to include the “rrsets” in the response Zone object.'
131 type: boolean
132 default: true
cce8c6d6
CM
133 - name: zone_struct
134 description: The zone struct to patch with
135 required: true
136 in: body
137 schema:
138 $ref: '#/definitions/Zone'
0e66609b
AJS
139 responses:
140 '201':
141 description: A zone
142 schema:
143 $ref: '#/definitions/Zone'
144
145 '/servers/{server_id}/zones/{zone_id}':
146 get:
147 summary: zone managed by a server
148 operationId: listZone
149 tags:
150 - zones
151 parameters:
152 - name: server_id
153 in: path
154 required: true
155 description: The id of the server to retrieve
156 type: string
157 - name: zone_id
158 type: string
159 in: path
160 required: true
161 description: The id of the zone to retrieve
f0ad7ca9
KF
162 - name: rrsets
163 in: query
164 description: '“true” (default) or “false”, whether to include the “rrsets” in the response Zone object.'
165 type: boolean
166 default: true
0e66609b
AJS
167 responses:
168 '200':
169 description: A Zone
170 schema:
171 $ref: '#/definitions/Zone'
172 delete:
173 summary: Deletes this zone, all attached metadata and rrsets.
174 operationId: deleteZone
175 tags:
176 - zones
177 parameters:
178 - name: server_id
179 in: path
180 required: true
181 description: The id of the server to retrieve
182 type: string
183 - name: zone_id
184 type: string
185 in: path
186 required: true
187 description: The id of the zone to retrieve
188 responses:
17754fdf
CH
189 '204':
190 description: 'Returns 204 No Content on success.'
0e66609b 191 patch:
91f9cff3 192 summary: 'Creates/modifies/deletes RRsets present in the payload and their comments. Returns 204 No Content on success.'
0e66609b
AJS
193 operationId: patchZone
194 tags:
195 - zones
196 parameters:
197 - name: server_id
198 in: path
199 required: true
200 description: The id of the server to retrieve
201 type: string
202 - name: zone_id
203 type: string
204 in: path
205 required: true
206 - name: zone_struct
207 description: The zone struct to patch with
208 required: true
209 in: body
210 schema:
211 $ref: '#/definitions/Zone'
212 responses:
213 '204':
214 description: 'Returns 204 No Content on success.'
215
216 put:
217 summary: Modifies basic zone data (metadata).
218 description: 'Allowed fields in client body: all except id, url and name. Returns 204 No Content on success.'
219 operationId: putZone
220 tags:
221 - zones
222 parameters:
223 - name: server_id
224 in: path
225 required: true
226 description: The id of the server to retrieve
227 type: string
228 - name: zone_id
229 type: string
230 in: path
231 required: true
232 - name: zone_struct
233 description: The zone struct to patch with
234 required: true
235 in: body
236 schema:
237 $ref: '#/definitions/Zone'
238 responses:
239 '204':
240 description: 'Returns 204 No Content on success.'
241
242 '/servers/{server_id}/zones/{zone_id}/notify':
243 put:
244 summary: Send a DNS NOTIFY to all slaves.
245 description: 'Fails when zone kind is not Master or Slave, or master and slave are disabled in the configuration. Only works for Slave if renotify is on. Clients MUST NOT send a body.'
246 operationId: notifyZone
247 tags:
248 - zones
249 parameters:
250 - name: server_id
251 in: path
252 required: true
253 description: The id of the server to retrieve
254 type: string
255 - name: zone_id
256 type: string
257 in: path
258 required: true
259 description: The id of the zone to retrieve
260 responses:
261 '200':
262 description: OK
263
264 '/servers/{server_id}/zones/{zone_id}/axfr-retrieve':
265 put:
e8b0ea97
PL
266 summary: Retrieve slave zone from its master.
267 description: 'Fails when zone kind is not Slave, or slave is disabled in the configuration. Clients MUST NOT send a body.'
0e66609b
AJS
268 operationId: axfrRetrieveZone
269 tags:
270 - zones
271 parameters:
272 - name: server_id
273 in: path
274 required: true
275 description: The id of the server to retrieve
276 type: string
277 - name: zone_id
278 type: string
279 in: path
280 required: true
281 description: The id of the zone to retrieve
282 responses:
283 '200':
284 description: OK
285
286 '/servers/{server_id}/zones/{zone_id}/export':
287 get:
288 summary: 'Returns the zone in AXFR format.'
289 operationId: axfrExportZone
290 tags:
291 - zones
292 parameters:
293 - name: server_id
294 in: path
295 required: true
296 description: The id of the server to retrieve
0e66609b
AJS
297 type: string
298 - name: zone_id
299 type: string
300 in: path
301 required: true
302 description: The id of the zone to retrieve
303 responses:
304 '200':
305 description: OK
306 schema:
307 type: string
308
309 '/servers/{server_id}/zones/{zone_id}/rectify':
310 put:
311 summary: 'Rectify the zone data.'
312 description: 'This does not take into account the API-RECTIFY metadata. Fails on slave zones and zones that do not have DNSSEC.'
313 operationId: rectifyZone
314 tags:
315 - zones
316 parameters:
317 - name: server_id
318 in: path
319 required: true
320 description: The id of the server to retrieve
321 type: string
322 - name: zone_id
323 type: string
324 in: path
325 required: true
326 description: The id of the zone to retrieve
327 responses:
328 '200':
329 description: OK
330 schema:
331 type: string
332
333 '/servers/{server_id}/config':
334 get:
335 summary: 'Returns all ConfigSettings for a single server'
336 operationId: getConfig
337 tags:
338 - config
339 parameters:
340 - name: server_id
341 in: path
342 required: true
343 description: The id of the server to retrieve
344 type: string
345 responses:
346 '200':
347 description: List of config values
348 schema:
349 type: array
350 items:
351 $ref: '#/definitions/ConfigSetting'
352
353 '/servers/{server_id}/config/{config_setting_name}':
354 get:
355 summary: 'Returns a specific ConfigSetting for a single server'
356 description: 'NOT IMPLEMENTED'
357 operationId: getConfigSetting
358 tags:
359 - config
360 parameters:
361 - name: server_id
362 in: path
363 required: true
364 description: The id of the server to retrieve
365 type: string
366 - name: config_setting_name
367 in: path
368 required: true
369 description: The name of the setting to retrieve
370 type: string
371 responses:
372 '200':
373 description: List of config values
374 schema:
375 $ref: '#/definitions/ConfigSetting'
376
377 '/servers/{server_id}/statistics':
378 get:
379 summary: 'Query statistics.'
300c6dde 380 description: 'Query PowerDNS internal statistics.'
0e66609b
AJS
381 operationId: getStats
382 tags:
383 - stats
384 parameters:
385 - name: server_id
386 in: path
387 required: true
388 description: The id of the server to retrieve
389 type: string
5376a5d7
RG
390 - name: statistic
391 in: query
392 required: false
393 type: string
394 description: |
395 When set to the name of a specific statistic, only this value is returned.
396 If no statistic with that name exists, the response has a 422 status and an error message.
c65b5e12
PD
397 - name: includerings
398 in: query
399 required: false
400 type: boolean
401 default: true
402 description: '“true” (default) or “false”, whether to include the Ring items, which can contain thousands of log messages or queried domains. Setting this to ”false” may make the response a lot smaller.'
0e66609b
AJS
403 responses:
404 '200':
405 description: List of Statistic Items
406 schema:
407 type: array
408 items:
ddbabc66
MH
409 - $ref: '#/definitions/StatisticItem'
410 - $ref: '#/definitions/MapStatisticItem'
411 - $ref: '#/definitions/RingStatisticItem'
5376a5d7
RG
412 '422':
413 description: 'Returned when a non-existing statistic name has been requested. Contains an error message'
0e66609b 414
0e66609b
AJS
415 '/servers/{server_id}/search-data':
416 get:
417 summary: 'Search the data inside PowerDNS'
418 description: 'Search the data inside PowerDNS for search_term and return at most max_results. This includes zones, records and comments. The * character can be used in search_term as a wildcard character and the ? character can be used as a wildcard for a single character.'
419 operationId: searchData
420 tags:
421 - search
422 parameters:
423 - name: server_id
424 in: path
425 required: true
426 description: The id of the server to retrieve
427 type: string
428 - name: q
429 in: query
430 required: true
431 description: 'The string to search for'
432 type: string
433 - name: max
434 in: query
435 required: true
436 description: 'Maximum number of entries to return'
437 type: integer
0bd91de6 438 - name: object_type
45250285
JE
439 in: query
440 required: false
441 description: 'Type of data to search for, one of “all”, “zone”, “record”, “comment”'
442 type: string
0e66609b
AJS
443 responses:
444 '200':
dd22c4de 445 description: Returns a JSON array with results
0e66609b
AJS
446 schema:
447 $ref: '#/definitions/SearchResults'
448
449 '/servers/{server_id}/zones/{zone_id}/metadata':
450 get:
250ad2a2 451 summary: 'Get all the Metadata associated with the zone.'
aa4c7f15 452 operationId: listMetadata
0e66609b
AJS
453 tags:
454 - zonemetadata
455 parameters:
456 - name: server_id
457 in: path
458 required: true
459 description: The id of the server to retrieve
460 type: string
461 - name: zone_id
462 type: string
463 in: path
464 required: true
465 description: The id of the zone to retrieve
466 responses:
467 '200':
468 description: List of Metadata objects
469 schema:
470 type: array
471 items:
42bff7ba 472 $ref: '#/definitions/Metadata'
0e66609b
AJS
473 post:
474 summary: 'Creates a set of metadata entries'
475 description: 'Creates a set of metadata entries of given kind for the zone. Existing metadata entries for the zone with the same kind are not overwritten.'
aa4c7f15 476 operationId: createMetadata
0e66609b
AJS
477 tags:
478 - zonemetadata
479 parameters:
480 - name: server_id
481 in: path
482 required: true
483 description: The id of the server to retrieve
484 type: string
485 - name: zone_id
486 type: string
487 in: path
488 required: true
489 - name: metadata
250ad2a2 490 description: Metadata object with list of values to create
0e66609b
AJS
491 required: true
492 in: body
493 schema:
250ad2a2 494 $ref: '#/definitions/Metadata'
0e66609b
AJS
495 responses:
496 '204':
497 description: OK
498
499 '/servers/{server_id}/zones/{zone_id}/metadata/{metadata_kind}':
500 get:
250ad2a2 501 summary: 'Get the content of a single kind of domain metadata as a Metadata object.'
aa4c7f15 502 operationId: getMetadata
0e66609b
AJS
503 tags:
504 - zonemetadata
505 parameters:
506 - name: server_id
507 in: path
508 required: true
509 description: The id of the server to retrieve
510 type: string
511 - name: zone_id
512 type: string
513 in: path
514 required: true
515 description: The id of the zone to retrieve
516 - name: metadata_kind
517 type: string
518 in: path
519 required: true
250ad2a2 520 description: The kind of metadata
0e66609b
AJS
521 responses:
522 '200':
250ad2a2 523 description: Metadata object with list of values
0e66609b 524 schema:
42bff7ba 525 $ref: '#/definitions/Metadata'
0e66609b 526 put:
250ad2a2
KF
527 summary: 'Replace the content of a single kind of domain metadata.'
528 description: 'Creates a set of metadata entries of given kind for the zone. Existing metadata entries for the zone with the same kind are removed.'
aa4c7f15 529 operationId: modifyMetadata
0e66609b
AJS
530 tags:
531 - zonemetadata
532 parameters:
533 - name: server_id
534 in: path
535 required: true
536 description: The id of the server to retrieve
537 type: string
538 - name: zone_id
539 type: string
540 in: path
541 required: true
42bff7ba
PL
542 - name: metadata_kind
543 description: The kind of metadata
544 required: true
545 type: string
546 in: path
0e66609b 547 - name: metadata
42bff7ba 548 description: metadata to add/create
0e66609b
AJS
549 required: true
550 in: body
551 schema:
42bff7ba 552 $ref: '#/definitions/Metadata'
0e66609b 553 responses:
ecb5b8cb
KF
554 '200':
555 description: Metadata object with list of values
556 schema:
557 $ref: '#/definitions/Metadata'
0e66609b
AJS
558 delete:
559 summary: 'Delete all items of a single kind of domain metadata.'
aa4c7f15 560 operationId: deleteMetadata
0e66609b
AJS
561 tags:
562 - zonemetadata
563 parameters:
564 - name: server_id
565 in: path
566 required: true
567 description: The id of the server to retrieve
568 type: string
569 - name: zone_id
570 type: string
571 in: path
572 required: true
573 description: The id of the zone to retrieve
574 - name: metadata_kind
575 type: string
576 in: path
577 required: true
250ad2a2 578 description: The kind of metadata
0e66609b 579 responses:
0f84c0e6 580 '200':
0e66609b
AJS
581 description: OK
582
583 '/servers/{server_id}/zones/{zone_id}/cryptokeys':
584 get:
585 summary: 'Get all CryptoKeys for a zone, except the privatekey'
aa4c7f15 586 operationId: listCryptokeys
0e66609b 587 tags:
aa4c7f15 588 - zonecryptokey
0e66609b
AJS
589 parameters:
590 - name: server_id
591 in: path
592 required: true
593 description: The id of the server to retrieve
594 type: string
595 - name: zone_id
596 type: string
597 in: path
598 required: true
599 description: The id of the zone to retrieve
600 responses:
601 '200':
aa4c7f15 602 description: List of Cryptokey objects
0e66609b
AJS
603 schema:
604 type: array
605 items:
42bff7ba 606 $ref: '#/definitions/Cryptokey'
0e66609b
AJS
607 post:
608 summary: 'Creates a Cryptokey'
609 description: 'This method adds a new key to a zone. The key can either be generated or imported by supplying the content parameter. if content, bits and algo are null, a key will be generated based on the default-ksk-algorithm and default-ksk-size settings for a KSK and the default-zsk-algorithm and default-zsk-size options for a ZSK.'
aa4c7f15 610 operationId: createCryptokey
0e66609b 611 tags:
aa4c7f15 612 - zonecryptokey
0e66609b
AJS
613 parameters:
614 - name: server_id
615 in: path
616 required: true
617 description: The id of the server to retrieve
618 type: string
619 - name: zone_id
620 type: string
621 in: path
622 required: true
aa4c7f15
AJS
623 - name: cryptokey
624 description: Add a Cryptokey
0e66609b
AJS
625 required: true
626 in: body
627 schema:
42bff7ba 628 $ref: '#/definitions/Cryptokey'
0e66609b 629 responses:
42bff7ba
PL
630 '201':
631 description: Created
632 schema:
633 $ref: '#/definitions/Cryptokey'
0e66609b
AJS
634
635 '/servers/{server_id}/zones/{zone_id}/cryptokeys/{cryptokey_id}':
636 get:
637 summary: 'Returns all data about the CryptoKey, including the privatekey.'
0b078d2d 638 operationId: getCryptokey
0e66609b 639 tags:
aa4c7f15 640 - zonecryptokey
0e66609b
AJS
641 parameters:
642 - name: server_id
643 in: path
644 required: true
645 description: The id of the server to retrieve
646 type: string
647 - name: zone_id
648 type: string
649 in: path
650 required: true
651 description: The id of the zone to retrieve
652 - name: cryptokey_id
653 type: string
654 in: path
655 required: true
656 description: 'The id value of the CryptoKey'
657 responses:
658 '200':
42bff7ba 659 description: Cryptokey
0e66609b 660 schema:
42bff7ba 661 $ref: '#/definitions/Cryptokey'
0e66609b
AJS
662 put:
663 summary: 'This method (de)activates a key from zone_name specified by cryptokey_id'
664 operationId: modifyCryptokey
665 tags:
aa4c7f15 666 - zonecryptokey
0e66609b
AJS
667 parameters:
668 - name: server_id
669 in: path
670 required: true
671 description: The id of the server to retrieve
672 type: string
673 - name: zone_id
674 type: string
675 in: path
676 required: true
677 - name: cryptokey_id
678 description: Cryptokey to manipulate
679 required: true
42bff7ba
PL
680 in: path
681 type: string
682 - name: cryptokey
683 description: the Cryptokey
684 required: true
0e66609b
AJS
685 in: body
686 schema:
42bff7ba 687 $ref: '#/definitions/Cryptokey'
0e66609b
AJS
688 responses:
689 '204':
690 description: OK
691 '422':
692 description: 'Returned when something is wrong with the content of the request. Contains an error message'
693 delete:
694 summary: 'This method deletes a key specified by cryptokey_id.'
695 operationId: deleteCryptokey
696 tags:
aa4c7f15 697 - zonecryptokey
0e66609b
AJS
698 parameters:
699 - name: server_id
700 in: path
701 required: true
702 description: The id of the server to retrieve
703 type: string
704 - name: zone_id
705 type: string
706 in: path
707 required: true
708 description: The id of the zone to retrieve
709 - name: cryptokey_id
710 type: string
711 in: path
712 required: true
713 description: 'The id value of the Cryptokey'
714 responses:
715 '204':
716 description: OK
717 '422':
718 description: 'Returned when something is wrong with the content of the request. Contains an error message'
719
d4556db1
PL
720 '/servers/{server_id}/tsigkeys':
721 parameters:
722 - name: server_id
723 in: path
724 required: true
725 description: 'The id of the server'
726 type: string
727 get:
728 summary: 'Get all TSIGKeys on the server, except the actual key'
729 operationId: listTSIGKeys
730 tags:
731 - tsigkey
732 responses:
733 '200':
734 description: List of TSIGKey objects
735 schema:
736 type: array
737 items:
738 $ref: '#/definitions/TSIGKey'
739 '500':
740 description: 'Internal Server Error, keys could not be retrieved. Contains error message'
741 schema:
742 $ref: '#/definitions/Error'
743 post:
744 summary: 'Add a TSIG key'
745 description: 'This methods add a new TSIGKey. The actual key can be generated by the server or be provided by the client'
746 operationId: createTSIGKey
747 tags:
748 - tsigkey
749 parameters:
750 - name: tsigkey
751 description: The TSIGKey to add
752 required: true
753 in: body
754 schema:
755 $ref: '#/definitions/TSIGKey'
756 responses:
757 '201':
758 description: Created
759 schema:
760 $ref: '#/definitions/TSIGKey'
761 '409':
762 description: 'Conflict. A key with this name already exists'
763 schema:
764 $ref: '#/definitions/Error'
765 '422':
766 description: 'Unprocessable Entry, the TSIGKey provided has issues.'
767 schema:
768 $ref: '#/definitions/Error'
769 '500':
770 description: 'Internal Server Error. There was a problem creating the key'
771 schema:
772 $ref: '#/definitions/Error'
773
774 '/servers/{server_id}/tsigkeys/{tsigkey_id}':
775 parameters:
776 - name: server_id
777 in: path
778 required: true
779 description: 'The id of the server to retrieve the key from'
780 type: string
781 - name: tsigkey_id
782 in: path
783 required: true
784 description: 'The id of the TSIGkey. Should match the "id" field in the TSIGKey object'
785 type: string
786 get:
787 summary: 'Get a specific TSIGKeys on the server, including the actual key'
788 operationId: getTSIGKey
789 tags:
790 - tsigkey
791 responses:
792 '200':
793 description: OK.
794 schema:
795 $ref: '#/definitions/TSIGKey'
796 '404':
797 description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
798 schema:
799 $ref: '#/definitions/Error'
800 '500':
801 description: 'Internal Server Error, keys could not be retrieved. Contains error message'
802 schema:
803 $ref: '#/definitions/Error'
804 put:
805 description: |
806 The TSIGKey at tsigkey_id can be changed in multiple ways:
807 * Changing the Name, this will remove the key with tsigkey_id after adding.
808 * Changing the Algorithm
809 * Changing the Key
e72dff12 810
d4556db1
PL
811 Only the relevant fields have to be provided in the request body.
812 operationId: putTSIGKey
813 tags:
814 - tsigkey
815 parameters:
816 - name: tsigkey
817 description: A (possibly stripped down) TSIGKey object with the new values
607311d6 818 schema:
d4556db1
PL
819 $ref: '#/definitions/TSIGKey'
820 in: body
821 required: true
822 responses:
823 '200':
824 description: OK. TSIGKey is changed.
825 schema:
826 $ref: '#/definitions/TSIGKey'
827 '404':
828 description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
829 schema:
830 $ref: '#/definitions/Error'
831 '500':
832 description: 'Internal Server Error. Contains error message'
833 schema:
834 $ref: '#/definitions/Error'
835 delete:
836 summary: 'Delete the TSIGKey with tsigkey_id'
837 operationId: deleteTSIGKey
838 tags:
839 - tsigkey
840 responses:
841 '204':
842 description: 'OK, key was deleted'
843 '404':
844 description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
845 schema:
846 $ref: '#/definitions/Error'
847 '500':
848 description: 'Internal Server Error. Contains error message'
849 schema:
850 $ref: '#/definitions/Error'
851
0e66609b
AJS
852definitions:
853 Server:
af28a1c2 854 title: Server
0e66609b
AJS
855 properties:
856 type:
857 type: string
858 description: 'Set to “Server”'
859 id:
860 type: string
861 description: 'The id of the server, “localhost”'
862 daemon_type:
863 type: string
864 description: '“recursor” for the PowerDNS Recursor and “authoritative” for the Authoritative Server'
865 version:
866 type: string
867 description: 'The version of the server software'
868 url:
869 type: string
870 description: 'The API endpoint for this server'
871 config_url:
872 type: string
873 description: 'The API endpoint for this server’s configuration'
874 zones_url:
875 type: string
876 description: 'The API endpoint for this server’s zones'
877
878 Servers:
879 type: array
880 items:
881 $ref: '#/definitions/Server'
882
883 Zone:
af28a1c2
PL
884 title: Zone
885 description: This represents an authoritative DNS Zone.
0e66609b
AJS
886 properties:
887 id:
888 type: string
889 description: 'Opaque zone id (string), assigned by the server, should not be interpreted by the application. Guaranteed to be safe for embedding in URLs.'
890 name:
891 type: string
892 description: 'Name of the zone (e.g. “example.com.”) MUST have a trailing dot'
893 type:
894 type: string
895 description: 'Set to “Zone”'
896 url:
897 type: string
898 description: 'API endpoint for this zone'
899 kind:
900 type: string
901 enum:
902 - 'Native'
903 - 'Master'
904 - 'Slave'
905 description: 'Zone kind, one of “Native”, “Master”, “Slave”'
906 rrsets:
907 type: array
908 items:
909 $ref: '#/definitions/RRSet'
97c61a02 910 description: 'RRSets in this zone (for zones/{zone_id} endpoint only; omitted during GET on the .../zones list endpoint)'
0e66609b
AJS
911 serial:
912 type: integer
913 description: 'The SOA serial number'
914 notified_serial:
915 type: integer
916 description: 'The SOA serial notifications have been sent out for'
1258fecd
PL
917 edited_serial:
918 type: integer
919 description: 'The SOA serial as seen in query responses. Calculated using the SOA-EDIT metadata, default-soa-edit and default-soa-edit-signed settings'
0e66609b
AJS
920 masters:
921 type: array
922 items:
923 type: string
924 description: ' List of IP addresses configured as a master for this zone (“Slave” type zones only)'
925 dnssec:
926 type: boolean
927 description: 'Whether or not this zone is DNSSEC signed (inferred from presigned being true XOR presence of at least one cryptokey with active being true)'
928 nsec3param:
929 type: string
930 description: 'The NSEC3PARAM record'
931 nsec3narrow:
932 type: boolean
933 description: 'Whether or not the zone uses NSEC3 narrow'
934 presigned:
935 type: boolean
936 description: 'Whether or not the zone is pre-signed'
937 soa_edit:
938 type: string
939 description: 'The SOA-EDIT metadata item'
940 soa_edit_api:
941 type: string
942 description: 'The SOA-EDIT-API metadata item'
943 api_rectify:
944 type: boolean
945 description: ' Whether or not the zone will be rectified on data changes via the API'
946 zone:
947 type: string
948 description: 'MAY contain a BIND-style zone file when creating a zone'
949 account:
950 type: string
951 description: 'MAY be set. Its value is defined by local policy'
952 nameservers:
953 type: array
954 items:
955 type: string
956 description: 'MAY be sent in client bodies during creation, and MUST NOT be sent by the server. Simple list of strings of nameserver names, including the trailing dot. Not required for slave zones.'
e96a86dc 957 master_tsig_key_ids:
d4556db1
PL
958 type: array
959 items:
960 type: string
961 description: 'The id of the TSIG keys used for master operation in this zone'
962 externalDocs:
963 url: 'https://doc.powerdns.com/authoritative/tsig.html#provisioning-outbound-axfr-access'
e96a86dc 964 slave_tsig_key_ids:
d4556db1
PL
965 type: array
966 items:
967 type: string
968 description: 'The id of the TSIG keys used for slave operation in this zone'
969 externalDocs:
970 url: 'https://doc.powerdns.com/authoritative/tsig.html#provisioning-signed-notification-and-axfr-requests'
0e66609b
AJS
971
972 Zones:
973 type: array
974 items:
975 $ref: '#/definitions/Zone'
976
977 RRSet:
af28a1c2
PL
978 title: RRSet
979 description: This represents a Resource Record Set (all records with the same name and type).
0e66609b
AJS
980 required:
981 - name
982 - type
983 - ttl
984 - changetype
985 - records
986 properties:
987 name:
988 type: string
989 description: 'Name for record set (e.g. “www.powerdns.com.”)'
990 type:
991 type: string
992 description: 'Type of this record (e.g. “A”, “PTR”, “MX”)'
993 ttl:
994 type: integer
995 description: 'DNS TTL of the records, in seconds. MUST NOT be included when changetype is set to “DELETE”.'
996 changetype:
997 type: string
998 description: 'MUST be added when updating the RRSet. Must be REPLACE or DELETE. With DELETE, all existing RRs matching name and type will be deleted, including all comments. With REPLACE: when records is present, all existing RRs matching name and type will be deleted, and then new records given in records will be created. If no records are left, any existing comments will be deleted as well. When comments is present, all existing comments for the RRs matching name and type will be deleted, and then new comments given in comments will be created.'
999 records:
1000 type: array
1001 description: 'All records in this RRSet. When updating Records, this is the list of new records (replacing the old ones). Must be empty when changetype is set to DELETE. An empty list results in deletion of all records (and comments).'
1002 items:
1003 $ref: '#/definitions/Record'
1004 comments:
1005 type: array
1006 description: 'List of Comment. Must be empty when changetype is set to DELETE. An empty list results in deletion of all comments. modified_at is optional and defaults to the current server time.'
1007 items:
1008 $ref: '#/definitions/Comment'
1009
1010 Record:
af28a1c2
PL
1011 title: Record
1012 description: The RREntry object represents a single record.
0e66609b
AJS
1013 required:
1014 - content
0e66609b
AJS
1015 properties:
1016 content:
1017 type: string
1018 description: 'The content of this record'
1019 disabled:
1020 type: boolean
70aad565 1021 description: 'Whether or not this record is disabled. When unset, the record is not disabled'
0e66609b
AJS
1022
1023 Comment:
af28a1c2
PL
1024 title: Comment
1025 description: A comment about an RRSet.
0e66609b
AJS
1026 properties:
1027 content:
1028 type: string
1029 description: 'The actual comment'
1030 account:
1031 type: string
1032 description: 'Name of an account that added the comment'
cce8c6d6 1033 modified_at:
0e66609b
AJS
1034 type: integer
1035 description: 'Timestamp of the last change to the comment'
1036
d4556db1
PL
1037 TSIGKey:
1038 title: TSIGKey
1039 description: A TSIG key that can be used to authenticate NOTIFYs and AXFRs
1040 properties:
1041 name:
1042 type: string
1043 description: 'The name of the key'
1044 id:
1045 type: string
1046 description: 'The ID for this key, used in the TSIGkey URL endpoint.'
1047 readOnly: true
1048 algorithm:
1049 type: string
1050 description: 'The algorithm of the TSIG key'
1051 key:
1052 type: string
1053 description: 'The Base64 encoded secret key, empty when listing keys. MAY be empty when POSTing to have the server generate the key material'
1054 type:
1055 type: string
1056 description: 'Set to "TSIGKey"'
1057 readOnly: true
1058
0e66609b 1059 ConfigSetting:
af28a1c2 1060 title: ConfigSetting
0e66609b
AJS
1061 properties:
1062 name:
1063 type: string
1064 description: 'set to "ConfigSetting"'
1065 type:
1066 type: string
1067 description: 'The name of this setting (e.g. ‘webserver-port’)'
1068 value:
1069 type: string
1070 description: 'The value of setting name'
1071
300c6dde
TB
1072 SimpleStatisticItem:
1073 title: SimpleStatisticItem
1074 type: object
0e66609b
AJS
1075 properties:
1076 name:
300c6dde
TB
1077 type: string
1078 description: 'Item name'
1079 value:
1080 type: string
1081 description: 'Item value'
118d3b31
CH
1082
1083 StatisticItem:
1084 title: StatisticItem
300c6dde
TB
1085 properties:
1086 name:
1087 type: string
1088 description: 'Item name'
1089 type:
1090 type: string
1091 description: 'set to "StatisticItem"'
1092 value:
1093 type: string
1094 description: 'Item value'
118d3b31
CH
1095
1096 MapStatisticItem:
1097 title: MapStatisticItem
300c6dde
TB
1098 properties:
1099 name:
1100 type: string
1101 description: 'Item name'
1102 type:
1103 type: string
1104 description: 'Set to "MapStatisticItem"'
1105 value:
1106 type: array
1107 description: 'Named values'
1108 items:
1109 $ref: '#/definitions/SimpleStatisticItem'
118d3b31
CH
1110
1111 RingStatisticItem:
1112 title: RingStatisticItem
300c6dde
TB
1113 properties:
1114 name:
1115 type: string
1116 description: 'Item name'
1117 type:
1118 type: string
1119 description: 'Set to "RingStatisticItem"'
1120 size:
1121 type: integer
1122 description: 'Ring size'
1123 value:
1124 type: array
1125 description: 'Named values'
1126 items:
1127 $ref: '#/definitions/SimpleStatisticItem'
0e66609b
AJS
1128
1129 SearchResultZone:
af28a1c2 1130 title: SearchResultZone
0e66609b
AJS
1131 properties:
1132 name:
1133 type: string
1134 object_type:
1135 type: string
1136 description: 'set to "zone"'
1137 zone_id:
1138 type: string
1139
1140 SearchResultRecord:
af28a1c2 1141 title: SearchResultRecord
0e66609b
AJS
1142 properties:
1143 content:
1144 type: string
1145 disabled:
1146 type: boolean
1147 name:
1148 type: string
1149 object_type:
1150 type: string
1151 description: 'set to "record"'
1152 zone_id:
1153 type: string
1154 zone:
1155 type: string
1156 type:
1157 type: string
1158 ttl:
1159 type: integer
1160
1161 SearchResultComment:
af28a1c2 1162 title: SearchResultComment
0e66609b
AJS
1163 properties:
1164 content:
1165 type: string
1166 name:
1167 type: string
1168 object_type:
1169 type: string
1170 description: 'set to "comment"'
1171 zone_id:
1172 type: string
1173 zone:
1174 type: string
1175
1176# FIXME: This is problematic at the moment, because swagger doesn't support this type of mixed response
1177# SearchResult:
1178# anyOf:
1179# - $ref: '#/definitions/SearchResultZone'
1180# - $ref: '#/definitions/SearchResultRecord'
1181# - $ref: '#/definitions/SearchResultComment'
1182
1183# Since we can't do 'anyOf' at the moment, we create a 'superset object'
1184 SearchResult:
af28a1c2 1185 title: SearchResult
0e66609b
AJS
1186 properties:
1187 content:
1188 type: string
1189 disabled:
1190 type: boolean
1191 name:
1192 type: string
1193 object_type:
1194 type: string
1195 description: 'set to one of "record, zone, comment"'
1196 zone_id:
1197 type: string
1198 zone:
1199 type: string
1200 type:
1201 type: string
1202 ttl:
1203 type: integer
1204
1205 SearchResults:
1206 type: array
1207 items:
42bff7ba 1208 $ref: '#/definitions/SearchResult'
0e66609b
AJS
1209
1210 Metadata:
af28a1c2
PL
1211 title: Metadata
1212 description: Represents zone metadata
0e66609b
AJS
1213 properties:
1214 kind:
1215 type: string
1216 description: 'Name of the metadata'
1217 metadata:
1218 type: array
1219 items:
1220 type: string
1221 description: 'Array with all values for this metadata kind.'
1222
1223 Cryptokey:
af28a1c2
PL
1224 title: Cryptokey
1225 description: 'Describes a DNSSEC cryptographic key'
0e66609b
AJS
1226 properties:
1227 type:
1228 type: string
1229 description: 'set to "Cryptokey"'
1230 id:
cc0bedf4 1231 type: integer
0e66609b
AJS
1232 description: 'The internal identifier, read only'
1233 keytype:
1234 type: string
1235 enum: [ksk, zsk, csk]
1236 active:
1237 type: boolean
1238 description: 'Whether or not the key is in active use'
33918299
RG
1239 published:
1240 type: boolean
8deae67a 1241 description: 'Whether or not the DNSKEY record is published in the zone'
0e66609b
AJS
1242 dnskey:
1243 type: string
1244 description: 'The DNSKEY record for this key'
1245 ds:
1246 type: array
1247 items:
42bff7ba 1248 type: string
0e66609b
AJS
1249 description: 'An array of DS records for this key'
1250 privatekey:
1251 type: string
1252 description: 'The private key in ISC format'
42bff7ba
PL
1253 algorithm:
1254 type: string
1255 description: 'The name of the algorithm of the key, should be a mnemonic'
1256 bits:
1257 type: integer
1258 description: 'The size of the key'
d4556db1
PL
1259
1260 Error:
1261 title: Error
d2eac323 1262 description: 'Returned when the server encounters an error. Either in client input or internally'
d4556db1
PL
1263 properties:
1264 error:
1265 type: string
1266 description: 'A human readable error message'
d4556db1
PL
1267 errors:
1268 type: array
1269 items:
1270 type: string
1271 description: 'Optional array of multiple errors encountered during processing'
d2eac323
CB
1272 required:
1273 - error
65f51e77 1274
7a93af1e
PL
1275 CacheFlushResult:
1276 title: CacheFlushResult
1277 description: 'The result of a cache-flush'
1278 properties:
1279 count:
1280 type: number
1281 description: 'Amount of entries flushed'
1282 result:
1283 type: string
1284 description: 'A message about the result like "Flushed cache"'