class documentation

class DelegatedOperationService(object): (source)

Constructor: DelegatedOperationService(repo)

View In Hierarchy

Service for executing delegated operations.

Method __init__ Undocumented
Method count Counts the delegated operations matching the given criteria.
Method delete_for_dataset Deletes all delegated operations associated with the given dataset.
Method delete_operation Deletes the given delegated operation.
Method execute_operation Executes the given delegated operation.
Method execute_queued_operations Executes queued delegated operations matching the given criteria.
Method get Returns the delegated operation with the given ID.
Method get_queued_operations Returns all queued delegated operations.
Method get_running_operations Returns all running delegated operations.
Method get_scheduled_operations Returns all scheduled delegated operations.
Method list_operations Lists the delegated operations matching the given criteria.
Method queue_operation Queues the given delegated operation for execution.
Method rerun_operation Reruns the specified delegated operation.
Method set_completed Sets the given delegated operation to completed state.
Method set_failed Sets the given delegated operation to failed state.
Method set_label Sets the pinned flag for the given delegated operation.
Method set_pinned Sets the pinned flag for the given delegated operation.
Method set_progress Sets the progress of the given delegated operation.
Method set_queued Sets the given delegated operation to queued state.
Method set_running Sets the given delegated operation to running state.
Method set_scheduled Sets the given delegated operation to scheduled state.
Async Method _execute_operator Undocumented
Instance Variable _repo Undocumented
def __init__(self, repo=None): (source)

Undocumented

def count(self, filters=None, search=None): (source)

Counts the delegated operations matching the given criteria.

Parameters
filters:Nonea filter dict
search:Nonea search term dict
Returns
the number of matching operations
def delete_for_dataset(self, dataset_id): (source)

Deletes all delegated operations associated with the given dataset.

Parameters
dataset_idthe ID of the dataset
def delete_operation(self, doc_id): (source)

Deletes the given delegated operation.

Parameters
doc_idthe ID of the delegated operation
Returns
a fiftyone.factory.repos.DelegatedOperationDocument
def execute_operation(self, operation, log=False, run_link=None): (source)

Executes the given delegated operation.

Parameters
operationthe fiftyone.factory.repos.DelegatedOperationDocument
log:Falsethe optional boolean flag to log the execution of the delegated operations
run_link:Nonean optional link to orchestrator-specific information about the operation
def execute_queued_operations(self, operator=None, delegation_target=None, dataset_name=None, limit=None, log=False, **kwargs): (source)

Executes queued delegated operations matching the given criteria.

Parameters
operator:Nonethe optional name of the operator to execute all the queued delegated operations for
delegation_target:Nonethe optional delegation target of the delegated operations to execute
dataset_name:Nonethe optional name of the dataset to execute all the queued delegated operations for
limit:Nonethe optional limit of the number of delegated operations to execute
log:Falsethe optional boolean flag to log the execution of the delegated operations
**kwargsUndocumented
def get(self, doc_id): (source)

Returns the delegated operation with the given ID.

Parameters
doc_idthe ID of the delegated operation
Returns
a fiftyone.factory.repos.DelegatedOperationDocument
def get_queued_operations(self, operator=None, dataset_name=None): (source)

Returns all queued delegated operations.

Parameters
operator:Nonethe optional name of the operator to return all the queued delegated operations for
dataset_name:Nonethe optional name of the dataset to return all the queued delegated operations for
Returns
a list of fiftyone.factory.repos.DelegatedOperationDocument
def get_running_operations(self, operator=None, dataset_name=None): (source)

Returns all running delegated operations.

Parameters
operator:Nonethe optional name of the operator to return all the running delegated operations for
dataset_name:Nonethe optional name of the dataset to return all the running delegated operations for
Returns
a list of fiftyone.factory.repos.DelegatedOperationDocument
def get_scheduled_operations(self, operator=None, dataset_name=None): (source)

Returns all scheduled delegated operations.

Parameters
operator:Nonethe optional name of the operator to return all the scheduled delegated operations for
dataset_name:Nonethe optional name of the dataset to return all the scheduled delegated operations for
Returns
a list of fiftyone.factory.repos.DelegatedOperationDocument
def list_operations(self, operator=None, dataset_name=None, dataset_id=None, run_state=None, delegation_target=None, paging=None, search=None, **kwargs): (source)

Lists the delegated operations matching the given criteria.

