From: Thomas du Boÿs Date: Thu, 31 Jan 2019 10:22:57 +0000 (+0100) Subject: Add docs and changelog for statistics API endpoint X-Git-Tag: auth-4.2.0-beta1~5^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7359%2Fhead;p=thirdparty%2Fpdns.git Add docs and changelog for statistics API endpoint --- diff --git a/docs/changelog/4.2.rst b/docs/changelog/4.2.rst index 2e069cf1c9..567ccb76de 100644 --- a/docs/changelog/4.2.rst +++ b/docs/changelog/4.2.rst @@ -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 diff --git a/docs/http-api/statistics.rst b/docs/http-api/statistics.rst index c17e1d0979..23975cd514 100644 --- a/docs/http-api/statistics.rst +++ b/docs/http-api/statistics.rst @@ -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 diff --git a/docs/http-api/swagger/authoritative-api-swagger.yaml b/docs/http-api/swagger/authoritative-api-swagger.yaml index bb199f302d..beb8812f67 100644 --- a/docs/http-api/swagger/authoritative-api-swagger.yaml +++ b/docs/http-api/swagger/authoritative-api-swagger.yaml @@ -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