我正在尝试使用Softlayer java API实现loadFromImage函数。当我在control.softlayer.com上测试时,没有列出私有映像。我需要先加载一个私有镜像到我的服务器吗?然后,将镜像加载到服务器上?如果没有,你能指导我正确的程序吗?我可以有任何示例代码来实现吗?
谢谢你,迈克
Load From Image Page
发布于 2016-02-04 05:47:00
您的账号目前没有任何“私有镜像”,请查看控制入口进行确认:
(按“私有镜像”过滤)
从门户网站创建新镜像的:
接口示例:
同时,对于API,我将提供一些REST请求,可能会对您有所帮助:
URL:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/5464742/createArchiveTransaction.json
Method: POST
Json:
*-----------------------
{
"parameters": [
"my-new-standard-image-name ",
[
{
"id": 6862924,
"complexType": "SoftLayer_Virtual_Guest_Block_Device"
}
],
"api note"
]
}
*-----------------------
where:
" my-new-standard-image-name " is the group name for the archive
"6862924" A computing instance block device's unique ID
"api note" is A long note describing the image template
"5464742" is the id of virtual server如何获取“块设备唯一ID”?
Please, execute:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[Virtual_Guest_ID]/getBlockDevices?objectFilter={"blockDevices":{"bootableFlag":{"operation": "1"}}}&objectMask=mask[id]执行“SoftLayer_Virtual_Guest::createArchiveTransaction”后,将在服务器中创建一个新事务,请等待几分钟,直到事务完成。
参考:http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createArchiveTransaction
要通过API?从映像加载的
URL:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[Virtual_Guest_ID]/reloadOperatingSystem方法: POST
Json:
*----------------------------
{
"parameters": [
"f610b52f9fce12ef4fc37d6e9f5fe77a",
{
"imageTemplateId": 931371
}
]
}
*---------------------------- 其中:
“f610b52f9fce12ef4fc37d6e9f5fe77a” is the token (The token will remain active for 10 minutes)
“931371” the image template to use但是,如何获得上述配置的令牌呢?
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[Virtual_Guest_ID]/reloadOperatingSystem
Method: GET参考文献:
http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/reloadOperatingSystem http://knowledgelayer.softlayer.com/learning/introduction-image-templates http://knowledgelayer.softlayer.com/faq/what-standard-image-template http://knowledgelayer.softlayer.com/faq/what-flex-image http://knowledgelayer.softlayer.com/procedure/create-standard-image http://knowledgelayer.softlayer.com/procedure/create-flex-image
致以问候。
https://stackoverflow.com/questions/35171114
复制相似问题