コード例 #1
0
 public Dictionary <string, VersionInfoType> GetSupportedVersions()
 {
     try
     {
         this._supportedApiVersions = new Dictionary <string, VersionInfoType>();
         Response supportedVersions = RestUtil.GetSupportedVersions(this, this.VCloudApiURL + "/versions");
         SupportedVersionsType supportedVersionsType = (SupportedVersionsType)null;
         if (supportedVersions.IsExpected(200))
         {
             supportedVersionsType = supportedVersions.GetResource <SupportedVersionsType>();
         }
         else
         {
             supportedVersions.HandleUnExpectedResponse();
         }
         if (supportedVersionsType != null)
         {
             if (supportedVersionsType.VersionInfo != null)
             {
                 foreach (VersionInfoType versionInfoType in supportedVersionsType.VersionInfo)
                 {
                     this._supportedApiVersions.Add(versionInfoType.Version, versionInfoType);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Log(TraceLevel.Critical, ex.Message, (object)ex);
         throw new VCloudRuntimeException(ex.Message);
     }
     return(this._supportedApiVersions);
 }