I tried to use softlayer api to get/remove/add trunk. http://sldn.softlayer.com/reference/services/SoftLayer_Network_Component
our baremetal has already trunked by Softlayer ticket. We want to remove the trunk first. and then add trunk.
We could getNetworkVlanTrunks using baremetal uplinkComponent ID.
client['SoftLayer_Network_Component'].getNetworkVlanTrunks(id=networkcomponentId)
Here is the output of get trunk:
[{'networkComponentId': <networkcomponentId>, 'networkVlanId': <vlanid-1>}, {'networkComponentId': <networkcomponentId>, 'networkVlanId': <vlanid-2>}]
Now, we want to remove trunk of vlanid-2.
vlan = client['Network_Vlan'].getObject(id=<vlanid-2>)
client['SoftLayer_Network_Component'].removeNetworkVlanTrunks([vlan], id=networkcomponentId)
However, we got this error when removeNetworkVlanTrunks:
File "/usr/lib64/python2.7/site-packages/SoftLayer/transports.py", line 187, in __call__
raise _ex(ex.faultCode, ex.faultString)
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_InternalError): An internal system error has occurred.
Does anyone know about how this happen? Are we using the right networkComponentID for remove? Does anyone know how to use the addNetworkVlanTrunks?