public Dictionary <string, ReferenceType> GetVMWHostRefsByName() { try { Dictionary <string, ReferenceType> dictionary = new Dictionary <string, ReferenceType>(); string url = this._client.VCloudApiURL + "/admin/extension/hostReferences"; Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + url); VMWHostReferencesType hostReferencesType = SdkUtil.Get <VMWHostReferencesType>(this._client, url, 200); if (hostReferencesType.HostReference != null) { foreach (ReferenceType referenceType in hostReferencesType.HostReference) { dictionary.Add(referenceType.name, referenceType); } } return(dictionary); } catch (Exception ex) { throw new VCloudException(ex.Message); } }
private static Dictionary <string, ReferenceType> GetVMWHostRefsByName( vCloudClient client, string url) { try { Dictionary <string, ReferenceType> dictionary = new Dictionary <string, ReferenceType>(); Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + url); VMWHostReferencesType hostReferencesType = SdkUtil.Get <VMWHostReferencesType>(client, url, 200); if (hostReferencesType.HostReference != null) { foreach (ReferenceType referenceType in hostReferencesType.HostReference) { dictionary.Add(referenceType.name, referenceType); } } return(dictionary); } catch (Exception ex) { throw new VCloudException(ex.Message); } }