0
votes

I am implementing to get the list of Vlans. How can I know if the vlan is removable or not in the list? Please let me know if there is API to delete Vlan and sample code to implement it. Please refer to the captured image.

Delete Vlan

1

1 Answers

0
votes

Well basically to cancel a resource or device in Softlayer you have to cancel the associated billing item, you can use these methods:

http://sldn.softlayer.com/reference/services/SoftLayer_Billing_Item/cancelItem http://sldn.softlayer.com/reference/services/SoftLayer_Billing_Item/cancelService http://sldn.softlayer.com/reference/services/SoftLayer_Billing_Item/cancelServiceOnAnniversaryDate

You know that a VLAN can be cancelated because it has an associated billingItem, take a look at the objectMask of this restFul example, it will help you to fetch all data that you need:

GET http://api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkVlans?objectMask=mask[id,name,vlanNumber,networkSpace,note,primaryRouter[id,hostname,datacenter[id,name,longName]],networkVlanFirewall[id,fullyQualifiedDomainName],attachedNetworkGateway[id,name],attachedNetworkGatewayVlan[bypassFlag],billingItem[id,cancellationDate],type,firewallNetworkComponentCount,firewallGuestNetworkComponentCount]

Regards