cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2093
Views
10
Helpful
2
Replies

ACI Full Hardware Inventory

julian.celer
Level 1
Level 1

i, I am trying to extract the hardware inventory from ACI using an API. The information is required to maintain an accurate lifecyle inventory.

I have tried the following api:

"api/node/mo/topology/pod-1.json?query-target=children&target-subtree-class=fabricNode"
The issue is that this doesn't provide all of the sub items e.g. PSU, FAN etc.

 

I am after the same level of detail as is provided by the following cli command:

fabric <node-id> show inventory

The above command also has filtering based on inventory type e.g. chassis fans module power_supply

The default option is all items.

Is it possible to get the same information using an API call.

I have also tried using "moquery -c fabricNode,eqptFt,eqptPsu", but the detail isn't the same as the cli output from show inventory.

Hence the query.

1 Accepted Solution

Accepted Solutions

Aleksandr Ismagilov
Cisco Employee
Cisco Employee

You can try:

 moquery -c topSystem -x query-target=subtree -x target-subtree-class=topSystem,eqptCh,eqptFan,eqptPsu

Add classes that you want to include in the last filter.

 

View solution in original post

2 Replies 2

Aleksandr Ismagilov
Cisco Employee
Cisco Employee

You can try:

 moquery -c topSystem -x query-target=subtree -x target-subtree-class=topSystem,eqptCh,eqptFan,eqptPsu

Add classes that you want to include in the last filter.

 

Thanks for supply the query above. I managed to turn the moquery into a API call which works a treat.

Returns all nodes and details

/api/class/topSystem.json?query-target=subtree&target-subtree-class=topSystem,eqptCh,eqptFan,eqptPsu
Pod and Node specific
/api/node/mo/topology/pod-{{ pod }}/node-{{ nodeid }}.json?query-target=subtree&target-subtree-class=eqptCh,eqptFan,eqptPsu
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:

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