[英]Reload a different OS using reloados REST API
I issue the following URL to reload a virtual guest with the current OS.我发出以下 URL 以使用当前操作系统重新加载虚拟客户。 rest/v3/SoftLayer_Virtual_Guest/1234/reloadOperatingSystem休息/v3/SoftLayer_Virtual_Guest/1234/reloadOperatingSystem
What parameter do I specify to reload the virtual guest with a different operating system?我应该指定什么参数来使用不同的操作系统重新加载虚拟来宾?
The SoftLayer_Virtual_Guest::reloadOperatingSystem service has a confirmation protocol for proceeding with the reload. SoftLayer_Virtual_Guest::reloadOperatingSystem服务具有用于继续重新加载的确认协议。 To proceed with the reload without confirmation, simply pass in 'FORCE' as the token parameter, so you can use a request as below:要在不确认的情况下继续重新加载,只需传入“FORCE”作为令牌参数,这样您就可以使用如下请求:
Method POST:方法POST:
https://api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/123456/reloadOperatingSystem
Body:身体:
{
"parameters":[
"FORCE",
{
"itemPrices":[
{
"id":211481
}
]
}
]
}
Also, you can get the operating system prices by filtering the items by description:此外,您可以通过按描述过滤项目来获取操作系统价格:
Method GET:方法获取:
https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/1035/getItems.json?objectMask=mask[description,id,prices[id]]&objectFilter={"items":{"description":{"operation":"*= Ubuntu"}}}
Output example: Output 示例:
[
{
"description": "Ubuntu Linux 18.04 LTS Bionic Beaver LAMP Install (64 bit)",
"id": 11429,
"prices": [
{
"id": 211481
}
]
}
]
Keep in mind to use the same package id used in the virtual guest, below a way to get it (guessing that 123456 is the virtual guest identifier).请记住,使用虚拟访客中使用的相同 package id,下面是获取它的方法(猜测 123456 是虚拟访客标识符)。
Method GET:方法获取:
https://api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/123456/getObject.json?objectMask=mask[typeId,billingItem[categoryCode,package[name,id]]]
Output example: Output 示例:
{
"typeId": 1,
"billingItem": {
"categoryCode": "guest_core",
"package": {
"id": 1035,
"name": "Public Virtual Server (hourly)"
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.