Click or drag to resize

IWsBackupGetRegions Method

Get list of regions that can be used in Backup services.

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<Region>> GetRegions()

Return Value

Type: WsResultListRegion
List of regions
Examples
By the method IWsBackup GetRegions you can get the list of regions used in Backup services.
/// WsBackupClient.GetRegions   Method (c# .NET)
public static string GetRegions(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 GetRegions  
        // obtaining a WsResultOfArrayOfRegion item
        WsResultOfArrayOfRegion result = client.GetRegions();

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

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

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

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

    return stringBuilder.ToString();
}
See Also