我阅读了这篇文章,尝试遵循这些示例时遇到了一些问题。以下是该文章中给出的示例之一。对象过滤器中的第一个参数是virtualGuests。可以在api https://api.softlayer.com/rest/v3/SoftLayer_Account/VirtualGuests中使用此对象过滤器。
object_filter = {
'virtualGuests': {
'datacenter': {
'name': {'operation': 'dal05'}
}
}
}
我想在其他api方法中使用对象过滤器,例如SoftLayer_Account / getBlockDeviceTemplateGroups。我的问题是如何获取/设置第一个参数,例如virtualGuests?我尝试了几次,但是失败了。
尝试遵循以下建议:通过Service Datatype获取第一个参数或如何以简单方式定义第一个参数?
您正在尝试获得
如您所见,您正在使用SoftLayer_Account服务,您需要从该服务打开其数据类型:
因此,您需要从这里开始,使用的方法是getBlockDeviceTemplateGroups,如果要在数据类型中获取此信息,则应跳过单词“ get ”并寻找“ BlockDeviceTemplateGroups ”属性,这样您将具有正确的属性。首先需要设置的参数。
如果您注意到,唯一的更改是:从方法中跳过“ get ”一词,在这种情况下为“ getBlockDeviceTemplateGroups ”,因此它将是:
“ BlockDeviceTemplateGroups”
下一步应将第一个字符设置为小写,例如:
“ blockDeviceTemplateGroups”
因此,它应该是过滤器:
object_filter = {
'blockDeviceTemplateGroups': {
'datacenter': {
'name': {'operation': 'dal05'}
}
}
}
参考文献:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句