Click or drag to resize

IWsCloudStorageGetRegions Method

By the method GetRegions you can show the list of available Regions

Namespace:  Aruba.Cloud.WsCloudStorage
Assembly:  WsCloudStorage (in WsCloudStorage.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<List<Region>> GetRegions()

Return Value

Type: WsResultListRegion
Examples
        //WsCloudStorage.GetRegions Method (c# .NET)
private static String GetRegions(WsCloudStorageClient client)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "1234567890";

    StringBuilder stringBuilder = new StringBuilder();
    try
    {
        //call method GetRegions,
        //obtaining a WsResultOfArrayOfRegion item
        WsResultOfArrayOfRegion result = client.GetRegions();
        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            Region[] arrayOfRegion = result.Value;
            //browse the list and print the values
            foreach (Region region in arrayOfRegion)
            {
                int id = region.RegionID;
                String code = region.RegionCode;
                String description = region.Description;
                stringBuilder.Append("id: ");
                stringBuilder.Append(id);
                stringBuilder.Append(" code: ");
                stringBuilder.Append(code);
                stringBuilder.Append(" description: ");
                stringBuilder.Append(description);

            }
        }
        else
        {
            throw new Exception(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        //re-run the error
        throw new Exception(ex.Message);
    }
    System.Console.WriteLine("stringBuilder.ToString()" + stringBuilder.ToString());
    return stringBuilder.ToString();
}
See Also