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.MistralContext(_BaseContext__mapping=None, **kwargs)

Bases: mistral.context.BaseContext

class mistral.context.RpcContextSerializer(entity_serializer=None)

Bases: oslo_messaging.serializer.Serializer

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

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.EvaluationException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.EventTriggerException(message=None)

Bases: mistral.exceptions.MistralException

exception mistral.exceptions.ExpressionGrammarException(message=None)

Bases: mistral.exceptions.DSLParsingException

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.JinjaEvaluationException(message=None)

Bases: mistral.exceptions.EvaluationException

exception mistral.exceptions.JinjaGrammarException(message=None)

Bases: mistral.exceptions.ExpressionGrammarException

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.EvaluationException

exception mistral.exceptions.YaqlGrammarException(message=None)

Bases: mistral.exceptions.ExpressionGrammarException

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.serialization module

class mistral.serialization.DictBasedSerializer

Bases: mistral.serialization.Serializer

Dictionary-based serializer.

It slightly simplifies implementing custom serializers by introducing a contract based on dictionary. A serializer class extending this class just needs to implement conversion from object into dict and from dict to object. It doesn’t need to convert into string and back as required bye the base serializer contract. Conversion into string is implemented once with regard to possible problems that may occur for collection and primitive types as circular dependencies, correct date format etc.

deserialize(data_str)
deserialize_from_dict(entity_dict)
serialize(entity)
serialize_to_dict(entity)
class mistral.serialization.MistralSerializable

Bases: object

A mixin to generate a serialization key for a custom object.

classmethod get_serialization_key()
class mistral.serialization.PolymorphicSerializer

Bases: mistral.serialization.Serializer

Polymorphic serializer.

The purpose of this class is to server as a serialization router between serializers that can work with entities of particular type. All concrete serializers associated with concrete entity classes should be registered via method ‘register’, after that an instance of polymorphic serializer can be used as a universal serializer for an RPC system or something else. When converting an object into a string this serializer also writes a special key into the result string sequence so that it’s possible to find a proper serializer when deserializing this object. If a primitive value is given as an entity this serializer doesn’t do anything special and simply converts a value into a string using jsonutils. Similar when it converts a string into a primitive value.

cleanup()
deserialize(data_str)
register(entity_cls, serializer)
serialize(entity)
class mistral.serialization.Serializer

Bases: object

Base interface for entity serializers.

A particular serializer knows how to convert a certain object into a string and back from that string into an object whose state is equivalent to the initial object.

deserialize(data_str)

Converts the given string into an object.

Parameters:data_str – String containing the state of the object in serialized form.
Returns:An object.
serialize(entity)

Converts the given object into a string.

Parameters:entity – A object to be serialized.

:return String containing the state of the object in serialized form.

mistral.version module

Module contents