The add operation is used to create reseller plans.

Request Packet Structure

A request XML packet creating a reseller plan includes the add operation node:

<packet>
<reseller-plan>
   <add>
   ...
   </add>
</reseller-plan>
</packet>

The add node is presented by the ResellerTemplateAddInputType complex type (reseller_template.xsd). Its graphical representation is as follows:

image 60469

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 reseller plan name. Data type: string.
  • The limits node is optional. It specifies limits policy and limits on Plesk resources usage that are to be set for resellers created with a reseller plan. Data type: ResellerLimits (reseller.xsd). To view the structure of this node, refer to the Limits section.
  • The permissions node is optional. It specifies permissions for resellers created with a reseller plan. Data type: clientPerms (plesk_client.xsd). To view the structure of this node, refer to the Permissions section.
  • The ip-pool node is optional. It specifies IP pool settings for resellers created with a reseller plan. Data type: ResellerTemplateIpPoolType (reseller_template.xsd). To view the structure of this node, refer to the IP Pool Settings section.
  • The external-id node is optional. It specifies a reseller plan ID in the Plesk components. Data type: string.

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 response packet is structured as follows:

image 60471

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 received from the server. Data type: ResellerTemplateOutputResulttype (reseller_template.xsd).
    • The status node is required. It specifies the execution status of the add operation. Data type: result_status (common.xsd). Allowed values: ok|error.
    • The errcode node is required if the add operation fails. It returns the error code. Data type: unsignedInt.
    • The errtext node is required if the add operation fails. It returns the error message. Data type: string.
    • The id node is optional. It returns ID of a created reseller plan. Data type: integer.
    • The name node is not returned with this operation.
    • The guid node is optional. It returns GUID of a reseller plan. Data type: string.
    • The external-id node contains the plan ID in the Plesk components if it was specified in the request packet. Data type: string.
    • The problems node is optional. It states the problems which occurred on the operation execution. Data type: string.

Samples

The following packet creates a reseller plan called sample_plan and defines that resellers created with the plan should automatically have in their IP pools two exclusive IP addresses:

<packet version="1.6.3.0">
<reseller-plan>
<add>
   <name>sample_plan</name>
   <ip-pool>
      <allocate-ip>2</allocate-ip>
   </ip-pool>
</add>
</reseller-plan>
</packet>

Response:

<packet version="1.6.3.0">
  <reseller-plan>
    <add>
      <result>
        <status>ok</status>
        <id>20</id>
        <guid>5dc5a4d7-7449-127f-f694-a0233af4e09f</guid>
      </result>
    </add>
  </reseller-plan>
</packet>

To create two reseller plans within a single packet, include two add operation nodes:

<packet version="1.6.3.0">
<reseller-plan>
<add>
   <name>sample_plan</name>
   <ip-pool>
      <allocate-ip>2</allocate-ip>
   </ip-pool>
</add>
<add>
   <name>base_plan</name>
   <ip-pool>
      <ip-address>192.0.2.121</ip-address>
      <ip-address>192.0.2.122</ip-address>
   </ip-pool>
</add>
</reseller-plan>
</packet>