create_zone_http

Function create_zone_http 

Source
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 client
  • token - Authentication token
  • zone_name - Name of the zone (e.g., “example.com”)
  • zone_type - Zone type (use ZONE_TYPE_PRIMARY or ZONE_TYPE_SECONDARY constants)
  • 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.