IWsCloudStorageGetRegions Method |
Namespace: Aruba.Cloud.WsCloudStorage
//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(); }