如何使用api定义IP子网的状态 [英] how to define IP subnet's status using api

查看:30
本文介绍了如何使用api定义IP子网的状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用api获得了子网的详细信息,但是我不知道如何确定状态&子网描述.

I got subnet's detail information using api but i don't know how to decide status & description of subnet .

软件层控件的子网详细信息/我页面的子网详细信息

推荐答案

尝试以下休息请求:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Network_Subnet/$subnetId/getIpAddresses?objectMask=mask[guestNetworkComponentBinding]

Method: Get

替换:用您自己的信息替换$ user,$ apiKey和$ subnetId

Replace: $user, $apiKey and $subnetId with your own information

这是以下逻辑:

状态:

如果"guestNetworkComponentBinding"不为空,则状态为使用中"

If the "guestNetworkComponentBinding" is not empty, the status is "In Use"

说明:

如果"guestNetworkComponentBinding"不为空,则说明为主IP"

If the ""guestNetworkComponentBinding" is not empty, the description is "Primary IP"

参考:

这篇关于如何使用api定义IP子网的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