technitium 0.4.0

Typed async Rust client for the Technitium DNS Server API
Documentation
# List Allowed Zones

## Endpoint

`/api/allowed/list`

**Obsolete Path:** `/api/listAllowedZones`

## Method

GET

## Description

Lists all allowed zones. When a specific domain is provided, lists the records for that domain within the Allowed Zones. When no domain is provided, defaults to the zone root (empty string).

## Authentication

Required. A valid session token obtained from the `login` or `createToken` API call.

## Permissions

Allowed: View

## Parameters

| Name | Type | Required | Conditional | Description |
|------|------|----------|-------------|-------------|
| `token` | string | Yes | No | The session token generated by the `login` or the `createToken` call. |
| `node` | string | No | No | The node domain name for which this API call is intended. When unspecified, the current node is used. Can only be used when Clustering is initialized. |
| `domain` | string | No | No | The domain name to list records for. If not passed, the domain is set to an empty string which corresponds to the zone root. |
| `direction` | string | No | No | The direction of browsing the zone. Valid values are `up` and `down`. Defaults to `down` when the parameter is missing. Allows the server to skip empty labels in the domain name when browsing up or down. |

## Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `response.domain` | string | The domain that was queried. |
| `response.zones` | array | List of child zones under the queried domain. May be empty. |
| `response.records` | array | List of DNS records for the queried domain. |
| `response.records[].name` | string | The record name (domain). |
| `response.records[].type` | string | The DNS record type (e.g., `NS`, `SOA`). |
| `response.records[].ttl` | string | The TTL value with human-readable duration in parentheses. |
| `response.records[].rData` | object | The record data. Structure varies by record type. |
| `response.records[].rData.value` | string | For NS records: the nameserver value. |
| `response.records[].rData.primaryNameServer` | string | For SOA records: the primary name server. |
| `response.records[].rData.responsiblePerson` | string | For SOA records: the responsible person field. |
| `response.records[].rData.serial` | integer | For SOA records: the zone serial number. |
| `response.records[].rData.refresh` | integer | For SOA records: refresh interval in seconds. |
| `response.records[].rData.retry` | integer | For SOA records: retry interval in seconds. |
| `response.records[].rData.expire` | integer | For SOA records: expire time in seconds. |
| `response.records[].rData.minimum` | integer | For SOA records: minimum TTL in seconds. |
| `status` | string | `"ok"` on success. |

## Conditional Logic Notes

- The `node` parameter is only functional when Clustering is initialized. If Clustering is not initialized, the parameter has no effect or may be ignored.
- The `direction` parameter controls browsing behavior: `up` walks toward the zone root, `down` walks toward leaf nodes. The server skips empty labels in either direction.
- When `domain` is omitted, the API returns the zone root, which typically contains NS and SOA records.

## Edge Cases

- The `zones` array in the response can be empty if there are no child zones under the queried domain.
- The `records` array can also be empty if no records exist at the queried domain.
- The `direction` parameter only accepts `up` or `down`; behavior with invalid values is unspecified.
- The `domain` parameter defaults to an empty string (zone root), not to any specific domain.
- The `ttl` field is returned as a formatted string (e.g., `"14400 (4 hours)"`) rather than a raw integer.