Creating an Add-on Plan
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 add-on plan settings.
Request Packet Structure
A request XML packet adding a new add-on plan includes the add operation node:
<packet>
<service-plan-addon>
<add>
...
</add>
</service-plan-addon>
</packet>
The add node is presented by type DomainAddonTemplateAddInputType
(domain_addon_template.xsd
). Its graphical representation is as
follows:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.
- The name node is required. It specifies the name of the add-on plan. Data type: string.
- The owner-id node is optional. It specifies the ID of the add-on plan owner. Data type: integer.
- The owner-login node is optional. It specifies the login name of the add-on plan owner. Data type: string.
- The limits node is optional. It specifies a collection of
limits that will be set for new subscriptions created using this
plan. Data type: DomainAddonTemplateLimits
(
domain_addon_template.xsd
). See the structure of this node in the Limits section. - The hosting node is optional. Specifies physical hosting
settings for new subscriptions created using this plan. Data type:
DomainAddonTemplateVrtHst (
domain_addon_template.xsd
). See the structure of this node in the Hosting Settings section. - The performance node is optional. It specifies performance
settings for new subscriptions created using this add-on plan. Data
type: DomainPerformanceType (
plesk_domain.xsd
). See the structure of this node in the Performance Settings section. - The permissions node is optional. It defines which services and
privileges that can be enabled in an add-on plan. Data type:
domainPerms (
plesk_domain.xsd
). See the structure of this node in the Permissions section. - The external-id node is optional. It defines an add-on plan identifier in the Plesk components (for example, Business Manager). Data type: string.
- The php-settings node is optional. It specifies custom PHP
settings that will act as a preset for all subscriptions with the
add-on. Data type: phpSettings (
domain_addon_template.xsd
). See the section PHP Settings for details.
Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The add node of the output XML packet is of type
DomainAddonTemplateAddOutputType (domain_addon_template.xsd
) which
has the following presentation:
Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.
- The result node is required. It wraps the response got from the
server. Data type: resultType (
common.xsd
). - The status node is required. Specifies the execution status of the operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. Returns the error code when the operation fails. Data type: unsignedInt.
- The errtext node is optional. Returns the error message if the operation fails. Data type: string.
- The id node is optional. It is required if the operation has succeeded. Returns the unique identifier of an add-on plan just added to the Panel. Data type: integer.
- The guid node is optional. Returns the GUID of an add-on plan just added to the Panel. Data type: string.
Samples
Creating add-on plan for reseller
To create a plan that enables the SSL/TLS support on behalf of the reseller with ID 1, issue the following packet.
<packet>
<service-plan-addon>
<add>
<name>base_plan</name>
<owner-id>1</owner-id>
<hosting>
<property>
<name>ssl</name>
<value>true</value>
</property>
</hosting>
</add>
</service-plan-addon>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<service-plan-addon>
<add>
<result>
<status>ok</status>
<id>11</id>
<guid>befbe7ca-1c78-cfbb-2eaf-debf4cce4896</guid>
</result>
</add>
</service-plan-addon>
</packet>
Creating add-on plans for the Administrator
When creating an add-on plan for the Administrator, omit the reseller identifiers:
<packet>
<service-plan-addon>
<add>
<name>base_plan</name>
<hosting>
<property>
<name>ssl</name>
<value>true</value>
</property>
</hosting>
</add>
</service-plan-addon>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<service-plan-addon>
<add>
<result>
<status>ok</status>
<id>12</id>
<guid>31afe559-7999-ce3d-1e87-71dc6d83ea41</guid>
</result>
</add>
</service-plan-addon>
</packet>
Creating multiple add-on plans
To create two add-on plans with a single packet, include two different add blocks:
<packet>
<service-plan-addon>
<add>
<name>first_plan</name>
<hosting>
<property>
<name>ssl</name>
<value>true</value>
</property>
</hosting>
</add>
<add>
<name>second_plan</name>
<hosting>
<property>
<name>ssl</name>
<value>true</value>
</property>
</hosting>
</add>
</service-plan-addon>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<service-plan-addon>
<add>
<result>
<status>ok</status>
<id>13</id>
<guid>a2c68e48-982a-1807-c2fb-3708bca41836</guid>
</result>
</add>
<add>
<result>
<status>ok</status>
<id>14</id>
<guid>ccede5cd-3ca3-1db9-f46d-aca67beea2b5</guid>
</result>
</add>
</service-plan-addon>
</packet>
Hosting
Here is the sample packet that creates an add-on plan with specific physical hosting settings.
<packet>
<service-plan-addon>
<add>
<name>base_plan</name>
<hosting>
<property>
<name>ssl</name>
<value>true</value>
</property>
</hosting>
</add>
</service-plan-addon>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<service-plan-addon>
<add>
<result>
<status>ok</status>
<id>15</id>
<guid>40c9f531-12c6-d5a2-d70b-4779dc64ee9b</guid>
</result>
</add>
</service-plan-addon>
</packet>
Performance settings
Here is the sample packet that creates an add-on plan with specific performance settings.
<packet>
<service-plan-addon>
<add>
<name>base_plan6</name>
<performance>
<bandwidth>1000</bandwidth>
<max_connections>20</max_connections>
</performance>
</add>
</service-plan-addon>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<service-plan-addon>
<add>
<result>
<status>ok</status>
<id>17</id>
<guid>05c8c722-f58f-bf0d-7a13-d533f20143cb</guid>
</result>
</add>
</service-plan-addon>
</packet>