charmhelpers.contrib.peerstorage package¶
- charmhelpers.contrib.peerstorage.peer_echo(includes=None)¶
Echo filtered attributes back onto the same relation for storage.
This is a requirement to use the peerstorage module - it needs to be called from the peer relation’s changed hook.
- charmhelpers.contrib.peerstorage.peer_retrieve(key, relation_name='cluster')¶
Retrieve a named key from peer relation relation_name.
- charmhelpers.contrib.peerstorage.peer_retrieve_by_prefix(prefix, relation_name='cluster', delimiter='_', inc_list=None, exc_list=None)¶
Retrieve k/v pairs given a prefix and filter using {inc,exc}_list
- charmhelpers.contrib.peerstorage.peer_store(key, value, relation_name='cluster')¶
Store the key/value pair on the named peer relation relation_name.
- charmhelpers.contrib.peerstorage.peer_store_and_set(relation_id=None, peer_relation_name='cluster', peer_store_fatal=False, relation_settings=None, delimiter='_', **kwargs)¶
Store passed-in arguments both in argument relation and in peer storage.
It functions like doing relation_set() and peer_store() at the same time, with the same data.
- @param relation_id: the id of the relation to store the data on. Defaults
- to the current relation.
- @param peer_store_fatal: Set to True, the function will raise an exception
- should the peer sotrage not be avialable.