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 outcomestatus- 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 executionIN_PROGRESS- Actively processingCOMPLETED- Successfully finishedFAILED- Execution terminated with errorsTO_CANCELLING- Queued for cancellationCANCELLING- Cancellation in progressCANCELED- 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:
- Status changes to
TO_CANCELLING - Task enters processing queue → Status becomes
CANCELLING - System rolls back all task-induced changes
- Final status:
CANCELEDif successfulFAILEDif 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