pub async fn add_primary_zone(
client: &Arc<Client>,
token: &Arc<String>,
zone_name: &str,
server: &str,
key_data: &RndcKeyData,
soa_record: &SOARecord,
name_server_ips: Option<&HashMap<String, String>>,
secondary_ips: Option<&[String]>,
) -> Result<bool>Expand description
Add a new primary zone via HTTP API.
This operation is idempotent - if the zone already exists, it returns success without attempting to re-add it.
The zone is created with allow-update enabled for the TSIG key used by the operator.
This allows dynamic DNS updates (RFC 2136) to add/update/delete records in the zone.
Note: This method creates a zone without initial content. For creating zones with
initial SOA/NS records, use create_zone_http() instead.
§Arguments
client- HTTP clienttoken- Authentication tokenzone_name- Name of the zone (e.g., “example.com”)server- API endpoint (e.g., “bind9-primary-api:8080”)key_data- RNDC key data (used for allow-update configuration)soa_record- SOA record dataname_server_ips- Optional map of nameserver hostnames to IP addresses for glue recordssecondary_ips- Optional list of secondary server IPs for also-notify and allow-transfer
§Returns
Returns Ok(true) if the zone was added, Ok(false) if it already existed.
§Errors
Returns an error if the HTTP request fails or the zone cannot be added.