Add /api/logs/{ftl,http,ph7}

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-01-18 04:22:50 +01:00
parent 2e2253c77c
commit 1ae49c7baf
22 changed files with 299 additions and 220 deletions
+93
View File
@@ -11,6 +11,99 @@ components:
description: |
This API hook returns content from the log of the embedded DNS resolver `dnsmasq`.
Every successful request will return a `nextID`.
This ID can be used on the next request to only get lines which were added *after* the last request.
This makes periodic polling for new log lines easy as no check for duplicated log lines is necessary.
The expected behavior for an immediate re-request of a log line with the same ID is an empty response.
As soon as the next message arrived, this will be included in your request and `nextID` is incremented by one.
parameters:
- $ref: 'logs.yaml#/components/parameters/logs/dnsmasq/nextID'
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'logs.yaml#/components/schemas/logs/dnsmasq/log'
- $ref: 'logs.yaml#/components/schemas/logs/dnsmasq/nextID'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: 'common.yaml#/components/errors/unauthorized'
ftl:
get:
summary: Get DNS log content
tags:
- "FTL information"
operationId: "get_dns_log"
description: |
This API hook returns content from the log of FTL.
Every successful request will return a `nextID`.
This ID can be used on the next request to only get lines which were added *after* the last request.
This makes periodic polling for new log lines easy as no check for duplicated log lines is necessary.
The expected behavior for an immediate re-request of a log line with the same ID is an empty response.
As soon as the next message arrived, this will be included in your request and `nextID` is incremented by one.
parameters:
- $ref: 'logs.yaml#/components/parameters/logs/dnsmasq/nextID'
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'logs.yaml#/components/schemas/logs/dnsmasq/log'
- $ref: 'logs.yaml#/components/schemas/logs/dnsmasq/nextID'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: 'common.yaml#/components/errors/unauthorized'
http:
get:
summary: Get DNS log content
tags:
- "FTL information"
operationId: "get_dns_log"
description: |
This API hook returns content from the log of the embedded CivetWeb HTTP server.
Every successful request will return a `nextID`.
This ID can be used on the next request to only get lines which were added *after* the last request.
This makes periodic polling for new log lines easy as no check for duplicated log lines is necessary.
The expected behavior for an immediate re-request of a log line with the same ID is an empty response.
As soon as the next message arrived, this will be included in your request and `nextID` is incremented by one.
parameters:
- $ref: 'logs.yaml#/components/parameters/logs/dnsmasq/nextID'
responses:
'200':
description: OK
content:
application/json:
schema:
allOf:
- $ref: 'logs.yaml#/components/schemas/logs/dnsmasq/log'
- $ref: 'logs.yaml#/components/schemas/logs/dnsmasq/nextID'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: 'common.yaml#/components/errors/unauthorized'
ph7:
get:
summary: Get DNS log content
tags:
- "FTL information"
operationId: "get_dns_log"
description: |
This API hook returns content from the log of the embedded PH7 engine.
Every successful request will return a `nextID`.
This ID can be used on the next request to only get lines which were added *after* the last request.
This makes periodic polling for new log lines easy as no check for duplicated log lines is necessary.
+9
View File
@@ -153,6 +153,15 @@ paths:
/logs/dnsmasq:
$ref: 'logs.yaml#/components/paths/logs/dnsmasq'
/logs/ftl:
$ref: 'logs.yaml#/components/paths/logs/ftl'
/logs/http:
$ref: 'logs.yaml#/components/paths/logs/http'
/logs/ph7:
$ref: 'logs.yaml#/components/paths/logs/ph7'
/endpoints:
$ref: 'endpoints.yaml#/components/paths/endpoints'