SoftLayer_Account::getOperatingSystemReloadImages [英] SoftLayer_Account::getOperatingSystemReloadImages
问题描述
我想在 OSReload 期间使用 API 获取可用的操作系统列表.我发现提到了 SoftLayer_Account::getOperatingSystemReloadImages 方法.但找不到有关此方法的用法.谁能帮我解决这个问题?谢谢.
I want to use API to get the available OS list during OSReload. I found the method SoftLayer_Account::getOperatingSystemReloadImages is mentioned.But cannot find the usage about this method. Who can help me on this? Thanks.
推荐答案
我找不到这个方法 getOperatingSystemReloadImages
.但我找到了一种获取操作系统重新加载选项的方法:
I was not able to find this method getOperatingSystemReloadImages
. But I found a way to get OS reload options:
首先,我们需要知道用于订购服务器的包.例如对于VirtualGuest
,使用的包是46
.但是如果你想确认这一点,请执行以下Rest
请求:
First, we need to know the package used to order the server. For example for Virtual Guests
, the package used is 46
. But if you want to confirm this, please execute the following Rest
request:
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
参考:
SoftLayer_Virtual_Guest::getBillingItem
SoftLayer_Product_Package::getItemPrices
现在,为了使用SoftLayer_Virtual_Guest::reloadOperatingSystem"
,我们需要在Json body配置中添加一些参数:token"和config"(参考:SoftLayer_Virtual_Guest::reloadOperatingSystem)
Now, in order to use " SoftLayer_Virtual_Guest::reloadOperatingSystem"
, we need add some parameters in Json body configuration: "token" and "config" (Ref: SoftLayer_Virtual_Guest::reloadOperatingSystem)
下面是一个 REST 示例:
网址:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[virtual_Guest_ID]/reloadOperatingSystem
方法:POST
杰森:
{
"parameters": [
"FORCE",
{
"itemPrices": [
{
"id": 45466
}
]
}
]
}
其中:45466 是操作系统的新 priceId
Where: 45466 is the new priceId of the OS
这篇关于SoftLayer_Account::getOperatingSystemReloadImages的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!