Softlayer filtering not working

2019-09-07 10:29发布

Why is filtering not working as defined in Softlayer API filtering documentation?

Here is the REST call to the API with filtering:

https://api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests?objectMask=mask[id,datacenter]&objectFilter={"datacenter":{"name":{"operation":"dal05"}}}

And this wont work. It returns virtual hosts from any datacenter, NOT from dal05 ONLY as expected:

<root>
  <item>
    <id>24291415</id>
    <datacenter>
       <id>814994</id>
       <longName>Amsterdam 3</longName>
       <name>ams03</name>
       <statusId>2</statusId>
    </datacenter>
  </item>
  <item>
    <id>26248749</id>
    <datacenter>
      <id>814994</id>
      <longName>Amsterdam 3</longName>
      <name>ams03</name>
      <statusId>2</statusId>
    </datacenter>
  </item>
  <item>
    <id>26248751</id>
    <datacenter>
      <id>814994</id>
      <longName>Amsterdam 3</longName>
      <name>ams03</name>
      <statusId>2</statusId>
    </datacenter>
  </item>
</root>

3条回答
Summer. ? 凉城
2楼-- · 2019-09-07 11:20

Try this object filter

objectFilter={"virtualGuests":{"datacenter":{"name":{"operation":"dal05"}}}}

Regards

查看更多
我命由我不由天
3楼-- · 2019-09-07 11:33

Review this link:

it will provide a clear idea about how to define object filters

查看更多
老娘就宠你
4楼-- · 2019-09-07 11:35

I think this filter is the one which work

objectFilter={"virtualGuests":{"datacenter":{"name":{"operation":"dal05"}}}}

查看更多
登录 后发表回答