首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Softlayer中的私有镜像加载

从Softlayer中的私有镜像加载
EN

Stack Overflow用户
提问于 2016-02-03 15:40:03
回答 1查看 548关注 0票数 1

我正在尝试使用Softlayer java API实现loadFromImage函数。当我在control.softlayer.com上测试时,没有列出私有映像。我需要先加载一个私有镜像到我的服务器吗?然后,将镜像加载到服务器上?如果没有,你能指导我正确的程序吗?我可以有任何示例代码来实现吗?

谢谢你,迈克

Load From Image Page

EN

回答 1

Stack Overflow用户

发布于 2016-02-04 05:47:00

您的账号目前没有任何“私有镜像”,请查看控制入口进行确认:

https://control.softlayer.com/devices/images

(按“私有镜像”过滤)

从门户网站创建新镜像的

  • 转到https://control.softlayer.com/devices
  • 从List
  • 选择一个服务器一旦准备好“Device List”窗口,从“Actions”右菜单中选择“创建映像模板”。将创建一个标准映像。此映像将列在您的私有映像中。

接口示例:

同时,对于API,我将提供一些REST请求,可能会对您有所帮助:

  • To创建新的标准映像execute:

URL:

代码语言:javascript
复制
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”?

代码语言:javascript
复制
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?从映像加载的

  • How

URL:

代码语言:javascript
复制
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[Virtual_Guest_ID]/reloadOperatingSystem

方法: POST

代码语言:javascript
复制
    Json:

*----------------------------    
{
  "parameters": [
    "f610b52f9fce12ef4fc37d6e9f5fe77a",
    {
      "imageTemplateId": 931371
    }
  ]
}
*----------------------------    

其中:

代码语言:javascript
复制
“f610b52f9fce12ef4fc37d6e9f5fe77a” is the token (The token will remain active for 10 minutes)
“931371” the image template to use

但是,如何获得上述配置的令牌呢?

代码语言:javascript
复制
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

致以问候。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35171114

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档