Updating Site Information

This method updates information of the site on the Parallels Pro Control Panel server.

Method

public void UpdateSite (SiteForUpdate site, string username, string password)

Parameters

  • site, which is the object of SiteForUpdate with all required details of the site to be updated
  • username, which is the username of the service provider/Reseller
  • password, which is the password of the service provider/Reseller

Return Value

none

Example Code:

SiteForUpdate site = new SiteForUpdate();

WebHosting webHostingConfig = new WebHosting();

//General details

site.DisplayName = "mysite.com";

site.ContactName = "ABC";

site.ShortName = "mysite.com";

site.ContactName = "0132465798";

site.ContactEmail = "blackhole@ensim.com";

site.AdminDisplayName = "Administrator";

site.AdminUserName = "admin@mysite.com";

site.AdminPassword = "ensim123";

site.AdminEmail = "user@example1.com";

//Service Details

webHostingConfig.Enabled = true;

webHostingConfig.IsIpbased = true;

webHostingConfig.BandwidthQuota = 1024;

webHostingConfig.BillingCycleStartDay = 1;

webHostingConfig.BandwidthActionSendMail = true;

webHostingConfig.BandwidthCapped = false;

webHostingConfig.DiskQuota = 25;

webHostingConfig.MaxUsers = 5;

//Updating Service Component: msftp

msftpsvc ftpConfig = new msftpsvc();

ftpConfig.Enabled = true;

//true- Component is added or updated, false- component is removed

ftpConfig.UserIsolationMode = 0;

ftpConfig.AnonymousConnections = true;

ftpConfig.MaxConnections = 100;

ftpConfig.Timeout = 9999;

ftpConfig.SiteLogs = true;

ftpConfig.LogType = enumFTPLogType.W3CExtendedLogFileFormat;

ftpConfig.IISPermRead = true;

ftpConfig.IISPermWrite = false;

ftpConfig.MessageWelcome = "Welcome";

ftpConfig.MessageExit = "Thank You";

ftpConfig.MessageMaxClients = "Maximum number of Clients are already connected. Try Later.";

//Call update method

site.webhosting = webHostingConfig;

site.webhosting._msftpsvc = ftpConfig;

w.UpdateSite(site, "admin", "ensim123");

Note: While updating any site configuration, site general details and Web hosting configuration details must specified.