how to use the ACI Toolkit session module effectively ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2018 10:59 AM
I just want to know how to use the ACI session module. I am testing subscripting and would really like some very simple examples: such as
here is how to create the session
session = acisession(a,b,c)
here is how to start subscribing
subscribe = session.subscribe()
here is how to specify the class that you want to subscribe
subscribe = session.subscribe('aaaModLR')
- Labels:
-
ACI-toolkit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2018 11:34 AM
made some progress, but I can't seem to get the count to increase, no matter what I do to the static binding. Any idea what's wrong with the code ?
session = acisession.Session(url, uid, pwd)
session.login()
count = session.get_event_count(url)
result = session.subscribe(url=url, only_new=True).json()
if count > 0:
print(result['imdata'][0]['fvRsPathAtt']['attributes']['dn'])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2023 06:57 AM - edited 07-12-2023 06:59 AM
I would try inserting print statement to see value of count and also print the type, as it may be string, that you would need to convert to integer.
print(f'(the count is {count} and it is of type {type(count)}')
You may also need to drill down into the 'session' object and see what else you can work with
print(dir(session))
*I'm assuming you're using Python3
