pub async fn create_zone_http(
client: &Arc<Client>,
token: &Arc<String>,
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 to create a zone using structured zone configuration from the bindcar library.
§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.