maestro.api.queries package#

Submodules#

maestro.api.queries.jobs module#

async maestro.api.queries.jobs.get_job_with_inputs(neo4j_tx: Neo4jTransaction, job_maestro_id: Annotated[UUID, UuidVersion(uuid_version=4)]) JobWithInputs[source]#

Get a job and its input artefacts, categorizing them as required, created or pending.

Parameters:
  • neo4j_tx – Neo4j transaction to use for queries

  • job_maestro_id – maestro_id (UUID) of the job to fetch

Returns:

JobWithInputs containing the job details and categorized input artefacts

Raises:

AssertionError – If job not found or not in pending, cancelled or failed status

maestro.api.queries.workflows module#

maestro.api.queries.workflows.build_search_query(search: Search) tuple[str, dict[str, Any]][source]#
async maestro.api.queries.workflows.get_workflow_counts(neo4j_tx: Neo4jTransaction, search: Search) WorkflowCounts[source]#

Count how many workflows are in each state, based on the following precedence: - If any job is failed, the workflow is failed - If any job is cancelled, the workflow is cancelled - If any job is halted, the workflow is halted - If any job is running, the workflow is running - If any job is queued, the workflow is queued for running - If any job is pending, the workflow is pending - Otherwise, this means that all jobs are completed, hence the workflow is successful

async maestro.api.queries.workflows.get_workflow_name(neo4j_tx: Neo4jTransaction, workflow_step_maestro_id: Annotated[UUID, UuidVersion(uuid_version=4)]) str[source]#
async maestro.api.queries.workflows.get_workflow_step(neo4j_tx: Neo4jTransaction, workflow_step_maestro_id: Annotated[UUID, UuidVersion(uuid_version=4)]) WorkflowStepModel[source]#
async maestro.api.queries.workflows.get_workflow_step_artefacts(neo4j_tx: Neo4jTransaction, workflow_step_maestro_id: Annotated[UUID, UuidVersion(uuid_version=4)]) WorkflowStepModelWithArtefacts[source]#

Given internal (maestro) worrkflow step ID, find and return all connected artefacts - we expect maximum four types of artefacts, each type will have list of artefacts - expected response types: INPUT, OUTPUT, STDOUT, STDERR

async maestro.api.queries.workflows.get_workflows(neo4j_tx: Neo4jTransaction, search: Search, page: int = 0, per_page: int = 100) list[WorkflowModelWithDetails][source]#