Use the add operation to create plans. When creating a plan, it is enough to specify a plan name. If you are authorized as the Administrator but want to add a plan to a reseller's plan list, specify the reseller ID or username. Additionally, you can specify plan settings when creating a plan.
A request XML packet adding a new service plan to Plesk database includes the add operation node:
<packet>
<service-plan>
<add>
...
</add>
</service-plan>
</packet>
The add node is presented by type DomainTemplateAddInputType (domain_template.xsd
). Its graphical representation is as follows:
plesk_mailname.xsd
). See the structure of this node in the Mailing settings section.plesk_domain.xsd
). See the structure of this node in the Limits section.domain_template.xsd
). See the structure of this node in the Log Rotation Settings section. domain_template.xsd
). See the structure of this node in the Preferences section. domain_template.xsd
). See the structure of this node in the Hosting Settings section. plesk_domain.xsd
). See the structure of this node in the Performance Settings section.domain_template.xsd
). See the section PHP Settings for details.domain_template.xsd
). See the section Web Server Settings for details.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The add node of the output XML packet is of type DomainTemplateAddOutputType (domain_template.xsd)
which has the following presentation:
common.xsd
). To create a plan on behalf of the reseller with ID 12, issue the following packet.
<packet>
<service-plan>
<add>
<name>base_plan</name>
<owner-id>1</owner-id>
<mail>
<mailservice>1</mailservice>
</mail>
</add>
</service-plan>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<service-plan>
<add>
<result>
<status>ok</status>
<id>11</id>
<guid>15b56488-60f7-1b15-b489-09ece02dbb4f</guid>
</result>
</add>
</service-plan>
</packet>
When creating a service plan for Plesk Administrator, omit the reseller identifiers:
<packet>
<service-plan>
<add>
<name>base_plan</name>
<mail>
<webmail>horde</webmail>
</mail>
</add>
</service-plan>
</packet>
To create two service plans with a single packet, include two different add blocks:
<packet>
<service-plan>
<add>
<name>base_plan1</name>
<mail>
<webmail>none</webmail>
</mail>
</add>
<add>
<name>quick_plan1</name>
<mail>
<webmail>horde</webmail>
</mail>
</add>
</service-plan>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<service-plan>
<add>
<result>
<status>ok</status>
<id>12</id>
<guid>acd360bc-6c23-2689-76e5-b01438f5e4a3</guid>
</result>
</add>
<add>
<result>
<status>ok</status>
<id>13</id>
<guid>27fc6501-c137-49cd-5c36-eb74954e68a2</guid>
</result>
</add>
</service-plan>
</packet>
The following packet creates a service plan and configures its mail settings.
<packet>
<service-plan>
<add>
<name>bounce_template</name>
<mail>
<nonexistent-user>
<bounce>Email address does not exist.</bounce>
</nonexistent-user>
<webmail>true</webmail>
</mail>
</add>
</service-plan>
</packet>
To disable log rotation for plan base_plan, use the following packet:
<packet>
<service-plan>
<add>
<name>base_plan</name>
<log-rotation>
<off/>
</log-rotation>
</add>
</service-plan>
</packet>
The following packet creates a service plan that enables log rotation that allows to store up to 30 handled log files per subscription, and removes active log once a week:
<packet>
<service-plan>
<add>
<name>base_plan</name>
<log-rotation>
<on>
<log-condition>
<log-bytime>Weekly</log-bytime>
</log-condition>
<log-max-num-files>30</log-max-num-files>
<log-compress>true</log-compress>
</on>
</log-rotation>
</add>
</service-plan>
</packet>
The following packet creates a service plan with specific preferences.
<packet>
<service-plan>
<add>
<name>base_plan</name>
<preferences>
<stat>6</stat>
<maillists>true</maillists>
<dns_zone_type>master</dns_zone_type>
</preferences>
</add>
</service-plan>
</packet>
Here is the sample packet that creates a service plan with specific physical hosting settings.
<packet>
<service-plan>
<add>
<name>base_plan</name>
<hosting>
<property>
<name>ssl</name>
<value>true</value>
</property>
</hosting>
</add>
</service-plan>
</packet>
Here is the sample packet that creates a service plan with specific performance settings.
<packet>
<service-plan>
<add>
<name>base_plan</name>
<performance>
<bandwidth>1000</bandwidth>
<max_connections>20</max_connections>
</performance>
</add>
</service-plan>
</packet>