Destroy Domain A Record

Celery tasks for destroying llmclient domain A records.

This module defines tasks for destroying A records in the cloud provider’s DNS for llmclient domains, including signal handling and logging.

Main Tasks

  • destroy_domain_A_record(hostname, api_host_domain):

    Destroys the A record for a given domain name in the cloud provider’s DNS.

Signals

  • pre_destroy_domain_A_record: Sent before the A record is destroyed.

  • post_destroy_domain_A_record: Sent after the A record is destroyed.

Configuration

Task behavior and logging are controlled by smarter_settings and waffle switches.

Logging

Task execution and resource destruction are logged using the smarter logging library.

Usage

Queue the Celery task, or call it directly to run it synchronously:

destroy_domain_A_record.delay(hostname, api_host_domain) destroy_domain_A_record(hostname, api_host_domain)

raises Exception:

Any exception during task execution will trigger a retry according to Celery settings.

smarter.apps.llmclient.tasks.destroy_domain_a_record.destroy_domain_A_record(hostname, api_host_domain, task_id=None)

Destroy the A record for a given domain name in the cloud provider’s DNS.

A Celery task, e.g. destroy_domain_A_record.delay(...), which can also be called directly, to run synchronously, as delete_default_api does. This function locates the DNS zone of the specified parent domain, and deletes the A record of the given hostname from it. It sends pre- and post-destroy signals and logs all actions.

Parameters:
  • hostname (str) – The domain name whose A record should be destroyed.

  • api_host_domain (str) – The parent domain used to locate the DNS zone.

  • Signals

  • -------

  • pre_destroy_domain_A_record (django.dispatch.Signal) – Sent before the A record is destroyed.

  • post_destroy_domain_A_record (django.dispatch.Signal) – Sent after the A record is destroyed.

Return type:

None

Raises:

Exception – Any exception raised during the destruction process will be logged and may be handled by the caller.