]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add docs and changelog for statistics API endpoint 7359/head
authorThomas du Boÿs <thomas.du-boys@corp.ovh.com>
Thu, 31 Jan 2019 10:22:57 +0000 (11:22 +0100)
committerThomas du Boÿs <thomas.du-boys@corp.ovh.com>
Thu, 31 Jan 2019 10:22:57 +0000 (11:22 +0100)
docs/changelog/4.2.rst
docs/http-api/statistics.rst
docs/http-api/swagger/authoritative-api-swagger.yaml

index 2e069cf1c9ad25d07da72c6a44bbf4d7f4b63f8f..567ccb76de33e840145180bc4acb89d99049f00e 100644 (file)
@@ -881,3 +881,10 @@ Changelogs for 4.2.x
     :tickets: 6028
 
     Forbid label compression in ALIAS wire format.
+
+  .. change::
+    :tags: Improvements
+    :pullreq: 7359
+    :tickets: 7357
+
+    API: Add response-by-qtype and response-by-rcode on /statistics endpoint
index c17e1d097920b838c30aca87d145ae850bf5568a..23975cd514d9eb01d79f48eaed021209c07c14c2 100644 (file)
@@ -9,6 +9,19 @@ Endpoints
 
 Objects
 -------
+
+The Statistics endpoint returns an array of objects that can be StatisticItem, MapStatisticItem or RingStatisticItem :
+
 .. openapi:: swagger/authoritative-api-swagger.yaml
   :definitions: StatisticItem
 
+.. openapi:: swagger/authoritative-api-swagger.yaml
+  :definitions: MapStatisticItem
+
+.. openapi:: swagger/authoritative-api-swagger.yaml
+  :definitions: RingStatisticItem
+
+Both MapStatisticItem and RingStatisticItem objects contains an array of SimpleStatisticItem
+
+.. openapi:: swagger/authoritative-api-swagger.yaml
+  :definitions: SimpleStatisticItem
\ No newline at end of file
index bb199f302d8b0194cf3a2eed4d59fa348e13d3a3..beb8812f673f527a65190c0d8012ac2cb2bee5e7 100644 (file)
@@ -389,7 +389,7 @@ paths:
   '/servers/{server_id}/statistics':
     get:
       summary: 'Query statistics.'
-      description: 'Query PowerDNS internal statistics. Returns a list of BaseStatisticItem derived elements.'
+      description: 'Query PowerDNS internal statistics.'
       operationId: getStats
       tags:
         - stats
@@ -405,10 +405,6 @@ paths:
           schema:
             type: array
             items:
-            # these can be commented because the swagger code generator fails on them
-            # and replaced with
-            # type: string
-            # or something like that
             - $ref: '#/definitions/StatisticItem'
             - $ref: '#/definitions/MapStatisticItem'
             - $ref: '#/definitions/RingStatisticItem'
@@ -1064,69 +1060,62 @@ definitions:
         type: string
         description: 'The value of setting name'
 
-  BaseStatisticItem:
-    title: BaseStatisticItem
+  SimpleStatisticItem:
+    title: SimpleStatisticItem
+    type: object
     properties:
       name:
-        type: string
-        description: 'The name of this item (e.g. ‘uptime’)'
+          type: string
+          description: 'Item name'
+      value:
+          type: string
+          description: 'Item value'
 
   StatisticItem:
     title: StatisticItem
-    allOf:
-    - $ref: "#/definitions/BaseStatisticItem"
-    - properties:
-        type:
-          enum: [StatisticItem]
-          description: 'set to "StatisticItem"'
-        value:
-          type: string
-          description: 'The value of item'
+    properties:
+      name:
+        type: string
+        description: 'Item name'
+      type:
+        type: string
+        description: 'set to "StatisticItem"'
+      value:
+        type: string
+        description: 'Item value'
 
   MapStatisticItem:
     title: MapStatisticItem
-    allOf:
-    - $ref: "#/definitions/BaseStatisticItem"
-    - properties:
-        type:
-          enum: [MapStatisticItem]
-          description: 'set to "MapStatisticItem"'
-        value:
-          type: array
-          description: 'named statistic values'
-          items:
-            type: array
-            properties:
-              name:
-                type: string
-                description: 'item name'
-              value:
-                type: string
-                description: 'item value'
+    properties:
+      name:
+        type: string
+        description: 'Item name'
+      type:
+        type: string
+        description: 'Set to "MapStatisticItem"'
+      value:
+        type: array
+        description: 'Named values'
+        items:
+          $ref: '#/definitions/SimpleStatisticItem'
 
   RingStatisticItem:
     title: RingStatisticItem
-    allOf:
-    - $ref: "#/definitions/BaseStatisticItem"
-    - properties:
-        type:
-          enum: [RingStatisticItem]
-          description: 'set to "RingStatisticItem"'
-        size:
-          type: integer
-          description: 'for RingStatisticItem objects, the size of the ring'
-        value:
-          type: array
-          description: 'named ring statistic values'
-          items:
-            type: array
-            properties:
-              name:
-                type: string
-                description: 'item name'
-              value:
-                type: string
-                description: 'item value'
+    properties:
+      name:
+        type: string
+        description: 'Item name'
+      type:
+        type: string
+        description: 'Set to "RingStatisticItem"'
+      size:
+        type: integer
+        description: 'Ring size'
+      value:
+        type: array
+        description: 'Named values'
+        items:
+          $ref: '#/definitions/SimpleStatisticItem'
 
   SearchResultZone:
     title: SearchResultZone