The Cisco Intersight Universal API Calls module provides a set of functions that simplify creation, retrieval, modification, and deletion of resources on Cisco Intersight. Any available API types listed in the Cisco Intersight API Reference library can be accessed, including those which do not yet have a specific module in the Intersight SDK for Python.
The path to any API types you are interested in working with. For example, if you are interested in creating an Adapter Configuration Policy on Intersight, you would need the path "adapter/ConfigPolicies". The path to available Cisco Intersight API types can be found in the API Reference section athttps://intersight.com/apidocs/introduction/overview/.
Please ensure that the above prerequisites have been met.
Download the intersight_universal_api_calls.py file for the Cisco Intersight Universal API Calls module from here on GitHub.
Edit the intersight_universal_api_calls.py file to set the key_id and key variables using the following instructions:
Open the intersight_universal_api_calls.py file in an IDLE or text editor of choice.
Find the comment"MODULE REQUIREMENT 1".
Underneath, you will find the variablekey_id = "".
Fill in between the quotes of thekey_idvariable value with the ID of your API key. For example:key_id = "5c89885075646127773ec143/5c82fc477577712d3088eb2f/5c8987b17577712d302eaaff".
Find the comment"MODULE REQUIREMENT 2".
Underneath, you will find the variablekey = "".
Fill in between the quotes of thekeyvariable value with your system's file path to the SecretKey.txt file for your API key. For example:key = "C:\Keys\Key1\SecretKey.txt".
Save the changes you have made to the intersight_universal_api_calls.py file.
The intersight_universal_api_calls.py file is now ready for use. The file can be ran directly or imported into another module. See the"How to Use:"section for information on the available functions and sample commands for directions on use.
How to Use:
The Cisco Intersight Universal API Calls module contains six functions for creating, retrieving, modifying, and deleting resources. The following is a list of the functions and sample commands for each:
iu_get()- Performs a universal or generic GET on objects under any available Intersight API type.
The required arguments areapi_path.
Here are sample commands to retrieve all available Adapter Configuration policies:
iu_post_moid()- Performs a universal or generic POST on a specified object under any available Intersight API type.
The required arguments areapi_path,moidandbody.
Here are sample commands to modify a specific Adapter Configuration policy. In this instance, the LLDP and FIP protocol settings on slot ID #1 of the Adapter Configuration policy are being disabled. The MOID below is an example:
I configured policy-based routing for an SVI in a Nexus 9K. The goal was to route internet-destined traffic for this VLAN to a different firewall, allowing normal routing for all internal destinations. Here's what I configured: ip access-list PA_PILO...
I am trying to run a Hyperflex command to get some info I was able to run some commands on the Web CLI but I need to run these 2 commands. How do I login to the controller or springpath and get the info? cat /var/log/springpath/diskslotmap-v2.tx...
Hello Gents,I have two 3548 nexus switches in Data Center AI have two 5672 nexus switches in Data Center B What technology can I use to setup a unique gateway between those 2 Data Centers, Thanks,Edouard.
Hello, I had one sup720 failed on a WS-C6504-E running version 15.1(2)SY8. Cisco sent a replacement running version 12.2(33)SXH8b. The issue is that after some time when the replacement sup was inserted the whole chassis reboot...
Hi all,Please see attached diagram for clarity. i have a multipod environment (2 pods). in each pod, i use a static default route to a local firewall, and leaf switches in each pod send default traffic to the local exit point, as you'd expect.&n...