pub async fn create_zone_http(
client: &Arc<Client>,
token: Option<&str>,
zone_name: &str,
zone_type: &str,
zone_config: ZoneConfig,
server: &str,
key_data: &RndcKeyData,
) -> Result<()>Expand description
Create a zone via HTTP API with structured configuration.
This method sends a POST request to the API sidecar (via the shared
bindcar_request retry path, so it gets the same retry/backoff and
timeout behavior as all other zone operations) to create a zone using
structured zone configuration from the bindcar library.
This operation is idempotent: an HTTP 409 Conflict (or a BIND9 “already exists”-style message) is treated as success.
§Arguments
client- HTTP clienttoken- Authentication tokenzone_name- Name of the zone (e.g., “example.com”)zone_type- Zone type (useZONE_TYPE_PRIMARYorZONE_TYPE_SECONDARYconstants)zone_config- Structured zone configuration (converted to zone file by bindcar)server- API endpoint (e.g., “bind9-primary-api:8080”)key_data- RNDC authentication key (used as updateKeyName)
§Errors
Returns an error if the HTTP request fails or the zone cannot be created.