Skip to content

Worker

add_queue async

add_queue(
    id: str,
    body: RemoveAddQueueToWorker,
    auth: Annotated[
        Auth, Depends(authorize(HYBRID, [SITE_ADMIN]))
    ],
    response: Response,
) -> None

Adds an existing queue to a worker.

Parameters:

Name Type Description Default
id str

The id of the worker.

required
body RemoveAddQueueToWorker

The request body containing the queue name to add.

required
auth Auth

The user's authentication status.

required

Raises:

Type Description
HTTPException

If the worker or queue cannot be found or if an error occurs during queue addition.

get_jobqueue async

get_jobqueue(
    auth: Annotated[
        Auth, Depends(authorize(HYBRID, [SITE_ADMIN]))
    ],
    id: str,
) -> list[GetWorkerJobqueue]

Get a list of all job queues for the worker specified by the id.

Parameters:

Name Type Description Default
id str

The id of the worker.

required
auth Auth

The user's authentication status.

required

Returns:

Type Description
list[GetWorkerJobqueue]

list[GetWorkerJobqueue]: A list of job queue objects for the worker.

Raises:

Type Description
HTTPException

If an error occurs while retrieving the job queues or the worker id is invalid.

get_jobs async

get_jobs(
    auth: Annotated[
        Auth, Depends(authorize(HYBRID, [SITE_ADMIN]))
    ],
    id: str,
) -> list[GetWorkerJobs]

Get a list of all jobs for the worker specified by the id.

Parameters:

Name Type Description Default
id str

The id of the worker.

required
auth Auth

The user's authentication status.

required

Returns:

Type Description
list[GetWorkerJobs]

list[GetWorkerJobs]: A list of jobs for the worker.

Raises:

Type Description
HTTPException

If an error occurs while retrieving the jobs for the worker or the id is invalid.

get_returningJobs async

get_returningJobs(
    auth: Annotated[
        Auth, Depends(authorize(HYBRID, [SITE_ADMIN]))
    ],
) -> list[GetWorkerReturningJobs]

Get a list of all returning jobs of this worker / of the queues this worker consumes.

Parameters:

Name Type Description Default
auth Auth

The user's authentication status

required

Returns:

Type Description
list[GetWorkerReturningJobs]

list[GetWorkerReturningJobs]: A list of returning jobs for the worker.

Raises:

Type Description
HTTPException

If an error occurs while retrieving returning jobs for the worker or the id is invalid.

get_workers async

get_workers(
    auth: Annotated[
        Auth, Depends(authorize(HYBRID, [SITE_ADMIN]))
    ],
) -> list[GetWorkerWorkers]

Get a list of all workers.

Parameters:

Name Type Description Default
auth Auth

The user's authentication status.

required

Returns:

Type Description
list[GetWorkerWorkers]

list[GetWorkerWorkers]: A list of GetWorkerWorkers objects with status, queues,

list[GetWorkerWorkers]

and job counts of a single worker.

Raises:

Type Description
HTTPException

If an error occurs while retrieving the worker list.

pause_workers async

pause_workers(
    auth: Annotated[
        Auth, Depends(authorize(HYBRID, [SITE_ADMIN]))
    ],
    id: str,
    response: Response,
) -> None

Pauses all workers.

Parameters:

Name Type Description Default
auth Auth

The user's authentication status.

required
id str

The id of the worker.

required

Raises:

Type Description
HTTPException

If an error occurs while pausing the workers.

remove_queue async

remove_queue(
    id: str,
    body: RemoveAddQueueToWorker,
    auth: Annotated[
        Auth, Depends(authorize(HYBRID, [SITE_ADMIN]))
    ],
    response: Response,
) -> None

Removes an existing queue from a worker.

Parameters:

Name Type Description Default
id str

The id of the worker.

required
body RemoveAddQueueToWorker

The request body containing the queue name to remove.

required
auth Auth

The user's authentication status.

required

Raises:

Type Description
HTTPException

If the worker or queue cannot be found or if an error occurs during queue removal.

unpause_workers async

unpause_workers(
    auth: Annotated[
        Auth, Depends(authorize(HYBRID, [SITE_ADMIN]))
    ],
    id: str,
    response: Response,
) -> None

Unpauses all workers.

Parameters:

Name Type Description Default
auth Auth

The user's authentication status.

required
id str

The id of the worker.

required

Raises:

Type Description
HTTPException

If an error occurs while unpausing the workers.

API-Worker-Integration

The following diagram shows an example interaction between the api and the private worker api. In this case the list of mmsip workers is requested by the frontend.

Example Integration