salt.modules.memcached

Module for Management of Memcached Keys

2014.1.0 新版功能.

salt.modules.memcached.add(key, value, host='127.0.0.1', port=11211, time=0, min_compress_len=0)

Add a key to the memcached server, but only if it does not exist. Returns False if the key already exists.

CLI 范例:

salt '*' memcached.add <key> <value>
salt.modules.memcached.decrement(key, delta=1, host='127.0.0.1', port=11211)

Decrement the value of a key

CLI 范例:

salt '*' memcached.decrement <key>
salt '*' memcached.decrement <key> 2
salt.modules.memcached.delete(key, host='127.0.0.1', port=11211, time=0)

Delete a key from memcache server

CLI 范例:

salt '*' memcached.delete <key>
salt.modules.memcached.get(key, host='127.0.0.1', port=11211)

Retrieve value for a key

CLI 范例:

salt '*' memcached.get <key>
salt.modules.memcached.increment(key, delta=1, host='127.0.0.1', port=11211)

Increment the value of a key

CLI 范例:

salt '*' memcached.increment <key>
salt '*' memcached.increment <key> 2
salt.modules.memcached.replace(key, value, host='127.0.0.1', port=11211, time=0, min_compress_len=0)

Replace a key on the memcached server. This only succeeds if the key already exists. This is the opposite of memcached.add

CLI 范例:

salt '*' memcached.replace <key> <value>
salt.modules.memcached.set(key, value, host='127.0.0.1', port=11211, time=0, min_compress_len=0)

Set a key on the memcached server, overwriting the value if it exists.

CLI 范例:

salt '*' memcached.set <key> <value>
salt.modules.memcached.status(host='127.0.0.1', port=11211)

Get memcached status

CLI 范例:

salt '*' memcached.status