Manage a local persistent data structure that can hold any arbitrary data specific to the minion
salt.modules.data.
cas
(key, value, old_value)¶Check and set a value in the minion datastore
CLI 范例:
salt '*' data.cas <key> <value> <old_value>
salt.modules.data.
clear
()¶Clear out all of the data in the minion datastore, this function is destructive!
CLI 范例:
salt '*' data.clear
salt.modules.data.
dump
(new_data)¶Replace the entire datastore with a passed data structure
CLI 范例:
salt '*' data.dump '{'eggs': 'spam'}'
salt.modules.data.
get
(key, default=None)¶Get a (list of) value(s) from the minion datastore
2015.8.0 新版功能.
CLI 范例:
salt '*' data.get key
salt '*' data.get '["key1", "key2"]'
salt.modules.data.
has_key
(key)¶Check if key is in the minion datastore
2015.8.0 新版功能.
CLI 范例:
salt '*' data.has_key <mykey>
salt.modules.data.
items
()¶Get items from the minion datastore
2015.8.0 新版功能.
CLI 范例:
salt '*' data.items
salt.modules.data.
keys
()¶Get all keys from the minion datastore
2015.8.0 新版功能.
CLI 范例:
salt '*' data.keys
salt.modules.data.
load
()¶Return all of the data in the minion datastore
CLI 范例:
salt '*' data.load
salt.modules.data.
pop
(key, default=None)¶Pop (return & delete) a value from the minion datastore
2015.5.2 新版功能.
CLI 范例:
salt '*' data.pop <key> "there was no val"
salt.modules.data.
update
(key, value)¶Update a key with a value in the minion datastore
CLI 范例:
salt '*' data.update <key> <value>
salt.modules.data.
values
()¶Get values from the minion datastore
2015.8.0 新版功能.
CLI 范例:
salt '*' data.values