Ejemplo n.º 1
0
 public Task UpdateDisk(string name, string description, ReferenceType storageProfileRef)
 {
     try
     {
         string href = this.Resource.href;
         if (name != null)
         {
             this.Resource.name = name;
         }
         if (description != null)
         {
             this.Resource.Description = description;
         }
         if (storageProfileRef != null)
         {
             this.Resource.StorageProfile = storageProfileRef;
         }
         string requestString = SerializationUtil.SerializeObject <DiskType>(this.Resource, "com.vmware.vcloud.api.rest.schema");
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.PUT_URL_MSG) + " - " + href);
         return(new Task(this.VcloudClient, SdkUtil.Put <TaskType>(this.VcloudClient, href, requestString, "application/vnd.vmware.vcloud.disk+xml", 202)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public Task UpdateLookupService(LookupServiceParamsType lookupServiceParams)
 {
     try
     {
         return(new Task(this._client, SdkUtil.Put <TaskType>(this._client, this._client.VCloudApiURL + "/admin/extension/settings/lookupService", SerializationUtil.SerializeObject <LookupServiceParamsType>(lookupServiceParams, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.lookupServiceParams+xml", 202)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 3
0
 public OrgSettingsType UpdateOrgSettings(OrgSettingsType orgSettingsType)
 {
     try
     {
         return(SdkUtil.Put <OrgSettingsType>(this.VcloudClient, this.Reference.href + "/settings", SerializationUtil.SerializeObject <OrgSettingsType>(orgSettingsType, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.orgSettings+xml", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 4
0
 public Task UpdateTask(TaskType taskType)
 {
     try
     {
         return(new Task(this.VcloudClient, SdkUtil.Put <TaskType>(this.VcloudClient, this.Resource.href, SerializationUtil.SerializeObject <TaskType>(taskType, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.vcloud.task+xml", 200)));
     }
     catch (VCloudException ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public LdapSettingsType UpdateLdapSettings(LdapSettingsType ldapSettingsType)
 {
     try
     {
         return(SdkUtil.Put <LdapSettingsType>(this._client, this._client.VCloudApiURL + "/admin/extension/settings/ldapSettings", SerializationUtil.SerializeObject <LdapSettingsType>(ldapSettingsType, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.ldapSettings+xml", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 6
0
 public Task UpdateEdgeGateway(GatewayType gatewayParams)
 {
     try
     {
         return(new Task(this.VcloudClient, SdkUtil.Put <TaskType>(this.VcloudClient, this.Resource.href, SerializationUtil.SerializeObject <GatewayType>(gatewayParams, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.edgeGateway+xml", 202)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 7
0
 public AdminOrganization UpdateAdminOrg(AdminOrgType adminOrgType)
 {
     try
     {
         return(new AdminOrganization(this.VcloudClient, SdkUtil.Put <AdminOrgType>(this.VcloudClient, this.Reference.href, SerializationUtil.SerializeObject <AdminOrgType>(adminOrgType, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.organization+xml", 200)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public AdminVdcStorageProfile UpdateAdminVdcStorageProfile(
     AdminVdcStorageProfileType adminVdcStorageProfileResource)
 {
     try
     {
         return(new AdminVdcStorageProfile(this.VcloudClient, SdkUtil.Put <AdminVdcStorageProfileType>(this.VcloudClient, this.Reference.href, SerializationUtil.SerializeObject <AdminVdcStorageProfileType>(adminVdcStorageProfileResource, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.vdcStorageProfile+xml", 200)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public CatalogSettingsType UpdateCatalogSettings(
     CatalogSettingsType catalogSettingsParams)
 {
     try
     {
         return(SdkUtil.Put <CatalogSettingsType>(this._client, this._client.VCloudApiURL + "/admin/extension/settings/catalog", SerializationUtil.SerializeObject <CatalogSettingsType>(catalogSettingsParams, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.catalogSettings+xml", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public SystemPasswordPolicySettingsType UpdatePasswordPolicySettings(
     SystemPasswordPolicySettingsType passwordPolicySettingsType)
 {
     try
     {
         return(SdkUtil.Put <SystemPasswordPolicySettingsType>(this._client, this._client.VCloudApiURL + "/admin/extension/settings/passwordPolicy", SerializationUtil.SerializeObject <SystemPasswordPolicySettingsType>(passwordPolicySettingsType, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.systemPasswordPolicySettings+xml", 200));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 11
0
 public CatalogItem UpdateCatalogItem(CatalogItemType catalogItemType)
 {
     try
     {
         string href          = this.Resource.href;
         string requestString = SerializationUtil.SerializeObject <CatalogItemType>(catalogItemType, "com.vmware.vcloud.api.rest.schema");
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.POST_URL_MSG) + " -" + href);
         return(new CatalogItem(this.VcloudClient, SdkUtil.Put <CatalogItemType>(this.VcloudClient, href, requestString, "application/vnd.vmware.vcloud.catalogItem+xml", 200)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 12
0
 public Group UpdateGroup(GroupType groupType)
 {
     try
     {
         string href          = this.Reference.href;
         string requestString = SerializationUtil.SerializeObject <GroupType>(groupType, "com.vmware.vcloud.api.rest.schema");
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.PUT_URL_MSG) + " - " + href);
         return(new Group(this.VcloudClient, SdkUtil.Put <GroupType>(this.VcloudClient, href, requestString, "application/vnd.vmware.admin.group+xml", 200)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public void SetEnableNotifications(bool enableNotificationsSetting)
 {
     try
     {
         SdkUtil.Put <NotificationsSettingsType>(this._client, this._client.VCloudApiURL + "/admin/extension/settings/notifications", SerializationUtil.SerializeObject <NotificationsSettingsType>(new NotificationsSettingsType()
         {
             EnableNotifications = enableNotificationsSetting
         }, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.notificationsSettings+xml", 200);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 14
0
 public Task UpdateProductSections(List <ProductSection_Type> productSections)
 {
     try
     {
         return(new Task(this.VcloudClient, SdkUtil.Put <TaskType>(this.VcloudClient, this.Reference.href + "/productSections/", SerializationUtil.SerializeObject <ProductSectionListType>(new ProductSectionListType()
         {
             ProductSection = productSections.ToArray()
         }, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.vcloud.productSections+xml", 202)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 15
0
 public Task UpdateVappTemplate(VAppTemplateType vappTemplateType)
 {
     try
     {
         string requestString = SerializationUtil.SerializeObject <VAppTemplateType>(vappTemplateType, "com.vmware.vcloud.api.rest.schema");
         string href          = this.Reference.href;
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.PUT_URL_MSG) + " - " + href);
         return(new Task(this.VcloudClient, SdkUtil.Put <TaskType>(this.VcloudClient, href, requestString, "application/vnd.vmware.vcloud.vAppTemplate+xml", 202)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 16
0
 private static void ChangeOwner(string url, ReferenceType userReference, vCloudClient client)
 {
     try
     {
         string requestString = SerializationUtil.SerializeObject <OwnerType>(new OwnerType()
         {
             User = userReference
         }, "com.vmware.vcloud.api.rest.schema");
         SdkUtil.Put <OwnerType>(client, url, requestString, "application/vnd.vmware.vcloud.owner+xml", 204);
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 17
0
 public VMWNetworkPool UpdateVMWNetworkPool(VMWNetworkPoolType vmwNetworkPoolType)
 {
     try
     {
         vmwNetworkPoolType.AnyAttr = (XmlAttribute[])null;
         string href          = this.Reference.href;
         string requestString = SerializationUtil.SerializeObject <VMWNetworkPoolType>(vmwNetworkPoolType, "com.vmware.vcloud.api.rest.schema");
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.PUT_URL_MSG) + " - " + href);
         return(new VMWNetworkPool(this.VcloudClient, SdkUtil.Put <VMWNetworkPoolType>(this.VcloudClient, href, requestString, "application/vnd.vmware.admin.networkPool+xml", 200)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 18
0
        public Task UpdateMetadataEntry(string key, string value)
        {
            string url = Metadata.EncodeUrl(this.Reference.href, key);

            try
            {
                string requestString = SerializationUtil.SerializeObject <MetadataValueType>(new MetadataValueType()
                {
                    Value = value
                }, "com.vmware.vcloud.api.rest.schema");
                Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.PUT_URL_MSG) + " - " + url);
                return(new Task(this.VcloudClient, SdkUtil.Put <TaskType>(this.VcloudClient, url, requestString, "application/vnd.vmware.vcloud.metadata.value+xml", 202)));
            }
            catch (Exception ex)
            {
                throw new VCloudException(ex.Message);
            }
        }
Ejemplo n.º 19
0
 public Task UpdatevShieldManager(ShieldManagerType shieldManager)
 {
     try
     {
         if (this.vShieldManagerReference == null)
         {
             throw new VCloudException(SdkUtil.GetI18nString(SdkMessage.REFERENCE_NOT_FOUND_MSG));
         }
         string href          = this.vShieldManagerReference.href;
         string requestString = SerializationUtil.SerializeObject <ShieldManagerType>(shieldManager, "com.vmware.vcloud.api.rest.schema");
         Logger.Log(TraceLevel.Information, SdkUtil.GetI18nString(SdkMessage.PUT_URL_MSG) + " - " + href);
         return(new Task(this.VcloudClient, SdkUtil.Put <TaskType>(this.VcloudClient, href, requestString, "application/vnd.vmware.admin.vshieldmanager+xml", 202)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 20
0
 public Task UpdateSection(Section_Type sectionType)
 {
     try
     {
         string href = this.Reference.href;
         string requestString;
         string url;
         string mediaType;
         if (sectionType is LeaseSettingsSectionType)
         {
             requestString = SerializationUtil.SerializeObject <LeaseSettingsSectionType>((LeaseSettingsSectionType)sectionType, "com.vmware.vcloud.api.rest.schema");
             url           = href + "/leaseSettingsSection/";
             mediaType     = "application/vnd.vmware.vcloud.leaseSettingsSection+xml";
         }
         else if (sectionType is GuestCustomizationSectionType)
         {
             requestString = SerializationUtil.SerializeObject <GuestCustomizationSectionType>((GuestCustomizationSectionType)sectionType, "com.vmware.vcloud.api.rest.schema");
             url           = href + "/guestCustomizationSection/";
             mediaType     = "application/vnd.vmware.vcloud.guestCustomizationSection+xml";
         }
         else if (sectionType is CustomizationSectionType)
         {
             requestString = SerializationUtil.SerializeObject <CustomizationSectionType>((CustomizationSectionType)sectionType, "com.vmware.vcloud.api.rest.schema");
             url           = href + "/customizationSection/";
             mediaType     = "application/vnd.vmware.vcloud.customizationSection+xml";
         }
         else
         {
             Logger.Log(TraceLevel.Information, sectionType.GetType().Name + "-" + SdkUtil.GetI18nString(SdkMessage.NOT_VALID_SECTION_MSG));
             throw new VCloudException(SdkUtil.GetI18nString(SdkMessage.NOT_VALID_SECTION_MSG));
         }
         return(new Task(this.VcloudClient, SdkUtil.Put <TaskType>(this.VcloudClient, url, requestString, mediaType, 202)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public List <BlockingTaskOperationType> UpdateEnabledBlockingTaskOperations(
     List <BlockingTaskOperationType> enabledBlockingTaskOperations)
 {
     try
     {
         string url = this._client.VCloudApiURL + "/admin/extension/settings/blockingTask/operations";
         TaskOperationListType operationListType1 = new TaskOperationListType();
         List <string>         stringList         = new List <string>();
         stringList.AddRange((IEnumerable <string>)BlockingTaskOperationType.ToValues(enabledBlockingTaskOperations));
         operationListType1.Operation = stringList.ToArray();
         string requestString = SerializationUtil.SerializeObject <TaskOperationListType>(operationListType1, "com.vmware.vcloud.api.rest.schema");
         TaskOperationListType operationListType2 = SdkUtil.Put <TaskOperationListType>(this._client, url, requestString, "application/vnd.vmware.admin.taskOperationList+xml", 200);
         List <string>         values             = new List <string>();
         if (operationListType2.Operation != null)
         {
             values = ((IEnumerable <string>)operationListType2.Operation).ToList <string>();
         }
         return(BlockingTaskOperationType.FromValues(values));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
Ejemplo n.º 22
0
 public AdminService UpdateAdminService(AdminServiceType serviceParams)
 {
     return(new AdminService(this.VcloudClient, SdkUtil.Put <AdminServiceType>(this.VcloudClient, this.Resource.href, SerializationUtil.SerializeObject <AdminServiceType>(serviceParams, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.service+xml", 200)));
 }
 public VMWProviderVdcStorageProfile UpdateVMWProviderVdcStorageProfile(
     VMWProviderVdcStorageProfileType vmwProviderVdcStorageProfileResource)
 {
     return(new VMWProviderVdcStorageProfile(this.VcloudClient, SdkUtil.Put <VMWProviderVdcStorageProfileType>(this.VcloudClient, this.Reference.href, SerializationUtil.SerializeObject <VMWProviderVdcStorageProfileType>(vmwProviderVdcStorageProfileResource, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.vmwPvdcStorageProfile+xml", 200)));
 }
Ejemplo n.º 24
0
 public OrgLdapSettingsType UpdateLdapSettings(
     OrgLdapSettingsType orgLdapSettingsType)
 {
     return(SdkUtil.Put <OrgLdapSettingsType>(this.VcloudClient, this.Reference.href + "/settings/ldap", SerializationUtil.SerializeObject <OrgLdapSettingsType>(orgLdapSettingsType, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.organizationLdapSettings+xml", 200));
 }