delete() function
Delete an entity and its nested entities.
This function deletes the specified entity and recursively deletes all its nested entities. The behavior varies depending on the type of entity provided:
- If a
CycleIdis provided, the nested scenarios, tasks, data nodes, and jobs are deleted. - If a
ScenarioIdis provided, the nested sequences, tasks, data nodes, submissions and jobs are deleted. If the scenario is primary, it can only be deleted if it is the only scenario in the cycle. In that case, its cycle is also deleted. Use theis_deletable()function to check if the scenario can be deleted. - If a
SequenceIdis provided, the related jobs are deleted. - If a
TaskIdis provided, the related data nodes, and jobs are deleted. - If a
DataNodeIdis provided, the data node is deleted. - If a
SubmissionIdis provided, the related jobs are deleted. The submission can only be deleted if the execution has been finished. - If a
JobIdis provided, the job entity can only be deleted if the execution has been finished.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_id
|
Union[TaskId, DataNodeId, SequenceId, ScenarioId, SubmissionId, JobId, CycleId]
|
The identifier of the entity to delete. |
required |
Raises:
| Type | Description |
|---|---|
ModelNotFound
|
No entity corresponds to the specified entity_id. |