cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1060
Views
5
Helpful
2
Replies

About find method in acitoolkit..

JM.LEE
Level 1
Level 1

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.. ^^

 

 

 

 

2 Replies 2

JM.LEE
Level 1
Level 1

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)

Ruben Cocheno
Spotlight
Spotlight

@JM.LEE 

Just following up on this and see if you still need help?

Tag me to follow up.
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/