cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2549
Views
10
Helpful
6
Replies

How to add description to ACI Fabric > Inventory through API

Count2infinity
Level 1
Level 1

Hello,

 

For a Postman Runner collection that I am working on I need to create a request that will update the description under the Fabric > Inventory > Interfaces side of the fabric. I usually do most of my scripting through just doing the config in the GUI and taking the API inspector POST payload and making that the body of my request. I do that with this item using this payload:

 

"{\"infraHPathS\":{\"attributes\":{\"rn\":\"hpaths-101_eth1_14\",\"dn\":\"uni/infra/hpaths-101_eth1_14\",\"descr\":\"TEST\",\"name\":\"101_eth1_14\"},\"children\":[{\"infraRsHPathAtt\":{\"attributes\":{\"dn\":\"uni/infra/hpaths-101_eth1_14/rsHPathAtt-[topology/pod-1/paths-101/pathep-[eth1/14]]\",\"tDn\":\"topology/pod-1/paths-101/pathep-[eth1/14]\"}}}]}}"

 

I get a 

                    "code""400",
                    "text""incomplete node at line '1'"
return from the send request. What payload JSON or XML should I be using for this task? 
 
Any assistance is greatly appreciated! Thank you in advance! 

 

1 Accepted Solution

Accepted Solutions

Sergiu.Daniluk
VIP Alumni
VIP Alumni

Hi @Count2infinity 

 


I usually do most of my scripting through just doing the config in the GUI and taking the API inspector POST payload and making that the body of my request.

That's exactly what I do as well. I have tested what you are trying to do, simply copying the url+payload from the API Inspector, changed the description and for me works just fine:

 

Screenshot 2021-08-19 075316.png

Screenshot 2021-08-19 075332.png

 

Stay safe,

Sergiu

 

View solution in original post

6 Replies 6

Hello and thank you for your reply!

 

I have actually come across this one as well and the issue that I found for it is that is looks like it is for the Fabric > Access Policies side of things for the interface selector and not for the Inventory side for the physical port.

Sergiu.Daniluk
VIP Alumni
VIP Alumni

Hi @Count2infinity 

 


I usually do most of my scripting through just doing the config in the GUI and taking the API inspector POST payload and making that the body of my request.

That's exactly what I do as well. I have tested what you are trying to do, simply copying the url+payload from the API Inspector, changed the description and for me works just fine:

 

Screenshot 2021-08-19 075316.png

Screenshot 2021-08-19 075332.png

 

Stay safe,

Sergiu

 

This was beyond helpful! For some strange reason possibly the code that I am on 4.2 (6h) the API inspector added characters like " and \ that once I got rid of those in the body of my request it worked like a champ! 

 

Thank you so much for your help! 

Ah that was present for me as well (5.2), but I deleted it, to have a proper JSON body.

 

Stay safe,

Sergiu

Oh ok maybe its just something it does for that POST payload and I was just not use to that because the other ones that I have copied have not added those characters and pretty much just work right away.

 

Thank you again!

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