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.) |
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: |
|
|---|
salt.utils.serializers.json.serialize(obj, **options)¶Serialize Python data to JSON.
| Parameters: |
|
|---|
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: |
|
|---|
salt.utils.serializers.yaml.serialize(obj, **options)¶Serialize Python data to YAML.
| Parameters: |
|
|---|
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: |
|
|---|
salt.utils.serializers.msgpack.serialize(obj, **options)¶Serialize Python data to MsgPack.
| Parameters: |
|
|---|