technitium 0.4.0

Typed async Rust client for the Technitium DNS Server API
Documentation
# Admin: Initialize Cluster

## Endpoint

`/api/admin/cluster/init`

## Method

GET

## Description

Initializes a new Cluster, making the current DNS server its Primary node. Other DNS servers can be added later as Secondary nodes. No data will be lost on this DNS server during this process.

If the web service does not have HTTPS enabled, the initialization process will enable it automatically with a self-signed certificate. It is recommended to manually configure HTTPS with a valid certificate before initializing the cluster.

The initialization process will create two zones if they do not exist:
1. A Cluster Primary zone named as the Cluster domain name.
2. A Cluster Catalog zone using `cluster-catalog` as the subdomain of the Cluster domain name, for automatic provisioning of Secondary zones on all Secondary nodes.

**Warning: The Cluster domain name cannot be changed later.**

## Authentication

Required. Token must be provided via the `token` parameter.

## Permissions

Administration: Delete

## Parameters

| Name | Type | Required | Conditional | Description |
|------|------|----------|-------------|-------------|
| `token` | string | Yes | No | The session token generated by the `login` or the `createToken` call. |
| `clusterDomain` | string | Yes | No | The fully qualified domain name to identify the new Cluster. Cannot be changed later. |
| `primaryNodeIpAddresses` | string | Yes | No | A comma-separated list of IP addresses of this DNS server that will be accessible by all other DNS servers to be added later as Secondary nodes. |

## Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `clusterInitialized` | boolean | Will be `true` after successful initialization. |
| `dnsServerDomain` | string | The FQDN of this DNS server (now set as a subdomain of the cluster domain). |
| `version` | string | The DNS server software version. |
| `clusterDomain` | string | The cluster domain name as specified. |
| `heartbeatRefreshIntervalSeconds` | integer | Default heartbeat refresh interval (30 seconds). |
| `heartbeatRetryIntervalSeconds` | integer | Default heartbeat retry interval (10 seconds). |
| `configRefreshIntervalSeconds` | integer | Default config refresh interval (900 seconds). |
| `configRetryIntervalSeconds` | integer | Default config retry interval (60 seconds). |
| `nodes` | array | List of cluster node objects (initially just the Primary node). |
| `nodes[].id` | integer | Unique numeric identifier for the node. |
| `nodes[].name` | string | The FQDN of the node. |
| `nodes[].url` | string | The HTTPS API web service URL. |
| `nodes[].ipAddresses` | array of strings | List of IP addresses for the node. |
| `nodes[].type` | string | Node type (`Primary` for the initializing node). |
| `nodes[].state` | string | Node state (`Self` for the initializing node). |
| `nodes[].lastSeen` | string (datetime) | Timestamp of last contact. |

## Conditional Logic Notes

- This endpoint can only be called when clustering is NOT already initialized.
- The cluster domain name is permanent and cannot be changed after initialization.
- If HTTPS is not enabled, the server will automatically enable it with a self-signed certificate.
- Two DNS zones are automatically created during initialization.

## Edge Cases

- Calling this on a server that already has clustering initialized will likely result in an error.
- The `dnsServerDomain` in the response will be updated to be an FQDN under the cluster domain.
- The IP addresses provided must be reachable by future Secondary nodes.