technitium 0.4.0

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

## Endpoint

`/api/admin/cluster/secondary/leave`

## Method

GET

## Description

Removes all Cluster configuration from this Secondary node and leaves the Cluster gracefully. There will be no data loss except for the Cluster configuration. You will need to re-join the Cluster to use this DNS server as a Secondary node again. This call can only be made at the Secondary node.

Use the `forceLeave` option only when the Primary node is unreachable or decommissioned and the node cannot leave gracefully.

## 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. |
| `node` | string | No | No | The node domain name for which the API call is intended. When unspecified, the current node is used. Can only be used when Clustering is initialized. |
| `forceLeave` | boolean | No | No | Set to `true` to make this Secondary node leave the Cluster without informing the Primary node. |

## Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `clusterInitialized` | boolean | `false` after successfully leaving the cluster. |
| `dnsServerDomain` | string | The server domain name (reverted to short hostname). |
| `version` | string | The DNS server software version. |

## Conditional Logic Notes

- This call can only be made at a Secondary node.
- Without `forceLeave=true`, the Secondary node will inform the Primary node that it is leaving.
- With `forceLeave=true`, the Secondary leaves without contacting the Primary, which means the Primary will still list it as a node until it is manually removed there.

## Edge Cases

- After leaving, the `dnsServerDomain` reverts from an FQDN to a short hostname.
- If `forceLeave` is false and the Primary is unreachable, the leave operation will fail. Use `forceLeave=true` in that case.
- Force-leaving means the Primary still has a stale entry for this node; it must be cleaned up on the Primary side via Delete Secondary Node.