使用 objectFilter 排除 Vyatta 的
Using objectFilter to exclude Vyatta's
我正在使用 objectFilter 获取所有具有 ACTIVE Public IP 的硬件设备,但想排除所有 Vyatta 设备。我正在使用以下 URL:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[globalIdentifier,primaryIpAddress,networkManagementIpAddress,hardwareFunction,primaryBackendIpAddress,frontendNetworkComponents]&objectFilter={"hardware":{"frontendNetworkComponents":{"status":{"operation":"ACTIVE"}},"manufacturer":{"operation":"!=Vyatta"}}}
我仍然收到退回的 Vyatta 设备。如何排除 Vyatta 设备?
硬件对象包含一个名为 "networkGatewayMemberFlag" 的 属性 这个 属性 告诉设备是否是网关(或 Vyatta)服务器。
但恐怕这个 属性 不能用在过滤器中。所以你需要在你的对象掩码中添加 属性,一旦你得到响应,你需要使用你自己的代码来过滤使用 属性 的数据。
试试这个请求:
GET https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getHardware?objectMask=mask[operatingSystem,networkGatewayMemberFlag,globalIdentifier,primaryIpAddress,networkManagementIpAddress,hardwareFunction,primaryBackendIpAddress,frontendNetworkComponents]&objectFilter={"hardware":{"frontendNetworkComponents":{"status":{"operation":"ACTIVE"}},"operatingSystem":{"softwareLicense":{"softwareDescription":{"manufacturer":{"operation":"!=Vyatta"}}}}}}
此致
我正在使用 objectFilter 获取所有具有 ACTIVE Public IP 的硬件设备,但想排除所有 Vyatta 设备。我正在使用以下 URL:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[globalIdentifier,primaryIpAddress,networkManagementIpAddress,hardwareFunction,primaryBackendIpAddress,frontendNetworkComponents]&objectFilter={"hardware":{"frontendNetworkComponents":{"status":{"operation":"ACTIVE"}},"manufacturer":{"operation":"!=Vyatta"}}}
我仍然收到退回的 Vyatta 设备。如何排除 Vyatta 设备?
硬件对象包含一个名为 "networkGatewayMemberFlag" 的 属性 这个 属性 告诉设备是否是网关(或 Vyatta)服务器。
但恐怕这个 属性 不能用在过滤器中。所以你需要在你的对象掩码中添加 属性,一旦你得到响应,你需要使用你自己的代码来过滤使用 属性 的数据。
试试这个请求:
GET https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getHardware?objectMask=mask[operatingSystem,networkGatewayMemberFlag,globalIdentifier,primaryIpAddress,networkManagementIpAddress,hardwareFunction,primaryBackendIpAddress,frontendNetworkComponents]&objectFilter={"hardware":{"frontendNetworkComponents":{"status":{"operation":"ACTIVE"}},"operatingSystem":{"softwareLicense":{"softwareDescription":{"manufacturer":{"operation":"!=Vyatta"}}}}}}
此致