cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
952
Views
0
Helpful
1
Replies

Cobra SDK for ACI to update existing tenants

juan-ruiz
Level 1
Level 1

The goal: Create a script that modifies existing ACI tenants and adds vrf and bridge domains to already created tenants.

I used API inspector to retrieve the JSON post snippet that modifies an existing tenant. Then I used arya.py  to convert that JSON snippet into a python script with the various cobra modules. All appears to be fine until I run the script and I get the following message.

Traceback (most recent call last):

  File "test3.py", line 75, in <module>

    fvTenant = cobra.model.fv.Tenant(topMo)

TypeError: __init__() takes at least 3 arguments (2 given)

Attached is the JSON code from API inspector and the converted code.  I have no problems creating fresh new tenants using this procedure but updating existing ones I do.

Can someone please review and make recommendations?

Thank you!

1 Accepted Solution

Accepted Solutions

juan-ruiz
Level 1
Level 1

I found my issue.

on this line of code

I had this and it was missing the tenant and I needed this

had = fvTenant = cobra.model.fv.Tenant(topMo)

needed =  fvTenant = cobra.model.fv.Tenant(topMo,ten)

Now I have the required info.

View solution in original post

1 Reply 1

juan-ruiz
Level 1
Level 1

I found my issue.

on this line of code

I had this and it was missing the tenant and I needed this

had = fvTenant = cobra.model.fv.Tenant(topMo)

needed =  fvTenant = cobra.model.fv.Tenant(topMo,ten)

Now I have the required info.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:


This community is intended for developer topics around Data Center technology and products. If you are looking for a non-developer topic about Data Center, you might find additional information in the Data Center and Cloud community