ObjectFilter in SoftLayer doesn't work

旧街凉风 提交于 2019-12-02 03:47:33

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

Maybe you can try adding virtualGuestsin the filter, something like this:

objectFilter={ "virtualGuests": { "datacenter": { "longName": { "operation": "Dallas 6" } } } }

or please see the first examples of https://sldn.softlayer.com/article/object-filters, like this:

object_filter = {
    'virtualGuests': {
        'datacenter': {
            'name': {'operation': 'dal05'}
        }
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!