pub async fn add_secondary_zone(
client: &Arc<Client>,
token: &Arc<String>,
zone_name: &str,
server: &str,
key_data: &RndcKeyData,
primary_ips: &[String],
) -> Result<bool>Expand description
Add a secondary zone via HTTP API.
Creates a secondary zone configured to transfer from the specified primary servers. This is idempotent - if the zone already exists, it returns success without re-adding.
§Arguments
client- HTTP clienttoken- Authentication tokenzone_name- Name of the zone (e.g., “example.com”)server- API endpoint of the secondary server (e.g., “bind9-secondary-api:8080”)key_data- RNDC key dataprimary_ips- List of primary server IP addresses to transfer from
§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.