Click or drag to resize

IWsBackupGetBackupPricingTypes Method

This method returns the list of available backup pricing plans depending on specified region. Each pricing plan returned also contains the list of plan descriptions (for all languages) and the list of resources and the resources' amount for the pricing plan.

Namespace:  Aruba.Cloud.WsBackup
Assembly:  Aruba.Cloud.WsBackup (in Aruba.Cloud.WsBackup.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<List<BackupPricingType>> GetBackupPricingTypes(
	int regionId,
	EnumsBackupType backupTypeId
)

Parameters

regionId
Type: SystemInt32
ID of the region
backupTypeId
Type: Aruba.Cloud.WsBackup.EntitiesEnumsBackupType
Backup typeID

Return Value

Type: WsResultListBackupPricingType
List of backup plans
Examples
By the method IWsBackup GetBackupPricingTypes you can obtain the list of BackupPricingType object depending on specific regionId. Each BackupPricingType object contains also the list of BackupPricingTypeDescription (for all languages) and the list of BackupResources, indicating the resources / amount of resources for specific Pricing type
/// WsBackupClient.GetBackupPricingTypes   Method (c# .NET)
public static string GetBackupPricingTypes(WsBackupClient client,
int regionId,Enums.BackupType backupTypeId )
{
//specify the account login details
client.ClientCredentials.UserName.UserName = "ARU-0000";
client.ClientCredentials.UserName.Password = "0123456789";

StringBuilder stringBuilder = new StringBuilder();

try
{
// call method GetBackupPricingTypes
// obtaining a WsResultOfArrayOfBackupPricingType item
WsResultOfArrayOfBackupPricingType result = client.GetBackupPricingTypes(regionId,backupTypeId);


// if the call is Success print returned values
if (result.Success)
{
stringBuilder.Append("Operation ends successfully\n");

// get Value returned from server
BackupPricingType[] items = result.Value;

if (items != null)
{
foreach (BackupPricingType item in items)
{
stringBuilder.Append("\nBackupPricingType detail\n");

stringBuilder.Append("\n RegionID: ");
stringBuilder.Append(item.RegionID);
stringBuilder.Append("\n PricingTypeDescriptions: ");
stringBuilder.Append(item.PricingTypeDescriptions);
stringBuilder.Append("\n CreationDate: ");
stringBuilder.Append(item.CreationDate);
}
}
}
else
{
throw new ApplicationException(result.ResultMessage);
}
}
catch (Exception ex)
{
// re-run the error
throw new ApplicationException(ex.Message);
}

return stringBuilder.ToString();
}
See Also