SoftLayer API to know and total and available IPs in a VLAN
Hello,
Which API can be used to know the total IPs and the used/usable IPs of a VLAN if I know the VLAN ID
.
One way I could figure out is I can get subnets of a VLAN and then in subnet details I can see total and usable IPs with "totalIpAddresses,usableIpAddressCount"
attributes . But then I will have to get sum of total and usable IPs for a VLAN since a VLAN has multiple subnets. Not sure if this is the correct way.
Thanks
To get the information for the vlan about its subnets with the total used/usable IPs, try the following Python Script.
This script will help to get the exact number of free slots from subnets inside the vlan.
References: SoftLayer_Account::getNetworkVlans
Please, try the following:
Or,
if you want this request retrieves the
VLAN
associated with an IP address via the IP's associated subnet:URL:
Json:
Reference: getVlanForIpAddress
Also you can see the meaning of data displayed in 'Subnet' section of above request, i.e.:
totalIpAddresses: The number of IP addresses contained within this subnet.
usableIpAddressCount: The number of IP addresses that can be addressed within this subnet.