我希望在OSReload期间使用API获取可用的操作系统列表。我发现SoftLayer_Account::getOperatingSystemReloadImages is mentioned.But方法找不到这个方法的用法。谁能帮我这个忙?谢谢。
发布于 2016-04-12 15:10:23
我找不到这个方法getOperatingSystemReloadImages。但我找到了一种获得操作系统重新加载选项的方法:
首先,我们需要知道用于订购服务器的包。例如,对于Virtual Guests,使用的包是46。但是,如果您想确认这一点,请执行以下Rest请求:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[vsi_id]/getBillingItem?objectMask=mask[package]
Method: GET然后,要获得”Reload options”,请执行:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/46/getItemPrices?objectFilter={ "itemPrices": { "categories": { "categoryCode": { "operation": "os" } } } }&objectMask=mask[id,item[softwareDescription], categories[categoryCode]]
Method: GET参考资料:
嘉宾:getBillingItem
包::getItemPrice
编辑:
现在,为了使用” SoftLayer_Virtual_Guest::reloadOperatingSystem”,我们需要在Json主体配置中添加一些参数:“token”和“config”(Ref:客户::重装操作系统)
下面是一个REST示例:
URL:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[virtual_Guest_ID]/reloadOperatingSystem方法:员额
杰森:
{
"parameters": [
"FORCE",
{
"itemPrices": [
{
"id": 45466
}
]
}
]
}其中: 45466是操作系统的新priceId
https://stackoverflow.com/questions/36563416
复制相似问题