我有复制设置,我在一个站点有源卷,在另一个站点有副本 . 现在我想通过Softlayer python API取消副本请求 . (而不是通过门户网站)我检查过有2个与计费相关的服务;
SoftLayer_Billing_Item::cancelItem SoftLayer_Billing_Item_Cancellation_Request::createObject
我应该使用哪种服务以及如何使用?有人可以帮助我获得该API .
您应该使用此方法:
请按照以下步骤操作:
首先,它需要从副本检索billingItem,为它发出以下请求 . (此请求将从副本返回 accountId 和 billingItemId )
https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/$storageId/getReplicationPartners?objectMask=accountId;billingItem.id Method: Get
用您自己的信息替换: $user , $apiKey 和 $storageId
https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Billing_Item_Cancellation_Request/createObject Method: Post { "parameters":[ { "accountId": $accountId, "items":[ { "billingItemId": $billingItemId, "immediateCancellationFlag": true } ] } ] }
用您自己的信息替换: $user , $apiKey , $accountId 和 $billingItemId .
1 回答
您应该使用此方法:
请按照以下步骤操作:
1.检索accountId和副本的结算项目
首先,它需要从副本检索billingItem,为它发出以下请求 . (此请求将从副本返回 accountId 和 billingItemId )
用您自己的信息替换: $user , $apiKey 和 $storageId
2.取消副本
用您自己的信息替换: $user , $apiKey , $accountId 和 $billingItemId .