swagger: '2.0'
info:
- version: "0.0.13"
+ version: "0.0.15"
title: PowerDNS Authoritative HTTP API
license:
name: MIT
# We need to look at the code and figure out the default HTTP response
# codes and adjust docs accordingly.
paths:
+ '/error':
+ get:
+ summary: Will always generate an error
+ operationId: error
+ responses: &commonErrors
+ '400':
+ description: The supplied request was not valid
+ schema:
+ $ref: '#/definitions/Error'
+ '404':
+ description: Requested item was not found
+ schema:
+ $ref: '#/definitions/Error'
+ '422':
+ description: The input to the operation was not valid
+ schema:
+ $ref: '#/definitions/Error'
+ '500':
+ description: Internal server error
+ schema:
+ $ref: '#/definitions/Error'
+
'/servers':
get:
summary: List all servers
type: array
items:
$ref: '#/definitions/Server'
+ <<: *commonErrors
'/servers/{server_id}':
get:
description: An server
schema:
$ref: '#/definitions/Server'
+ <<: *commonErrors
'/servers/{server_id}/cache/flush':
put:
description: Flush successful
schema:
$ref: '#/definitions/CacheFlushResult'
+ <<: *commonErrors
'/servers/{server_id}/zones':
get:
type: array
items:
$ref: '#/definitions/Zone'
+ <<: *commonErrors
post:
summary: Creates a new domain, returns the Zone on creation.
operationId: createZone
description: A zone
schema:
$ref: '#/definitions/Zone'
+ <<: *commonErrors
'/servers/{server_id}/zones/{zone_id}':
get:
description: A Zone
schema:
$ref: '#/definitions/Zone'
+ <<: *commonErrors
delete:
summary: Deletes this zone, all attached metadata and rrsets.
operationId: deleteZone
responses:
'204':
description: 'Returns 204 No Content on success.'
+ <<: *commonErrors
patch:
summary: 'Creates/modifies/deletes RRsets present in the payload and their comments. Returns 204 No Content on success.'
operationId: patchZone
responses:
'204':
description: 'Returns 204 No Content on success.'
+ <<: *commonErrors
put:
summary: Modifies basic zone data.
responses:
'204':
description: 'Returns 204 No Content on success.'
+ <<: *commonErrors
'/servers/{server_id}/zones/{zone_id}/notify':
put:
responses:
'200':
description: OK
+ <<: *commonErrors
'/servers/{server_id}/zones/{zone_id}/axfr-retrieve':
put:
responses:
'200':
description: OK
+ <<: *commonErrors
'/servers/{server_id}/zones/{zone_id}/export':
get:
description: OK
schema:
type: string
+ <<: *commonErrors
'/servers/{server_id}/zones/{zone_id}/rectify':
put:
description: OK
schema:
type: string
+ <<: *commonErrors
'/servers/{server_id}/config':
get:
type: array
items:
$ref: '#/definitions/ConfigSetting'
+ <<: *commonErrors
'/servers/{server_id}/config/{config_setting_name}':
get:
description: List of config values
schema:
$ref: '#/definitions/ConfigSetting'
+ <<: *commonErrors
'/servers/{server_id}/statistics':
get:
- $ref: '#/definitions/RingStatisticItem'
'422':
description: 'Returned when a non-existing statistic name has been requested. Contains an error message'
+ <<: *commonErrors
'/servers/{server_id}/search-data':
get:
description: Returns a JSON array with results
schema:
$ref: '#/definitions/SearchResults'
+ <<: *commonErrors
'/servers/{server_id}/zones/{zone_id}/metadata':
get:
type: array
items:
$ref: '#/definitions/Metadata'
+ <<: *commonErrors
post:
summary: 'Creates a set of metadata entries'
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.'
responses:
'204':
description: OK
+ <<: *commonErrors
'/servers/{server_id}/zones/{zone_id}/metadata/{metadata_kind}':
get:
description: Metadata object with list of values
schema:
$ref: '#/definitions/Metadata'
+ <<: *commonErrors
put:
summary: 'Replace the content of a single kind of domain metadata.'
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.'
description: Metadata object with list of values
schema:
$ref: '#/definitions/Metadata'
+ <<: *commonErrors
delete:
summary: 'Delete all items of a single kind of domain metadata.'
operationId: deleteMetadata
responses:
'200':
description: OK
+ <<: *commonErrors
'/servers/{server_id}/zones/{zone_id}/cryptokeys':
get:
type: array
items:
$ref: '#/definitions/Cryptokey'
+ <<: *commonErrors
post:
summary: 'Creates a Cryptokey'
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.'
description: Created
schema:
$ref: '#/definitions/Cryptokey'
+ <<: *commonErrors
'/servers/{server_id}/zones/{zone_id}/cryptokeys/{cryptokey_id}':
get:
description: Cryptokey
schema:
$ref: '#/definitions/Cryptokey'
+ <<: *commonErrors
put:
summary: 'This method (de)activates a key from zone_name specified by cryptokey_id'
operationId: modifyCryptokey
responses:
'204':
description: OK
- '422':
- description: 'Returned when something is wrong with the content of the request. Contains an error message'
+ <<: *commonErrors
delete:
summary: 'This method deletes a key specified by cryptokey_id.'
operationId: deleteCryptokey
responses:
'204':
description: OK
- '422':
- description: 'Returned when something is wrong with the content of the request. Contains an error message'
+ <<: *commonErrors
'/servers/{server_id}/tsigkeys':
parameters:
type: array
items:
$ref: '#/definitions/TSIGKey'
- '500':
- description: 'Internal Server Error, keys could not be retrieved. Contains error message'
- schema:
- $ref: '#/definitions/Error'
+ <<: *commonErrors
post:
summary: 'Add a TSIG key'
description: 'This methods add a new TSIGKey. The actual key can be generated by the server or be provided by the client'
schema:
$ref: '#/definitions/TSIGKey'
'409':
- description: 'Conflict. A key with this name already exists'
- schema:
- $ref: '#/definitions/Error'
- '422':
- description: 'Unprocessable Entry, the TSIGKey provided has issues.'
- schema:
- $ref: '#/definitions/Error'
- '500':
- description: 'Internal Server Error. There was a problem creating the key'
+ description: An item with this name already exists
schema:
$ref: '#/definitions/Error'
+ <<: *commonErrors
'/servers/{server_id}/tsigkeys/{tsigkey_id}':
parameters:
description: OK.
schema:
$ref: '#/definitions/TSIGKey'
- '404':
- description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
- schema:
- $ref: '#/definitions/Error'
- '500':
- description: 'Internal Server Error, keys could not be retrieved. Contains error message'
- schema:
- $ref: '#/definitions/Error'
+ <<: *commonErrors
put:
description: |
The TSIGKey at tsigkey_id can be changed in multiple ways:
description: OK. TSIGKey is changed.
schema:
$ref: '#/definitions/TSIGKey'
- '404':
- description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
- schema:
- $ref: '#/definitions/Error'
- '500':
- description: 'Internal Server Error. Contains error message'
+ '409':
+ description: An item with this name already exists
schema:
$ref: '#/definitions/Error'
+ <<: *commonErrors
delete:
summary: 'Delete the TSIGKey with tsigkey_id'
operationId: deleteTSIGKey
responses:
'204':
description: 'OK, key was deleted'
- '404':
- description: 'Not found. The TSIGKey with the specified tsigkey_id does not exist'
- schema:
- $ref: '#/definitions/Error'
- '500':
- description: 'Internal Server Error. Contains error message'
- schema:
- $ref: '#/definitions/Error'
+ <<: *commonErrors
definitions:
Server:
Error:
title: Error
- description: 'Returned when the server encounters an error. Either in client input or internally'
+ description: 'Returned when the server encounters an error, either in client input or internally'
properties:
error:
type: string