Operation Management
get
get
Retrieves an executed operation status using the operation link.
Parameters
Name | Type | Description |
---|---|---|
op_id | str | The 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
wait_until_done
Continuously retrieves an executed operation status for a specified number of times at a specified delay interval.
Parameters
Name | Type | Description |
---|---|---|
op_id | str | The id of the operation as a string. |
timeout | int|None | The maximum number of times to loop the operation retrieval. Default is 36000 |
raise_exception_if | str | The 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"
)
Updated 11 months ago