minos.saga.messages module¶
- class minos.saga.messages.SagaRequest(target, content=None)[source]¶
Bases:
object
Saga Request class.
- async content(**kwargs)[source]¶
Get the content of the request.
- Parameters
kwargs – Additional named parameters.
- Return type
typing.Any
- Returns
The content of the request.
- property target: str¶
Get the target of the request.
- Return type
str
- Returns
A
str
instance.
- class minos.saga.messages.SagaResponse(content=None, related_services=None, status=None, uuid=None, *args, **kwargs)[source]¶
Bases:
object
Saga Response class.
- async content(**kwargs)[source]¶
Get the response content.
- Parameters
kwargs – Additional named parameters.
- Return type
typing.Any
- Returns
The content of the response.
- classmethod from_message(message)[source]¶
Build a new
SagaResponse
from aBrokerMessage
.- Parameters
message (
minos.networks.brokers.messages.BrokerMessage
) – TheBrokerMessage
instance.- Return type
- Returns
A
SagaResponse
.
- property ok: bool¶
Check if the response is okay.
- Return type
bool
- Returns
True
if the response is okay
Get the microservice name that generated the response.
- Return type
set
[str
]- Returns
An string value containing the microservice name.
- property status: minos.saga.messages.SagaResponseStatus¶
Get the status code of the response.
- Return type
- Returns
A
ResponseStatus
instance.
- property uuid: uuid.UUID¶
Get the identifier of the saga execution that must receive the response.
- Return type
uuid.UUID
- Returns
An
UUID
value.
- class minos.saga.messages.SagaResponseStatus(value)[source]¶
Bases:
enum.IntEnum
Saga Response Status class.
- ERROR = 400¶
- SUCCESS = 200¶
- SYSTEM_ERROR = 500¶