Skip to main content

Background Tasks

Certain system operations like enabling/disabling services may take significant time to complete. The system registers such operations as trackable background tasks.

Task Object​

task objects are created when calling specific API methods, with their unique IDs returned in the response.
Each task relates to a specific base system object like domain or vod.

Core parameters for all tasks:

  • id - Unique task identifier. Used to:
    • Check task status
    • Restart the task
    • Cancel the task
  • task_type - Task category determining the expected outcome
  • status - Current execution state (see status list below)
  • percentage - Completion progress (0-100%). Tasks consist of subtasks - each completed subtask increases this value.
  • result - Task output (e.g., ID of created system object)

Task Types​

Current task types are documented in each API version's specifications.

Task Statuses​

  • TO_IN_PROGRESS - Queued for execution
  • IN_PROGRESS - Actively processing
  • COMPLETED - Successfully finished
  • FAILED - Execution terminated with errors
  • TO_CANCELLING - Queued for cancellation
  • CANCELLING - Cancellation in progress
  • CANCELED - Successfully aborted

Task Creation​

Concurrency Limit: Only one active task of each type can exist per base system object. A task remains active unless its status is COMPLETED or CANCELED.
Example: CDN enable/disable tasks cannot run simultaneously for the same website.

Task Cancellation​

Prerequisite: Task must be in FAILED status
Cancellation workflow:

  1. Status changes to TO_CANCELLING
  2. Task enters processing queue → Status becomes CANCELLING
  3. System rolls back all task-induced changes
  4. Final status:
    • CANCELED if successful
    • FAILED if errors occur during rollback

Task Restart​

Applicability: Only tasks with FAILED status
Restart process:

  • Status changes to TO_IN_PROGRESS
  • Execution resumes from the last completed subtask