Sample code to handle the upgrade of EVault?

2019-08-11 09:20发布

Now that I have ordering EVault working, I need some help with upgrading it. Can anyone provide some sample code (PHP preferred) that will perform an upgrade of EVault backup in SoftLayer? If there are different input for upgrading EVault backup associated with Virtual Guest vs. Bare Metal, please provide the differences as well.

For an Endurance storage, I've used "Container_Product_Order_Network_Storage_Enterprise_SnapshotSpace_Upgrade" as complexType in the container, but I don't see anything for EVault listed in the SL Data Type list. And what are other inputs that I need to specify?

Any help will be appreciated. Thank you.

1条回答
ゆ 、 Hurt°
2楼-- · 2019-08-11 10:05

Easy

<?php

require_once ('/SoftLayer/SoapClient.class.php');

$apiUser = 'set me';
$key = 'set me';

$evaultId = 4862895;

$evaultClient = SoftLayer_SoapClient::getClient('SoftLayer_Network_Storage_Backup_Evault', $evaultId, $apiUser, $key);

$upgradePrice = 560;

try {

    $result = $evaultClient->upgradeVolumeCapacity($upgradePrice);
    print_r($result);

} catch(Exception $e) {
    echo "Unable to upgrade Evault: " . $e -> getMessage();
}

To get the price call http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getItems method. The package is 0 and you need to pick out the value from "upgradeItemId" field.

Regards

查看更多
登录 后发表回答