View difference between Paste ID: hsAKGVQR and QjGFayvU
SHOW: | | - or go back to the newest paste.
1
In [1]: from salt.client.api import APIClient
2
3
In [2]: client = APIClient()
4
5-
Use this data structure to lookup info for a single jid
5+
#Use this data structure to lookup info for a single jid
6
In [3]: cmd_jid = {'fun': 'runner.jobs.lookup_jid', 'kwarg': {'jid': '20131130154312264323'}, 'username': 'adi', 'password': 'cloud', 'eauth': 'pam'}
7
8-
Use this data structure to lookup info for all jids
8+
#Use this data structure to lookup info for all jids
9
10
In [3]: cmd_all = {'fun': 'runner.jobs.list_all', 'username': 'adi', 'password': 'cloud', 'eauth': 'pam'}
11
12-
Poll for events
12+
#Poll for events
13
14
while True:
15
        val = client.get_event(wait=5, tag='salt/', full=True)
16
        if val:
17
                pprint.pprint(val)