how to define IP subnet's status using api

拟墨画扇 提交于 2019-12-13 07:46:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!