]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - docs/http-api/swagger/authoritative-api-swagger.yaml
Rename type to object_type
[thirdparty/pdns.git] / docs / http-api / swagger / authoritative-api-swagger.yaml
index 6d02121875d60d9aa75574de0aae5804306d6e95..0c4570e69bb46f3685b945a6fcf5f535773c9a2a 100644 (file)
@@ -413,31 +413,6 @@ paths:
             - $ref: '#/definitions/MapStatisticItem'
             - $ref: '#/definitions/RingStatisticItem'
 
-  '/servers/{server_id}/search-log':
-    get:
-      summary: 'Query the log, filtered by search_term.'
-      operationId: searchLog
-      tags:
-        - search
-      parameters:
-        - name: server_id
-          in: path
-          required: true
-          description: The id of the server to retrieve
-          type: string
-        - name: q
-          in: query
-          required: true
-          description: 'The string to search for'
-          type: string
-      responses:
-        '200':
-          description: Returns a single JSON object with a single array of strings.
-          schema:
-            type: array
-            items:
-              type: string
-
   '/servers/{server_id}/search-data':
     get:
       summary: 'Search the data inside PowerDNS'
@@ -461,6 +436,11 @@ paths:
           required: true
           description: 'Maximum number of entries to return'
           type: integer
+        - name: object_type
+          in: query
+          required: false
+          description: 'Type of data to search for, one of “all”, “zone”, “record”, “comment”'
+          type: string
       responses:
         '200':
           description: Returns a JSON array with results
@@ -737,6 +717,137 @@ paths:
         '422':
           description: 'Returned when something is wrong with the content of the request. Contains an error message'
 
+  '/servers/{server_id}/tsigkeys':
+    parameters:
+      - name: server_id
+        in: path
+        required: true
+        description: 'The id of the server'
+        type: string
+    get:
+      summary: 'Get all TSIGKeys on the server, except the actual key'
+      operationId: listTSIGKeys
+      tags:
+        - tsigkey
+      responses:
+        '200':
+          description: List of TSIGKey objects
+          schema:
+            type: array
+            items:
+              $ref: '#/definitions/TSIGKey'
+        '500':
+          description: 'Internal Server Error, keys could not be retrieved. Contains error message'
+          schema:
+            $ref: '#/definitions/Error'
+    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'
+      operationId: createTSIGKey
+      tags:
+        - tsigkey
+      parameters:
+        - name: tsigkey
+          description: The TSIGKey to add
+          required: true
+          in: body
+          schema:
+            $ref: '#/definitions/TSIGKey'
+      responses:
+        '201':
+          description: Created
+          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'
+          schema:
+            $ref: '#/definitions/Error'
+
+  '/servers/{server_id}/tsigkeys/{tsigkey_id}':
+    parameters:
+      - name: server_id
+        in: path
+        required: true
+        description: 'The id of the server to retrieve the key from'
+        type: string
+      - name: tsigkey_id
+        in: path
+        required: true
+        description: 'The id of the TSIGkey. Should match the "id" field in the TSIGKey object'
+        type: string
+    get:
+      summary: 'Get a specific TSIGKeys on the server, including the actual key'
+      operationId: getTSIGKey
+      tags:
+        - tsigkey
+      responses:
+        '200':
+          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'
+    put:
+      description: |
+        The TSIGKey at tsigkey_id can be changed in multiple ways:
+         * Changing the Name, this will remove the key with tsigkey_id after adding.
+         * Changing the Algorithm
+         * Changing the Key
+        Only the relevant fields have to be provided in the request body.
+      operationId: putTSIGKey
+      tags:
+        - tsigkey
+      parameters:
+        - name: tsigkey
+          description: A (possibly stripped down) TSIGKey object with the new values
+          properties:
+            $ref: '#/definitions/TSIGKey'
+          in: body
+          required: true
+      responses:
+        '200':
+          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'
+          schema:
+            $ref: '#/definitions/Error'
+    delete:
+      summary: 'Delete the TSIGKey with tsigkey_id'
+      operationId: deleteTSIGKey
+      tags:
+        - tsigkey
+      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'
+
 definitions:
   Server:
     title: Server
@@ -839,6 +950,20 @@ definitions:
         items:
           type: string
         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.'
+      tsig_master_key_ids:
+        type: array
+        items:
+          type: string
+        description: 'The id of the TSIG keys used for master operation in this zone'
+        externalDocs:
+          url: 'https://doc.powerdns.com/authoritative/tsig.html#provisioning-outbound-axfr-access'
+      tsig_slave_key_ids:
+        type: array
+        items:
+          type: string
+        description: 'The id of the TSIG keys used for slave operation in this zone'
+        externalDocs:
+          url: 'https://doc.powerdns.com/authoritative/tsig.html#provisioning-signed-notification-and-axfr-requests'
 
   Zones:
     type: array
@@ -909,6 +1034,28 @@ definitions:
         type: integer
         description: 'Timestamp of the last change to the comment'
 
+  TSIGKey:
+    title: TSIGKey
+    description: A TSIG key that can be used to authenticate NOTIFYs and AXFRs
+    properties:
+      name:
+        type: string
+        description: 'The name of the key'
+      id:
+        type: string
+        description: 'The ID for this key, used in the TSIGkey URL endpoint.'
+        readOnly: true
+      algorithm:
+        type: string
+        description: 'The algorithm of the TSIG key'
+      key:
+        type: string
+        description: 'The Base64 encoded secret key, empty when listing keys. MAY be empty when POSTing to have the server generate the key material'
+      type:
+        type: string
+        description: 'Set to "TSIGKey"'
+        readOnly: true
+
   ConfigSetting:
     title: ConfigSetting
     properties:
@@ -1114,6 +1261,20 @@ definitions:
         type: integer
         description: 'The size of the key'
 
+  Error:
+    title: Error
+    descripton: 'Returned when the server encounters an error. Either in client input or internally'
+    properties:
+      error:
+        type: string
+        description: 'A human readable error message'
+        required: true
+      errors:
+        type: array
+        items:
+          type: string
+        description: 'Optional array of multiple errors encountered during processing'
+
   CacheFlushResult:
     title: CacheFlushResult
     description: 'The result of a cache-flush'