mistral package

Subpackages

Submodules

mistral.config module

Configuration options registration and useful routines.

mistral.context module

class mistral.context.AuthHook

Bases: pecan.hooks.PecanHook

before(state)
class mistral.context.BaseContext(_BaseContext__mapping=None, **kwargs)

Bases: object

Container for context variables.

to_dict()
class mistral.context.ContextHook

Bases: pecan.hooks.PecanHook

after(state)
before(state)
class mistral.context.JsonPayloadSerializer

Bases: oslo_messaging.serializer.NoOpSerializer

static serialize_entity(context, entity)
class mistral.context.MistralContext(_BaseContext__mapping=None, **kwargs)

Bases: mistral.context.BaseContext

class mistral.context.RpcContextSerializer(base=None)

Bases: oslo_messaging.serializer.Serializer

deserialize_context(context)
deserialize_entity(context, entity)
serialize_context(context)
serialize_entity(context, entity)

mistral.coordination module

class mistral.coordination.Service(group_type)

Bases: object

register_membership(*args, **kwargs)

Registers group membership.

Because this method will be invoked on each service startup almost at the same time, so it must be synchronized, in case all the services are started within same process.

stop()
class mistral.coordination.ServiceCoordinator(my_id=None)

Bases: object

Service coordinator.

This class uses the tooz library to manage group membership.

To ensure that the other agents know this agent is still alive, the heartbeat method should be called periodically.

get_members(group_id)

Gets members of coordination group.

ToozError exception must be handled when this function is invoded, we leave it to the invoker for the handling decision.

heartbeat()
is_active()
join_group(*args, **kw)
leave_group(group_id)
start()
stop()

mistral.exceptions module

exception mistral.exceptions.ActionException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.ActionRegistrationException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.ApplicationContextNotFoundException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.CoordinationException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.DBDuplicateEntryError(message=None)

Bases: mistral.exceptions.DBError

exception mistral.exceptions.DBEntityNotFoundError(message=None)

Bases: mistral.exceptions.DBError

exception mistral.exceptions.DBError(message=None)

Bases: mistral.exceptions.MistralError

exception mistral.exceptions.DBQueryEntryError(message=None)

Bases: mistral.exceptions.DBError

exception mistral.exceptions.DSLParsingException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.DataAccessException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.EngineException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.EventTriggerException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.InputException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.InvalidActionException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.InvalidModelException(message=None)

Bases: mistral.exceptions.DSLParsingException

exception mistral.exceptions.InvalidResultException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.KombuException(e)

Bases: exceptions.Exception

exception mistral.exceptions.MistralError(message=None)

Bases: exceptions.Exception

Mistral specific error.

Reserved for situations that can’t be automatically handled. When it occurs it signals that there is a major environmental problem like invalid startup configuration or implementation problem (e.g. some code doesn’t take care of certain corner cases). From architectural perspective it’s pointless to try to handle this type of problems except doing some finalization work like transaction rollback, deleting temporary files etc.

exception mistral.exceptions.MistralException(message=None)

Bases: exceptions.Exception

Mistral specific exception.

Reserved for situations that are not critical for program continuation. It is possible to recover from this type of problems automatically and continue program execution. Such problems may be related with invalid user input (such as invalid syntax) or temporary environmental problems.

In case if an instance of a certain exception type bubbles up to API layer then this type of exception it must be associated with an http code so it’s clear how to represent it for a client.

To correctly use this class, inherit from it and define a ‘message’ and ‘http_code’ properties.

exception mistral.exceptions.NotAllowedException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.SizeLimitExceededException(field_name, size_kb, size_limit_kb)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.UnauthorizedException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.WorkflowException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.YaqlEvaluationException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.YaqlGrammarException(message=None)

Bases: mistral.exceptions.DSLParsingException

mistral.expressions module

class mistral.expressions.Evaluator

Bases: object

Expression evaluator interface.

Having this interface gives the flexibility to change the actual expression language used in Mistral DSL for conditions, output calculation etc.

classmethod evaluate(expression, context)

Evaluates the expression against the given data context.

Parameters:
  • expression – Expression string
  • context – Data context
Returns:

Expression result

classmethod is_expression(expression)

Check expression string and decide whether it is expression or not.

Parameters:expression – Expression string
Returns:True if string is expression
classmethod validate(expression)

Parse and validates the expression.

Parameters:expression – Expression string
Returns:True if expression is valid
class mistral.expressions.InlineYAQLEvaluator

Bases: mistral.expressions.YAQLEvaluator

classmethod evaluate(expression, data_context)
classmethod find_inline_expressions(s)
classmethod is_expression(s)
classmethod validate(expression)
class mistral.expressions.YAQLEvaluator

Bases: mistral.expressions.Evaluator

classmethod evaluate(expression, data_context)
classmethod is_expression(s)
classmethod validate(expression)

mistral.messaging module

This module contains common structures and functions that help to handle AMQP messages based on olso.messaging framework.

class mistral.messaging.NotificationEndpoint(event_engine)

Bases: object

Message listener endpoint.

Only handle notifications that match the NotificationFilter rule set into the filter_rule attribute of the endpoint.

mistral.version module

Module contents