Click or drag to resize

IWsBackupGetBackupAccountServers Method

Note: This API is now obsolete.

Get list of servers added for backup for the specified backup account.

Namespace:  Aruba.Cloud.WsBackup
Assembly:  Aruba.Cloud.WsBackup (in Aruba.Cloud.WsBackup.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
[ObsoleteAttribute("This Method is deprecated")]
WsResult<List<BackupServer>> GetBackupAccountServers(
	int backupAccountId
)

Parameters

backupAccountId
Type: SystemInt32
ID of backup account

Return Value

Type: WsResultListBackupServer
List of backup servers
Examples
By the method IWsBackup GetBackupAccountServers you can get list of servers added for backup for the specified backup account
/// WsBackupClient.GetBackupAccountServers   Method (c# .NET)
public static string GetBackupAccountServers(WsBackupClient client,
    int backupAccountId)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // call method GetBackupAccountServers  
        // obtaining a WsResultOfArrayOfBackupServer item
        WsResultOfArrayOfBackupServer result = client.GetBackupAccountServers(backupAccountId);

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

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

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

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

    return stringBuilder.ToString();
}
See Also