我试图通过使用过滤器的softlayer API获取 storageID
. 但即使我用方法应用过滤器,它也会给我列出所有存储空间 .
import SoftLayer
import json
storagename = "ABC-123"
client = SoftLayer.Client()
accountservice = client['SoftLayer_Account']
objectFilterstorage = {"username": {"operation": storagename}}
storageId = accountservice.getNetworkStorage(filter=objectFilterstorage)
print storageId
另外,我们如何在获取特定产品列表时找出需要哪些属性?
在这里,我找到了属性并将列表列入'objectFilterstorage' . 但我仍然困惑它是如何运作的 .
1 回答
尝试以下python脚本:
另外,我可以建议查看以下链接,以清楚了解objectFilters的工作原理:
Object Filters
Going Further with the SoftLayer API Python Client - Part 1
Going Further with the SoftLayer API Python Client - Part 2
我希望它有所帮助,请让我知道任何疑问或评论