About find method in acitoolkit..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2020 02:43 AM - edited 07-29-2020 02:52 AM
I want to know how to find specific object with name. (i.e search EPG object with name)
I already know through the tutorial how to read the list of objects using the get method and for-loop statement.
I am looking for another way not to use a for loop.
I found the find method through the acitoolkit reference documentation, and I am wondering if this can do what I want to do.
If I can use the find class function to find an object with an attribute value, I also need sample code on how to use it.
Thank you for your help.. ^^
- Labels:
-
ACI-toolkit
-
APIC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2020 05:40 PM
I found soulution...
I use get_deep method instead of find.
This is code snippet.
read_tenants_list = Tenant.get_deep(session, names=['common', 'Test_Tenant'], limit_to=['fvTenant', 'fvBD']
for tenant in read_tenants_list:
print(json.dumps(tenant.get_json(), indent=4)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 07:38 AM
Just following up on this and see if you still need help?
Please mark it as Helpful and/or Solution Accepted if that is the case. Thanks for making Engineering easy again.
Connect with me for more on Linkedin https://www.linkedin.com/in/rubencocheno/
