All URIs are relative to https://localhost/api/v1
| Method | HTTP request | Description |
|---|---|---|
| get_stats | GET /servers/{server_id}/statistics | Query statistics. |
list[object] get_stats(server_id, statistic=statistic, includerings=includerings)
Query statistics.
Query PowerDNS internal statistics.
from __future__ import print_function
import time
import powerdns_client
from powerdns_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
configuration = powerdns_client.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = powerdns_client.StatsApi(powerdns_client.ApiClient(configuration))
server_id = 'server_id_example' # str | The id of the server to retrieve
statistic = 'statistic_example' # str | When set to the name of a specific statistic, only this value is returned. If no statistic with that name exists, the response has a 422 status and an error message. (optional)
includerings = true # bool | “true” (default) or “false”, whether to include the Ring items, which can contain thousands of log messages or queried domains. Setting this to ”false” may make the response a lot smaller. (optional) (default to true)
try:
# Query statistics.
api_response = api_instance.get_stats(server_id, statistic=statistic, includerings=includerings)
pprint(api_response)
except ApiException as e:
print("Exception when calling StatsApi->get_stats: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| server_id | str | The id of the server to retrieve | |
| statistic | str | When set to the name of a specific statistic, only this value is returned. If no statistic with that name exists, the response has a 422 status and an error message. | [optional] |
| includerings | bool | “true” (default) or “false”, whether to include the Ring items, which can contain thousands of log messages or queried domains. Setting this to ”false” may make the response a lot smaller. | [optional] [default to true] |
list[object]
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]