简体   繁体   English

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

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

When I call SoftLayer_Virtual_Guest_Block_Device_Template_Group:addLocations to copy private image_A cross IDC , this function returns True immediately. 当我调用SoftLayer_Virtual_Guest_Block_Device_Template_Group:addLocations复制IDC交叉的私有image_A时,此函数立即返回True So it is known that the operation is asynchronous. 因此,已知该操作是异步的。

The question is how can I know that this async operation is finished, namely image_A is already finished copy to the target IDC ? 问题是我如何知道此异步操作已完成,即image_A已经完成复制到目标IDC

I have found the api: 我找到了api:

SoftLayer_Virtual_Guest_Block_Device_Template_Group:getTransaction() , but this one always returns an empty str??What the hell ~ ~ ~ SoftLayer_Virtual_Guest_Block_Device_Template_Group:getTransaction() ,但是这个总是返回一个空的str?

You need to make the following call 您需要拨打以下电话

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

Method: Get

Replace: $user , $apiKey and $templateGroupId 替换: $ user$ apiKey$ templateGroupId

You need to verify that the children (image template groups that are clones of an image template group) have no any pending or current transaction. 您需要验证子级(作为图像模板组的克隆的图像模板组)没有任何暂挂或当前事务。 In case that there is one or more transactions, you will not able to add/remove locations until this finishes. 如果有一个或多个交易,则在完成此操作之前,您将无法添加/删除位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM