How to use object filter with softlayer rest api?

 ̄綄美尐妖づ 提交于 2019-11-27 05:22:00

Try to follow these recomendations: Getting first parameter through Service Datatype or How to define the first parameter as simple way?


Getting first parameter through Service Datatype

You are trying to get

As you see, you are using SoftLayer_Account service, you need to open its datatype from this service:

So, you need to start here, the method that you are using is getBlockDeviceTemplateGroups, if you want to get this information in the datatypes, you should skip the word "get" and looking for "BlockDeviceTemplateGroups" property, so you will have the correct parameter that you need to set at first.


How to define the first parameter as simple way?

If you notice, the only changes were: skip "get" word from the method, in this case is "getBlockDeviceTemplateGroups", so it will be:

"BlockDeviceTemplateGroups"

The next step should be set the first char in lowercase like:

"blockDeviceTemplateGroups"

So, it should be the filter:

object_filter = {
'blockDeviceTemplateGroups': {
    'datacenter': {
        'name': {'operation': 'dal05'}
        }
    }
}

References:

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