Parameters
operator:Nonethe optional name of the operator to return all the delegated operations for
dataset_name:Nonethe optional name of the dataset to return all the delegated operations for
dataset_id:Nonethe optional id of the dataset to return all the delegated operations for
run_state:Nonethe optional run state of the delegated operations to return
delegation_target:Nonethe optional delegation target of the delegated operations to return
paging:Noneoptional fiftyone.factory.DelegatedOperationPagingParams
search:Noneoptional search term dict
**kwargsUndocumented
Returns
a list of fiftyone.factory.repos.DelegatedOperationDocument
def queue_operation(self, operator, label=None, delegation_target=None, context=None, metadata=None): (source)

Queues the given delegated operation for execution.

Parameters
operatorthe operator name
label:Nonean optional label for the operation (will default to the operator if not supplied)
delegation_target:Nonean optional delegation target
context:Nonean fiftyone.operators.executor.ExecutionContext
metadata:Nonean optional metadata dict containing properties below: - inputs_schema: the schema of the operator's inputs - outputs_schema: the schema of the operator's outputs
Returns
a fiftyone.factory.repos.DelegatedOperationDocument
def rerun_operation(self, doc_id): (source)

Reruns the specified delegated operation.

Parameters
doc_idthe ID of the delegated operation
Returns
a fiftyone.factory.repos.DelegatedOperationDocument
def set_completed(self, doc_id, result=None, progress=None, run_link=None, required_state=None): (source)

Sets the given delegated operation to completed state.

Parameters
doc_idthe ID of the delegated operation
result:Nonethe fiftyone.operators.executor.ExecutionResult of the operation
progress:Nonean optional fiftyone.operators.executor.ExecutionProgress of the operation
run_link:Nonean optional link to orchestrator-specific information about the operation
required_state:Nonean optional fiftyone.operators.executor.ExecutionRunState required state of the operation. If provided, the update will only be performed if the referenced operation matches this state.
Returns
a fiftyone.factory.repos.DelegatedOperationDocument if the
update was performed, else None.
def set_failed(self, doc_id, result=None, progress=None, run_link=None, required_state=None): (source)

Sets the given delegated operation to failed state.

Parameters
doc_idthe ID of the delegated operation
result:Nonethe fiftyone.operators.executor.ExecutionResult of the operation
progress:Nonean optional fiftyone.operators.executor.ExecutionProgress of the operation
run_link:Nonean optional link to orchestrator-specific information about the operation
required_state:Nonean optional fiftyone.operators.executor.ExecutionRunState required state of the operation. If provided, the update will only be performed if the referenced operation matches this state.
Returns
a fiftyone.factory.repos.DelegatedOperationDocument if the
update was performed, else None.
def set_label(self, doc_id, label): (source)

Sets the pinned flag for the given delegated operation.

Parameters
doc_idthe ID of the delegated operation
labelthe label to set
Returns
a fiftyone.factory.repos.DelegatedOperationDocument
def set_pinned(self, doc_id, pinned=True): (source)

Sets the pinned flag for the given delegated operation.

Parameters
doc_idthe ID of the delegated operation
pinned:Truethe boolean pinned flag
Returns
a fiftyone.factory.repos.DelegatedOperationDocument
def set_progress(self, doc_id, progress): (source)

Sets the progress of the given delegated operation.

Parameters
doc_idthe ID of the delegated operation
progressthe fiftyone.operators.executor.ExecutionProgress of the operation
Returns
a fiftyone.factory.repos.DelegatedOperationDocument
def set_queued(self, doc_id, required_state=None): (source)

Sets the given delegated operation to queued state.

Parameters
doc_idthe ID of the delegated operation
required_state:Nonean optional fiftyone.operators.executor.ExecutionRunState required state of the operation. If provided, the update will only be performed if the referenced operation matches this state.
Returns
a fiftyone.factory.repos.DelegatedOperationDocument if the
update was performed, else None.
def set_running(self, doc_id, progress=None, run_link=None, required_state=None): (source)

Sets the given delegated operation to running state.

Parameters
doc_idthe ID of the delegated operation
progress:Nonean optional fiftyone.operators.executor.ExecutionProgress of the operation
run_link:Nonean optional link to orchestrator-specific information about the operation
required_state:Nonean optional fiftyone.operators.executor.ExecutionRunState required state of the operation. If provided, the update will only be performed if the referenced operation matches this state.
Returns
a fiftyone.factory.repos.DelegatedOperationDocument if the
update was performed, else None.
def set_scheduled(self, doc_id, required_state=None): (source)

Sets the given delegated operation to scheduled state.

Parameters
doc_idthe ID of the delegated operation
required_state:Nonean optional fiftyone.operators.executor.ExecutionRunState required state of the operation. If provided, the update will only be performed if the referenced operation matches this state.
Returns
a fiftyone.factory.repos.DelegatedOperationDocument if the
update was performed, else None.
async def _execute_operator(self, doc): (source)

Undocumented

Undocumented