SoftLayer中的ObjectFilter不起作用 [英] ObjectFilter in SoftLayer doesn't work

查看:190
本文介绍了SoftLayer中的ObjectFilter不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现ObjectFilter在SoftLayer中不起作用。



我甚至尝试了SoftLayer网页中提供的示例:

https://sldn.softlayer.com/article/object-filters

REST:

列出ID和 dal05

  > https://api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests?objectMask=mask [ID,主机名]安培; ObjectFilter的= { 数据中心:{ 名称:{ 操作: dal05}当我运行这个命令时,它仍然会返回所有的虚拟客户端,不管什么数据中心虚拟宾客所属。

解决方案

试试这个请求:

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

与您的请求相关的问题是您错过了virtualGuests属性,请记住objectFilter正在过滤数据库中的数据,因此您需要告诉它在哪个表上工作什么表的工作记录。例如使用SoftLayer_Account,这意味着所有的工作将在SoftLayer_Account表上,现在您需要告诉id该表的哪个属性/记录工作在这种情况下,您需要在virtualGuests等工作。请记住,您需要查看关于有效属性/记录的文档,例如这些是Softlayer_Account的有效属性/记录:

http://sldn.softlayer.com/reference/datatypes/SoftLayer_Account



问候


I find ObjectFilter doesn't work in SoftLayer.

I even tried the example provided in the SoftLayer webpage here:

https://sldn.softlayer.com/article/object-filters

REST:

List the ID and hostname of all servers in dal05

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

When I ran this command, it still returns all the virtual guests, regardless what data center that virtual guest belongs to.

解决方案

try this request:

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

The issue with your request is that you are missing the "virtualGuests" property, keep in mind that the objectFilter is filtering over the data in the database, so you need to tell it over what table work and over what record of the table work. e.g. using the "SoftLayer_Account" that implies that all the work will be over the "SoftLayer_Account" table now you need to tell id over what property/record of that table work in this case you need to work over the "virtualGuests" and so on. Please keep in mind that and you review the documentation about the valid properties/records e.g. these are the valid properties/record for Softlayer_Account:

http://sldn.softlayer.com/reference/datatypes/SoftLayer_Account

Regards

这篇关于SoftLayer中的ObjectFilter不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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