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