private static Dictionary <string, ResourcePoolType> GetResourcePools(
     vCloudClient client,
     string url)
 {
     try
     {
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + url);
         RestUtil.Get(client, url);
         ResourcePoolListType resourcePoolListType        = SdkUtil.Get <ResourcePoolListType>(client, url, 200);
         Dictionary <string, ResourcePoolType> dictionary = new Dictionary <string, ResourcePoolType>();
         if (resourcePoolListType != null && resourcePoolListType.ResourcePool != null)
         {
             foreach (ResourcePoolType resourcePoolType in resourcePoolListType.ResourcePool)
             {
                 if (!dictionary.ContainsKey(resourcePoolType.name))
                 {
                     dictionary.Add(resourcePoolType.name, resourcePoolType);
                 }
             }
         }
         return(dictionary);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #2
0
        public static OrgLdapSettingsType GetLdapSettings(
            vCloudClient client,
            ReferenceType adminOrgReference)
        {
            string url = adminOrgReference.href + "/settings/ldap";

            return(SdkUtil.Get <OrgLdapSettingsType>(client, url, 200));
        }
Exemple #3
0
        public static OrgFederationSettingsType GetFederationSettings(
            vCloudClient client,
            ReferenceType adminOrgReference)
        {
            string url = adminOrgReference.href + "/settings/federation";

            return(SdkUtil.Get <OrgFederationSettingsType>(client, url, 200));
        }
Exemple #4
0
        public List <ReferenceType> GetRightRefs()
        {
            RightRefsType rightRefsType = SdkUtil.Get <RightRefsType>(this.VcloudClient, this.Resource.href + "/rights", 200);

            if (rightRefsType.Right == null)
            {
                return(new List <ReferenceType>());
            }
            return(((IEnumerable <ReferenceType>)rightRefsType.Right).ToList <ReferenceType>());
        }
Exemple #5
0
 public List <VMWStorageProfileType> GetAvailableVMWProviderVdcStorageProfiles()
 {
     try
     {
         return(((IEnumerable <VMWStorageProfileType>)SdkUtil.Get <VMWStorageProfilesType>(this.VcloudClient, this.Reference.href + "/availableStorageProfiles", 200).VMWStorageProfile).ToList <VMWStorageProfileType>());
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #6
0
 public OrgOperationLimitsSettingsType GetOperationLimitsSettings()
 {
     try
     {
         return(SdkUtil.Get <OrgOperationLimitsSettingsType>(this.VcloudClient, this.Reference.href + "/settings/operationLimitsSettings", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #7
0
 public OrgGuestPersonalizationSettingsType GetGuestPersonalizationSettings()
 {
     try
     {
         return(SdkUtil.Get <OrgGuestPersonalizationSettingsType>(this.VcloudClient, this.Reference.href + "/settings/guestPersonalizationSettings", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #8
0
 public static EnvelopeType GetOvf(vCloudClient client, string vAppTemplateOvfUrl)
 {
     try
     {
         return(SdkUtil.Get <EnvelopeType>(client, vAppTemplateOvfUrl, 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #9
0
 public static string GetTimeoutAction(vCloudClient client, ReferenceType blockingTaskRef)
 {
     try
     {
         return(SdkUtil.Get <BlockingTaskType>(client, blockingTaskRef.href, 200).timeoutAction);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public static KerberosSettingsType GetKerberosSettings(vCloudClient client)
 {
     try
     {
         string url = client.VCloudApiURL + "/admin/extension/settings/kerberosSettings";
         return(SdkUtil.Get <KerberosSettingsType>(client, url, 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public static bool IsNotificationsEnabled(vCloudClient client)
 {
     try
     {
         string url = client.VCloudApiURL + "/admin/extension/settings/notifications";
         return(SdkUtil.Get <NotificationsSettingsType>(client, url, 200).EnableNotifications);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #12
0
        private static Dictionary <string, VMWProviderVdcResourcePoolType> GetResourcePools(
            vCloudClient client,
            ReferenceType vmwProvVdcRef)
        {
            VMWProviderVdcResourcePoolSetType resourcePoolSetType          = SdkUtil.Get <VMWProviderVdcResourcePoolSetType>(client, vmwProvVdcRef.href + "/resourcePools", 200);
            Dictionary <string, VMWProviderVdcResourcePoolType> dictionary = new Dictionary <string, VMWProviderVdcResourcePoolType>();

            foreach (VMWProviderVdcResourcePoolType resourcePoolType in resourcePoolSetType.VMWProviderVdcResourcePool)
            {
                dictionary.Add(resourcePoolType.ResourcePoolVimObjectRef.MoRef, resourcePoolType);
            }
            return(dictionary);
        }
 public static LookupServiceSettingsType GetLookupService(
     vCloudClient client)
 {
     try
     {
         string url = client.VCloudApiURL + "/admin/extension/settings/lookupService";
         return(SdkUtil.Get <LookupServiceSettingsType>(client, url, 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public static string GetMetadataEntry(vCloudClient client, ReferenceType entityRef, string key)
 {
     try
     {
         string url = Metadata.EncodeUrl(entityRef.href + "/metadata", key);
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + url);
         return(SdkUtil.Get <MetadataValueType>(client, url, 200).Value);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 internal VcloudAdminExtensionSettings(vCloudClient vcloudClient)
 {
     try
     {
         this._client = vcloudClient;
         this._vcloudSystemSettings = SdkUtil.Get <SystemSettingsType>(this._client, this._client.VCloudApiURL + "/admin/extension/settings", 200);
         this.Sort_v1_5();
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #16
0
 public static StartupSection_Type GetStartUpSection(
     vCloudClient client,
     ReferenceType vappRef)
 {
     try
     {
         return(SdkUtil.Get <StartupSection_Type>(client, vappRef.href + "/startupSection/", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #17
0
        public Dictionary <string, OperatingSystemInfoType> GetOperatingSystemsByName()
        {
            Dictionary <string, OperatingSystemInfoType> dictionary = new Dictionary <string, OperatingSystemInfoType>();

            foreach (OperatingSystemFamilyInfoType systemFamilyInfoType in SdkUtil.Get <SupportedOperatingSystemsInfoType>(this, this.VCloudApiURL + "/supportedSystemsInfo", 200).OperatingSystemFamilyInfo)
            {
                foreach (OperatingSystemInfoType operatingSystemInfoType in systemFamilyInfoType.OperatingSystem)
                {
                    dictionary.Add(operatingSystemInfoType.Name, operatingSystemInfoType);
                }
            }
            return(dictionary);
        }
Exemple #18
0
 public static ReferenceType GetOwner(vCloudClient client, ReferenceType vappRef)
 {
     try
     {
         string url = vappRef.href + "/owner";
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + url);
         return(SdkUtil.Get <OwnerType>(client, url, 200).User);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #19
0
 public ControlAccessParamsType GetControlAccess()
 {
     try
     {
         string url = this.Reference.href + "/controlAccess/";
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + url);
         return(SdkUtil.Get <ControlAccessParamsType>(this.VcloudClient, url, 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #20
0
 public static ReferenceType GetOwnerReference(
     vCloudClient client,
     ReferenceType blockingTaskRef)
 {
     try
     {
         return(SdkUtil.Get <BlockingTaskType>(client, blockingTaskRef.href, 200).TaskOwner);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #21
0
 public static DateTime GetCreatedDate(
     vCloudClient client,
     ReferenceType blockingTaskRef)
 {
     try
     {
         return(SdkUtil.Get <BlockingTaskType>(client, blockingTaskRef.href, 200).createdTime);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public static SystemPasswordPolicySettingsType GetPasswordPolicySettings(
     vCloudClient client)
 {
     try
     {
         string url = client.VCloudApiURL + "/admin/extension/settings/passwordPolicy";
         return(SdkUtil.Get <SystemPasswordPolicySettingsType>(client, url, 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #23
0
 public static CustomizationSectionType GetCustomizationSection(
     vCloudClient client,
     ReferenceType vappTemplateRef)
 {
     try
     {
         return(SdkUtil.Get <CustomizationSectionType>(client, vappTemplateRef.href + "/customizationSection/", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #24
0
 public static LeaseSettingsSectionType GetLeaseSettingsSection(
     vCloudClient client,
     ReferenceType vappTemplateRef)
 {
     try
     {
         return(SdkUtil.Get <LeaseSettingsSectionType>(client, vappTemplateRef.href + "/leaseSettingsSection/", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public VcloudAdmin(vCloudClient client)
 {
     try
     {
         this._client = client;
         this._vcloudResource_v1_5 = SdkUtil.Get <VCloudType>(client, client.VCloudApiURL + "/admin/", 200);
         this.SortAdminRefs_v1_5();
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #26
0
 public static NetworkConfigSectionType GetNetworkConfigSection(
     vCloudClient client,
     ReferenceType vappTemplateRef)
 {
     try
     {
         return(SdkUtil.Get <NetworkConfigSectionType>(client, vappTemplateRef.href + "/networkConfigSection/", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #27
0
 public VcloudAdminExtension(vCloudClient client)
 {
     try
     {
         this._client = client;
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + client.VCloudApiURL + "/admin/extension");
         this._vmwExtensionResource_v1_5 = SdkUtil.Get <VMWExtensionType>(client, client.VCloudApiURL + "/admin/extension", 200);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #28
0
 public static OrgSettingsType GetOrgSettings(
     vCloudClient client,
     ReferenceType adminOrgReference)
 {
     try
     {
         string url = adminOrgReference.href + "/settings";
         return(SdkUtil.Get <OrgSettingsType>(client, url, 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Exemple #29
0
 public bool ExtendSession()
 {
     try
     {
         SdkUtil.Get <SessionType>(this, this.VCloudApiURL + "/session", 200);
         Logger.Log(TraceLevel.Information, this.VCloudApiURL + "/session");
     }
     catch (VCloudException ex)
     {
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.SESSION_EXTENSION_FAILED));
         return(false);
     }
     return(true);
 }
 public static AdminServiceLink GetAdminServiceLinkById(
     vCloudClient client,
     string vCloudId)
 {
     Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_VCLOUD_ID_MSG) + " - " + vCloudId);
     Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.GET_URL_MSG) + " - " + client.VCloudApiURL + "/entity/" + vCloudId);
     foreach (LinkType linkType in SdkUtil.Get <EntityType>(client, client.VCloudApiURL + "/entity/" + vCloudId, 200).Link)
     {
         if (linkType.type.Equals("application/vnd.vmware.admin.serviceLink+xml"))
         {
             return(new AdminServiceLink(client, SdkUtil.Get <AdminServiceLinkType>(client, linkType.href, 200)));
         }
     }
     throw new VCloudException(SdkUtil.GetI18nString(SdkMessage.REFERENCE_NOT_FOUND_MSG));
 }