Operation Asset class

class starfish.asset.OperationAsset(metadata_text: str, did: Optional[str] = None, data: Optional[Any] = None)

Bases: starfish.asset.data_asset.DataAsset, Generic[starfish.types.OperationAsset]

Operation asset can be used to perform a invokable service

Parameters
  • metadata (None or dict) – Optional dictionary metadata to provide for the asset if non used then the class will generate a default metadata based on the data provided

  • did (None or str) – Optional did of the asset if it’s registered

  • data (str, bytes) – Optional data to assign to this operation asset

property class_name

Return operation class type name , for the orchestration this will be ‘orchestration’

static create(name: str, metadata: Optional[Any] = None, data: Optional[Any] = None, modes: Optional[Any] = None) starfish.types.OperationAsset

Create a new OperationAsset.

Parameters
  • name (str) – Name of the asset

  • metadata (dict) – Optional metadata to add to the assets metadata

  • data (str, bytes) – Option data to pass to the operation asset

  • modes (list,tuple) – Modes supported by this opreation, defaults to [‘sync’, ‘async’]

:returns OperationAsset object

static create_orchestration(name: str, data: Optional[Any] = None, metadata: Optional[Any] = None, modes: Optional[Any] = None) starfish.types.OperationAsset

Create a new OperationAsset with a class of orchestration.

Parameters
  • name (str) – Name of the asset

  • data (str, bytes) – Option orchestration dict or json str to pass to the operation asset

  • metadata (dict) – Optional metadata to add to the assets metadata

  • modes (list,tuple) – Modes supported by this opreation, defaults to [‘sync’, ‘async’]

:returns OperationAsset object

is_mode(mode_type: str) bool

Check to see if this operation supports the mode provided.

Parameters

mode_type (str) – Mode type to check to see if this operation supports

Returns

Return True if this mode is supported

Type

boolean

property is_orchestration

Return true if this operation asset is an orchestration