salt.modules.data
Manage a local persistent data structure that can hold any arbitrary data specific to the minion
-
Check and set a value in the minion datastore
CLI Example:
salt '*' data.cas <key> <value> <old_value>
salt.modules.data.cas(key, value, old_value)
-
Clear out all of the data in the minion datastore, this function is destructive!
CLI Example:
salt '*' data.clear
salt.modules.data.clear()
-
Replace the entire datastore with a passed data structure
CLI Example:
salt '*' data.dump '{'eggs': 'spam'}'
salt.modules.data.dump(new_data)
-
Get a (list of) value(s) from the minion datastore
New in version 2015.8.0.
CLI Example:
salt '*' data.get key salt '*' data.get '["key1", "key2"]'
salt.modules.data.get(key, default=None)
-
Check if key is in the minion datastore
New in version 2015.8.0.
CLI Example:
salt '*' data.has_key <mykey>
salt.modules.data.has_key(key)
-
Get items from the minion datastore
New in version 2015.8.0.
CLI Example:
salt '*' data.items
salt.modules.data.items()
-
Get all keys from the minion datastore
New in version 2015.8.0.
CLI Example:
salt '*' data.keys
salt.modules.data.keys()
-
Return all of the data in the minion datastore
CLI Example:
salt '*' data.load
salt.modules.data.load()
-
Pop (return & delete) a value from the minion datastore
New in version 2015.5.2.
CLI Example:
salt '*' data.pop <key> "there was no val"
salt.modules.data.pop(key, default=None)
-
Update a key with a value in the minion datastore
CLI Example:
salt '*' data.update <key> <value>
salt.modules.data.update(key, value)
-
Get values from the minion datastore
New in version 2015.8.0.
CLI Example:
salt '*' data.values
salt.modules.data.values()
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.data.html