Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [1]: from salt.client.api import APIClient
- In [2]: client = APIClient()
- #Use this data structure to lookup info for a single jid
- In [3]: cmd_jid = {'fun': 'runner.jobs.lookup_jid', 'kwarg': {'jid': '20131130154312264323'}, 'username': 'adi', 'password': 'cloud', 'eauth': 'pam'}
- #Use this data structure to lookup info for all jids
- In [3]: cmd_all = {'fun': 'runner.jobs.list_all', 'username': 'adi', 'password': 'cloud', 'eauth': 'pam'}
- In [4]: client.run(cmd_jid) # or client.run(cmd_all)
- #Poll for events
- while True:
- val = client.get_event(wait=5, tag='salt/', full=True)
- if val:
- pprint.pprint(val)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement