libsolace.SolaceReply module

class libsolace.SolaceReply.SolaceReply(document)[source]

Bases: object

Create a “dot-name-space” navigable object from a dictionary

class libsolace.SolaceReply.SolaceReplyHandler(document=None, version='soltr/6_0', primaryOnly=False, backupOnly=False, **kwargs)[source]

Bases: object

Solace reply handler, pass a SolaceAPI replies into this for easier handling of the dict structures.

TODO FIXME: add primary / backup only support somehow, now its just mapping the data in the first nodes response and ignoring the second, potentially ignoring the “primary” if its NOT the 1st host in the “MGMT” config

Example:
>>> from libsolace.SolaceReply import SolaceReplyHandler
>>> srh = SolaceReplyHandler([{'HOST': 'http://solace2/SEMP', u'rpc-reply': {u'rpc': {u'show': {u'client-username': {u'client-usernames': {u'client-username': {u'profile': u'glassfish', u'acl-profile': u'dev_testvpn', u'max-endpoints': u'16000', u'client-username': u'dev_testvpn', u'enabled': u'true', u'message-vpn': u'dev_testvpn', u'password-configured': u'true', u'num-clients': u'0', u'num-endpoints': u'2', u'subscription-manager': u'false', u'max-connections': u'500', u'guaranteed-endpoint-permission-override': u'false'}}}}}, u'execute-result': {u'@code': u'ok'}, u'@semp-version': u'soltr/6_0'}}])
>>> str(srh.reply.show.client_username.client_usernames.client_username.profile)
'glassfish'