how to define IP subnet's status using api

2019-09-10 02:37发布

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条回答
Summer. ? 凉城
2楼-- · 2019-09-10 03:26

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:

查看更多
登录 后发表回答