Provided Methods

Method documentation

All the examples expect that there is already a OneDataApi object initialized and assigned to a variable called "onedata_api".

### Creation of the ONE DATA Api ###
onedata_api = OneDataApi(base_url=base_url, username=user,
                         password=pw, verify=False, timeout=999)

get

Description

Retrieves a WorkflowJob from the OneData API by its given id. Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.

Returns: WorkflowJob

Parameters

PropertyTypeRequiredDefaultDescription
idUnion[uuid.UUID, str]true-ID of the workflow job
retry_intervalintfalseNoneinterval between retry requests
retry_countintfalseNonenumber of retries
retry_untilCallable[[object], bool]falseNonelambda condition that needs to be met to stop retrying

Usage

# get an workflow job
job = onedata_api.workflows.jobs.get(id=job.id, retry_interval=5, retry_count=4)

getLatestJobShallow

Description

Retrieves the latest WorkflowJobShallow by an given workflow id from the OneData API. Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.

Returns: WorkflowJobShallow

Parameters

PropertyTypeRequiredDefaultDescription
wf_idUnion[UUID, str]true-ID of the workflow
job_execution_stateJobExecutionStatetrue-expected job execution state to retrieve

Usage

# get latest workflow job shallow
latest_job_shallow: WorkflowJobShallow = onedata_api.workflows.jobs.get_latest_job_shallow(wf_id, JobExecutionState.SUCCESS)

getLatestJobDeep

Description

Retrieves the latest WorkflowJob for the given workflow id by fetching the id of the latest WorkflowJobShallow and executing the get function afterwards.

Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.

Returns: WorkflowJob

Parameters

PropertyTypeRequiredDefaultDescription
idUnion[uuid.UUID, str]true-ID of the workflow job
retry_intervalintfalseNoneinterval between retry requests
retry_countintfalseNonenumber of retries
retry_untilCallable[[object], bool]falseNonelambda condition that needs to be met to stop retrying

Usage

# get the latest workflow job
latest_job_deep: WorkflowJob = onedata_api.workflows.jobs.get_latest_job_deep(wf_id, JobExecutionState.SUCCESS)