Click or drag to resize

IWsBackupSearchBackupAccounts Method

Get list of Bakcup Accounts with specified search parameters

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<PagedList<BackupAccount>> SearchBackupAccounts(
	SearchBackupAccountsRequest searchBackupAccountsRequest
)

Parameters

searchBackupAccountsRequest
Type: Aruba.Cloud.WsBackup.EntitiesSearchBackupAccountsRequest
Backup Account Identifier

Return Value

Type: WsResultPagedListBackupAccount
Examples
By the method IWsBackup SearchBackupAccounts you can search backup accounts associated with the authenticated user by specifying usage percentage and/or the Absolute Usage
/// WsBackupClient.SearchBackupAccounts    Method (c# .NET)
public static string SearchBackupAccounts(WsBackupClient client)
{
//specify the account login details
client.ClientCredentials.UserName.UserName = "ARU-0000";
client.ClientCredentials.UserName.Password = "0123456789";

StringBuilder stringBuilder = new StringBuilder();

try
{
// call method GetBackupAccount
// obtaining a WsResultPagedListofBackupAccount item
var searchBackupAccountsRequest = new SearchBackupAccountsRequest(){
PercentageUsageGt = 60,
AbsoluteUsageGt = 100
};
var result = client.SearchBackupAccounts(searchBackupAccountsRequest);

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

// get Value returned from server
BackupAccount[] items = result.Value.Items;
if (items != null)
{
foreach (BackupAccount item in items)
{
stringBuilder.Append("\n BackupAccount detail\n");
stringBuilder.Append("\n RegionID: ");
stringBuilder.Append(item.RegionID);
stringBuilder.Append("\n BackupAccountID: ");
stringBuilder.Append(item.BackupAccountID);
stringBuilder.Append("\n BackupAccountStatus: ");
stringBuilder.Append(item.BackupAccountStatus);
stringBuilder.Append("\n BackupPricingType: ");
stringBuilder.Append(item.BackupPricingType);
}
}

}
else
{
throw new ApplicationException(result.ResultMessage);
}
}
catch (Exception ex)
{
// re-run the error
throw new ApplicationException(ex.Message);
}

return stringBuilder.ToString();
}
See Also