问题
I got subnet's detail information using api but i don't know how to decide status & description of subnet .
softlayer control's subnet detail / my page's subnet detail
回答1:
Try the following rest request:
https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Network_Subnet/$subnetId/getIpAddresses?objectMask=mask[guestNetworkComponentBinding]
Method: Get
Replace: $user, $apiKey and $subnetId with your own information
This is the logic for:
Status:
If the "guestNetworkComponentBinding" is not empty, the status is "In Use"
Description:
If the ""guestNetworkComponentBinding" is not empty, the description is "Primary IP"
References:
- SoftLayer_Network_Subnet::getIpAddresses
来源:https://stackoverflow.com/questions/37346828/how-to-define-ip-subnets-status-using-api