softlayer api: 如何在复制 os 图像 cross IDC 时获取状态(完成或处理中)?

softlayer api: How to get the status(finish or processing) when copy os image cross IDC?

当我调用SoftLayer_Virtual_Guest_Block_Device_Template_Group:addLocations复制私有image_A交叉IDC时,这个函数returns立即True。所以可以知道操作是异步的。

问题是我怎么知道这个异步操作已经完成,即image_A已经完成复制到目标IDC

我找到了api:

SoftLayer_Virtual_Guest_Block_Device_Template_Group:getTransaction(),但是这个总是returns一个空字符串??什么鬼~~~

您需要进行以下调用

https://$user:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest_Block_Device_Template_Group/$templateGroupId/getChildren?objectMask=mask[transaction]

Method: Get

替换:$user$apiKey$templateGroupId

您需要验证子项(图像模板组是图像模板组的克隆)没有任何待处理或当前事务。如果有一笔或多笔交易,您将无法 add/remove 个地点,直到交易完成。