如何过滤VLAN列表,使其仅对虚拟访客订单有效? [英] How can I filter the list of VLANs to just get ones valid for virtual guest orders?

查看:112
本文介绍了如何过滤VLAN列表,使其仅对虚拟访客订单有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想过滤一个帐户中的VLAN列表,以便仅列出可用于订购虚拟访客的VLAN.我正在使用Softlayer_Account_Service.getNetworkVlans().

I would like to filter the list of VLANs on an account so that I only list the VLANs which can be used to order a Virtual Guest. I am using Softlayer_Account_Service.getNetworkVlans().

我需要过滤什么?它只是对networkVlans.type.keyName = STANDARD进行过滤?

What do I need to filter by? It is just filtering for networkVlans.type.keyName = STANDARD?

当我从列表中选择VLAN时,我试图避免出现此错误:SoftLayer_Exception_Public: The frontend VLAN #xxxxxxx is not a standard VLAN. (HTTP 500)

I’m trying to avoid being able to hit this error when I select a VLAN from my list: SoftLayer_Exception_Public: The frontend VLAN #xxxxxxx is not a standard VLAN. (HTTP 500)

谢谢.

推荐答案

要获取可用的VLAN进行订购,请参阅以下链接上的检索VLAN-基于包和位置"的可用子网"部分:

In order to get available vlans for ordering, see Retrieve Vlans - Subnets available based on Package and Location section on the below link:

对于Vsi,应为:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Order/getVlans

Method: Post

{
  "parameters": 
   [
       448994, 46
   ]
}

替换: $ user $ apiKey 448994 以及要订购的位置标识符

Replace: $user, $apiKey and 448994 with the location identifier that you would like to order

获取数据中心标识符:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Location/getDatacenters

Method: Get


要从特定位置获取标准VLAN

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkVlans?objectMask=mask[type,primaryRouter[datacenter]]&objectFilter={"networkVlans":{"type":{"keyName":{"operation":"STANDARD"}}, "primaryRouter":{"datacenter":{"name":{"operation":"wdc01"}}}}}

Method: Get

替换: $ user $ apiKey wdc01 ,用您想要获取虚拟局域网的位置

Replace: $user, $apiKey and wdc01 with the location that you would like to get the vlans

这篇关于如何过滤VLAN列表,使其仅对虚拟访客订单有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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