This guide describes procedure for adding new packages to your products offer. It consists of several major steps:
- Add package descriptions into provisioning description
- Update BIlling API configuration with new packages
- Create Billing API products to be associated with new packages
Important note! Every time a change is made,it's proper
practice to run the script for recreating config files in respective
machines located in the relevant child folder(eg.Automation Server, BillingAPIs based on environment) of 'C:\Program Files (x86)\Atomia', 'iisreset' through terminal of respective machines and
restart 'Atomia Automation Server Provisioning Service' in windows
services.
<package name="BasePackage"> <serviceList> <service name="CsBase" /> <service name="CsCloud" /> <service name="CsDatabase" /> <service name="CsDomainParking" /> <service name="CsDomainRedirection" /> <service name="CsDomainFrameRedirection" /> <service name="CsDomainNoWebsite" /> <service name="CsAccountQuota" /> <service name="CsExternalDomainRelatedSubscriptions" /> </serviceList> <serviceLimitationList> <globalLimitation> <group maxCount="1"> <service name="CsBase" /> </group> <group maxCount="1"> <service name="CsCloud" /> </group> <group maxCount="1"> <service name="CsDomainRegList" /> </group> <group maxCount="5"> <service name="CsSshAccount" /> </group> <group maxCount="1"> <service name="CsMSSQLDatabase" /> </group> <group maxCount="0"> <service name="DnsSlaveZone" /> </group> <group maxCount="1"> <service name="CsAccountQuota" /> </group> <group maxCount="0"> <service name="CsExchangeMailSupport" /> </group> <group maxCount="0"> <service name="CsVPSInstance" /> </group> <group maxCount="0"> <service name="CsPostgreSQLDatabase" /> </group> <group maxCount="0"> <service name="CsPostgreSQLAccount" /> </group> </globalLimitation> </serviceLimitationList> <propertySettings> <set servicePath="CsAccountQuota/CsQuotaEntryBandwidth" propertyName="MaxValue" propertyValue="1073741824" /> <set servicePath="CsAccountQuota/CsQuotaEntryBandwidth" propertyName="TimePeriod" propertyValue="1" /> <set servicePath="CsAccountQuota/CsQuotaEntryBandwidth" propertyName="TimePeriodUnit" propertyValue="month" /> <set servicePath="CsAccountQuota/CsQuotaEntryStorage" propertyName="MaxValue" propertyValue="107374182400" /> <set servicePath="CsAccountQuota/CsQuotaEntryStorage" propertyName="TimePeriod" propertyValue="1" /> <set servicePath="CsAccountQuota/CsQuotaEntryStorage" propertyName="TimePeriodUnit" propertyValue="month" /> <set servicePath="CsBase/CsLinuxWebsite/CsExchangeMailSupport" propertyName="StorageQuota" propertyValue="1073741824" /> <set servicePath="CsBase/CsWindowsWebsite/CsExchangeMailSupport" propertyName="StorageQuota" propertyValue="1073741824" /> <set servicePath="CsBase/CsWindowsWebsite/CsWindowsAlias/CsExchangeMailSupport" propertyName="StorageQuota" propertyValue="5368709120" /> <set servicePath="CsBase/CsLinuxWebsite/CsLinuxAlias/CsExchangeMailSupport" propertyName="StorageQuota" propertyValue="5368709120" /> <set servicePath="CsDomainRedirection/CsExchangeMailSupport" propertyName="StorageQuota" propertyValue="5368709120" /> <set servicePath="CsDomainFrameRedirection/CsExchangeMailSupport" propertyName="StorageQuota" propertyValue="5368709120" /> <set servicePath="CsDomainParking/CsExchangeMailSupport" propertyName="StorageQuota" propertyValue="5368709120" /> <set servicePath="CsDomainNoWebsite/CsExchangeMailSupport" propertyName="StorageQuota" propertyValue="5368709120" /> </propertySettings> <init> <arguments> <argument serviceName="CsBase" propertyName="InitMasterFtpAccount" propertyValue="true" /> </arguments> <serviceToAdd serviceName="CsBase"> <propertyInitList> <property servicePropertyName="ADPassword" valueSource="ADPassword" /> <property servicePropertyName="PosixUid" valueSource="PosixUid" /> <property servicePropertyName="FtpPassword" valueSource="FtpPassword" /> <property servicePropertyName="RootFolderParentPath" valueSource="RootFolderParentPath" /> <property servicePropertyName="PackageNumber" valueSource="PackageNumber" /> </propertyInitList> </serviceToAdd> <serviceToAdd serviceName="CsCloud" /> <serviceToAdd serviceName="CsExternalDomainRelatedSubscriptions" /> </init> <disable> <scriptList> <script name="Disable"> <serviceList> <service path="CsBase/CsWindowsWebsite/IISWebSite" action="modify"> <propertyList> <property name="HomeDirectory" newValue="/mnt/content/suspended/public_html" /> </propertyList> </service> <service path="CsBase/CsLinuxWebsite/ApacheWebSite" action="modify"> <propertyList> <property name="Suspended" newValue="true" /> </propertyList> </service> <service path="*/FTPAccount" action="modify"> <propertyList> <property name="Status" newValue="0" /> </propertyList> </service> </serviceList> </script> </scriptList> </disable> <actionHooks> <onBeforeChangePackage argument="{'upgrade_to':['BasePackage','PremiumPackage','ApplicationInstallerPackage'],'downgrade_to':['DnsPackage'],'preview_zone':'preview.swebby.se','keep_mail_on_downgrade':'false','keep_unsupported_services_and_extensions':'false'}" type="Atomia.Provisioning.ActionHooks.PackageChange.UpgradeDowngrade, Atomia.Provisioning.ActionHooks.PackageChange" /> </actionHooks> </package>
Main property of package is it's name. It must be unique.
Major sections are serviceList - list of services that this package supports, serviceLimitationList - defines maximum amount of certain services within one package, propertySettings - TBD, init - defines list of services and their properties that are automatically provisioned with the package, disable - defines what is happening with the services in case when disable (suspend) action is called and actionHooks - properties used internally by the Automation Server in case when defined action take place.
To define new package in Provisioing description, you just need to define these 6 sections to suite your needs.
NOTE: Make sure to follow instructions for updating configuration when changining any file, including Provisioning description. Instructions are available here: Change configuration for Atomia application.
Update BIlling API configuration with new packages
In web.config for Billing API what his commonly located in C:\Program Files (x86)\Atomia\BillingAPIs\BillingApi\Web.config, mapping for all provisnionog packages need to exist. Whitin this file, mapping is located at configuration / atomiaProvisioningConfiguration / provisioningDescriptionMappings. There you locate provisioningDescription that matches name of the provisioning description where you added your package, and in it there are package mappings. For our Example package from above, mappings would look like this:
<package name="BasePackage" type="Package"> <properties> <packageProperty key="DomainName" value="DomainName" /> </properties> <includedPackages> <package name="DomainRegistrationContactPackage" type="Package" oncePerAccount="True" /> </includedPackages> </package>
Section includedPackages defines if some other package will be automatically provisioned with this package.
Besides mappings, this file also contains provisioning priority of the packages, and our package needs to be added there as well. This defines priority of subscription provisioning in case that one order holds more then one packages or package extensions. Lower number means higher priority. Same priority means that it is not relevant in which order packages are provisioned. This is located in configuration / atomiaBilling / provisioningOrders and it looks like this:
<provisioningOrder provisioningService="BasePackage" order="1" />
NOTE: Make sure to follow instructions for updating configuration when changining any file, including web.config. Instructions are available here: Change configuration for Atomia application.
Create Billing API products to be associated with new packages
To assign price and reneal periods (in case you decide to make it recurring) with new pakage, Billing API product need to be created. This is done trough Admin Panel, Product page. Add product there with desired options.
After product is added, it will not be automatically shown on order pages. For that, product need to be added to then shop associated with the order page you want to offer it to. Products can be add to shop trough the Shops page in Admin Panel. Just hit Edit action on the desired shop.