22.15.1.4. salt.serializers

22.15.1.4.1. salt.utils.serializers

This module implements all the serializers needed by salt. Each serializer offers the same functions and attributes:

deserialize:function for deserializing string or stream
serialize:function for serializing a Python object
available:flag that tells if the serializer is available (all dependencies are met etc.)

22.15.1.4.2. salt.utils.serializers.json

Implements JSON serializer.

It's just a wrapper around json (or simplejson if available).

salt.utils.serializers.json.deserialize(stream_or_string, **options)

Deserialize any string of stream like object into a Python data structure.

Parameters:
  • stream_or_string -- stream or string to deserialize.
  • options -- options given to lower json/simplejson module.
salt.utils.serializers.json.serialize(obj, **options)

Serialize Python data to JSON.

Parameters:
  • obj -- the data structure to serialize
  • options -- options given to lower json/simplejson module.

22.15.1.4.3. salt.utils.serializers.yaml

Implements YAML serializer.

Underneath, it is based on pyyaml and use the safe dumper and loader. It also use C bindings if they are available.

salt.utils.serializers.yaml.deserialize(stream_or_string, **options)

Deserialize any string of stream like object into a Python data structure.

Parameters:
  • stream_or_string -- stream or string to deserialize.
  • options -- options given to lower yaml module.
salt.utils.serializers.yaml.serialize(obj, **options)

Serialize Python data to YAML.

Parameters:
  • obj -- the data structure to serialize
  • options -- options given to lower yaml module.

22.15.1.4.4. salt.utils.serializers.msgpack

Implements MsgPack serializer.

salt.utils.serializers.msgpack.deserialize(stream_or_string, **options)

Deserialize any string of stream like object into a Python data structure.

Parameters:
  • stream_or_string -- stream or string to deserialize.
  • options -- options given to lower msgpack module.
salt.utils.serializers.msgpack.serialize(obj, **options)

Serialize Python data to MsgPack.

Parameters:
  • obj -- the data structure to serialize
  • options -- options given to lower msgpack module.

Docs for previous releases are available on salt.rtfd.org.

Latest Salt release: 2014.1.13

Try the shiny new release candidate of Salt, v2014.7.0rc6! More info here.

Table Of Contents

Previous topic

22.15.1.3. salt.exceptions

Next topic

22.16. Full list of builtin execution modules

SaltStack News

Upcoming SaltStack events, webinars and local meet ups and user groups.