Reputation: 13
The following api call does not return an error and appears to work, but the vlan does not actually get trunked. Instead we have to manually reach out to SoftLayer and have them trunk the vlan to the specified devices.
This is the api call, in Python, although it should be similar in other languages:
client['Network_Component'].addNetworkVlanTrunks([{'id': 121212}], id=565656)
Sadly, SoftLayer was unable to research or address this at all via their internal ticketing system. Instead they told us to post the issue here, as this is apparently where their "api experts" hang out.
Does anyone have insight they can share related to this api call?
Upvotes: 0
Views: 174
Reputation: 2757
The api call that you are using to add the networkVlanTrunks works fine.
If you want to check if the vlan trunks were added successfully, you should check the Uplink Component and its networkVlanTrunks, as says in this link: SoftLayer_Network_Component::addNetworkVlanTrunks
Try the following python script for it:
"""
This script Retrieve the network component linking this object to parent and
their network vlan trunks
See below references for more details.
Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Component/getUplinkComponent
http://sldn.softlayer.com/article/object-masks
@License: http://sldn.softlayer.com/article/License
@Author: SoftLayer Technologies, Inc. <[email protected]>
"""
import SoftLayer
from pprint import pprint as pp
# Your SoftLayer username and apiKey
user = 'set me'
api = 'set me'
# Connect to SoftLayer
client = SoftLayer.create_client_from_env(username=user, api_key=api)
# Define the network component Id
networkComponentId = 916616
# Define an object mask to get network vlan trunks
mask = 'mask[networkVlanTrunks]'
try:
result = client['SoftLayer_Network_Component'].getUplinkComponent(mask=mask, id=networkComponentId)
pp(result)
except SoftLayer.SoftLayerAPIError as e:
print('Error faultCode=%s, faultString=%s'
% (e.faultCode, e.faultString))
exit(1)
I did some tests and I verified that the vlan trunks were added successfully.
I hope it helps. Please, let me know any doubt or comment about it.
Upvotes: 0