minos.saga.definitions.steps.abc module

class minos.saga.definitions.steps.abc.SagaStep(saga=None, **kwargs)[source]

Bases: abc.ABC

Saga step class.

__init__(saga=None, **kwargs)[source]
commit(*args, **kwargs)[source]

Commit the current SagaStep on the Saga.

Parameters
  • args – Additional positional arguments.

  • kwargs – Additional named arguments.

Return type

Saga

Returns

A Saga instance.

conditional_step(*args, **kwargs)[source]

Create a new conditional step in the Saga.

Parameters
  • args – Additional positional parameters.

  • kwargs – Additional named parameters.

Return type

ConditionalSagaStep

Returns

A new SagaStep instance.

classmethod from_raw(raw, **kwargs)[source]

Build a new instance from raw.

Parameters
Return type

minos.saga.definitions.steps.abc.SagaStep

Returns

A SagaStep instance.

local_step(*args, **kwargs)[source]

Create a new local step in the Saga.

Parameters
  • args – Additional positional parameters.

  • kwargs – Additional named parameters.

Return type

LocalSagaStep

Returns

A new SagaStep instance.

abstract property raw: dict[str, typing.Any]

Generate a raw representation of the instance.

Return type

dict[str, typing.Any]

Returns

A dict instance.

remote_step(*args, **kwargs)[source]

Create a new remote step in the Saga.

Parameters
  • args – Additional positional parameters.

  • kwargs – Additional named parameters.

Return type

RemoteSagaStep

Returns

A new SagaStep instance.

step(*args, **kwargs)[source]

Create a new step in the Saga.

Parameters
  • args – Additional positional parameters.

  • kwargs – Additional named parameters.

Return type

minos.saga.definitions.steps.abc.SagaStep

Returns

A new SagaStep instance.

abstract validate()[source]

Check if the step is valid.

Return type

None

Returns

This method does not return anything, but raises an exception if the step is not valid.