如何使用软层API复制os图像cross IDC?

How to copy os image cross IDC with softlayer API?

我在IDC A有一个虚拟机,我已经抓取了这个虚拟机作为我的自定义image_A。现在想复制image_A到IDC B,软层API支持这个操作吗?

跨数据中心复制图像:

您可以使用:

这里是一个使用 REST 的例子:

https://$user:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest_Block_Device_Template_Group/$templateGroupId/addLocations

Method: Post

{  
   "parameters":[  
      [  
         {  
            "id":1441195
         }
      ]
   ]
}

将:$user$apiKey$templateGroupId(图片)替换为您的自己的信息。 1441195 指的是 Dallas 10 数据中心的标识符(您需要将其替换为您希望在其中复制图像的数据中心的 ID)。


查看自己的块设备模板组(图片):

https://$user:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Account/getPrivateBlockDeviceTemplateGroups

Method: Get

方法: SoftLayer_Account::getPrivateBlockDeviceTemplateGroups


从数据中心检索信息:

https://$user:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Location/getDatacenters

Method: Get

方法: SoftLayer_Location::getDatacenters


Updated

检索包含图像副本的位置

试试这个:

https://$user:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest_Block_Device_Template_Group/$templateGroupId/getDatacenters

Method: Get

方法: SoftLayer_Virtual_Guest_Block_Device_Template_Group::getDatacenters