cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1020
Views
5
Helpful
3
Replies

XML API to add VLAN

davshapi
Level 1
Level 1

I am using CPO to automate some UCS activities. I already have processes to list inventory items such as blades, VLANs, and so on. Since I am not a developer I am having trouble making heads or tails of the UCS XML API user guides. 

I'd like some help crafting my XML query to add a VLAN to the LAN Cloud and then associate that VLAN to a given vNIC template. Below is what I've gathered so far about how such a query is executed. 

Specific goals:

  • Pass name and ID to process
  • Execute XML query to create new VLAN with given ID/Name
  • Associate that new VLAN to a given vNIC template

<configConfMo inHierarchical="false" dn="fabric/lan">

<inConfig>

<????></????>

</inConfig>

</configConfMo>

 

 

3 Replies 3

To add a VLAN:

<?xml version="1.0"?>

<configConfMos cookie="auth_cookie" inHierarchical="true">
 
<inConfigs>
    
<pair key="fabric/lan/net-example-vlan-name">
      
<fabricVlan defaultNet="no" dn="fabric/lan/net-example vlan name" id="1132" name="example_vlan_name" status="created"/>
    
</pair>
 
</inConfigs>

</configConfMos>

Perfect! Thank you for that bit of code. I am still having trouble associating that new VLAN with a vNIC template. Could you post an example XML command to do this? 

Hi Venelin,

Thanks for sharing the xml command to add a vlan. How do I create a vlan and associate it with a network? Do we associate after creating the vlan or we create a vlan with network info. 

Thanks for your help.

 

Regards,

Ritu

Review Cisco Networking for a $25 gift card

Review Cisco Networking for a $25 gift card