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 CycleId is provided, the nested scenarios, tasks, data nodes, and jobs are deleted.
  • If a ScenarioId is 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 the is_deletable() function to check if the scenario can be deleted.
  • If a SequenceId is provided, the related jobs are deleted.
  • If a TaskId is provided, the related data nodes, and jobs are deleted.
  • If a DataNodeId is provided, the data node is deleted.
  • If a SubmissionId is provided, the related jobs are deleted. The submission can only be deleted if the execution has been finished.
  • If a JobId is 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.