cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1046
Views
0
Helpful
3
Replies

ACI Automation using Excel sheets

IslamOmar
Level 1
Level 1

has anyone tried before automating cisco ACI using excel sheets , by filling ACI Objects and uploading them to ACI ?

If yes , do you have any template to be followed?

 

 

3 Replies 3

RedNectar
VIP
VIP

Hi @IslamOmar ,

Lots of people have put stuff on GitHub - have you tried there?

https://www.google.com/search?q=aci+excel+github

 

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

Hi , have checked that but I'm looking for specifically an excel sheet template that you upload directly to ACI for configuring objects without using any automation tools .

Hi @IslamOmar ,

You can upload information into ACI in either XML or JSON formats.

Excel does not have options to save data in these formats. However, both XML and JSON are text formats - more on that later

The point is - to get a flat file database structure (a.k.a. spreadsheet) into a format that can be fed into ACI is going to require some kind of program to take the excel format and put it into XML or JSON then sent it to ACI.

Which is what all the projects on Github do (AFAIK) - using python or some other programming language.  So you are not going to find a way to "upload directly" into ACI. 

BUT

As I said before, both XML and JSON are text formats, and excel does have a Save As text file option.  In the past I have successfully created a spreadsheet that had a tab pre-configured with each row corresponding to a line in JSON format, taking values from another tab in the SS.  By saving that tab in text format (TBH I just select all and copy to a text editor) I've been able to create JSON formatted files from excel, and import the result directly into another program (in my case it was the HyperFlex installer).

So to create a Tenant (for example) in Excel, you could have a tab that had the lines:

{
"fvTenant": {
"attributes": {
"annotation": "",
"descr": "Created for IslamOmar",
"dn": "tn-Test",
"name": "Test",
"nameAlias": "",
"ownerKey": "",
"ownerTag": "",
"userdom": ":all:"
}
}
}

Where those lines extracted the values from another sheet - if the other sheet was called Raw and had these values in cells A1:B2

Tenant Name Description
Test Created for IslamOmar

then the formula view for the Json tab would be:

{
"fvTenant": {
"attributes": {
"annotation": "",
="""descr"": """&Raw!B2&""","
="""dn"": ""tn-"&Raw!A2&""","
="""name"": """&Raw!A2&""","
"nameAlias": "",
"ownerKey": "",
"ownerTag": "",
"userdom": ":all:"
}
}
}

There you go! It CAN be done.

But trust me, it is MUCH simpler to write a little python code than fiddle with all those double and triple quotes in Excel (it would probably have been easier if I used a combination of ' and ")

RedNectar aka Chris Welsh.
Forum Tips: 1. Paste images inline - don't attach. 2. Always mark helpful and correct answers, it helps others find what they need.

Save 25% on Day-2 Operations Add-On License