Operation Management

get

Retrieves an executed operation status using the operation link.

Parameters

NameTypeDescription
op_idstrThe id of the operation as a string.

Return

A msgspec struct containing the operation metadata with the following structure:

Operation(
    id='op_d52ab4e6-7760-4d12-9c43-7fc1b8ce1616',
    kind='nexus.annotations.export',
    status=OperationStatus(
        overview='Finished',
        message='Operation finished',
        progress=OperationProgress(
            unit='whole operation',
            with_status=OperationProgressWithStatus(
                Queued=0,
                Running=0,
                Finished=1,
                Cancelled=0,
                Errored=0
            )
        )
    ),
    create_date=1701927649302,
    update_date=1701927649302
)

Examples

from datature.nexus import Client

project = Client("5aa41e8ba........").get_project("proj_b705a........")

project.operations.get("op_508fc5d1-e908-486d-9e7b-1dca99b80024")

wait_until_done

Continuously retrieves an executed operation status for a specified number of times at a specified delay interval.

Parameters

NameTypeDescription
op_idstrThe id of the operation as a string.
timeoutint|NoneThe maximum number of times to loop the operation retrieval. Default is 36000
raise_exception_ifstrThe condition to raise error. Default is Errored

Return

The operation status metadata if the operation has finished, a BadRequestError if the operation has errored out, or None if the operation is still running.

Operation(
    id='op_d52ab4e6-7760-4d12-9c43-7fc1b8ce1616',
    kind='nexus.annotations.export',
    status=OperationStatus(
        overview='Finished',
        message='Operation finished',
        progress=OperationProgress(
            unit='whole operation',
            with_status=OperationProgressWithStatus(
                Queued=0,
                Running=0,
                Finished=1,
                Cancelled=0,
                Errored=0
            )
        )
    ),
    create_date=1701927649302,
    update_date=1701927649302
)

Examples

from datature.nexus import Client

project = Client("5aa41e8ba........").get_project("proj_b705a........")

project.operations.wait_until_done(
    "op_508fc5d1-e908-486d-9e7b-1dca99b80024"
)