The duplicate operation is used to create a copy of the specified add-on plan.

Request Packet Structure

A request XML packet creating a copy of the specified plan includes the duplicate operation node:

<packet>
<service-plan-addon>
   <duplicate>
   ...
   </duplicate>
</service-plan-addon>
</packet>

The duplicate node is presented by type DomainAddonTemplateDuplicateInputType (domain_addon_template.xsd). Its graphical representation is as follows:

image 72599

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 filter node is required. It serves to specify the criteria by which the necessary add-on plans will be selected from the database. Data type: DomainTemplateFilterType (domain_template.xsd). See the Available Filters section for details on this node.
  • 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 duplicate-name node is required. It specifies the name of the add-on plan copy. 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 duplicate node of the output XML packet is of type DomainAddonTemplateAddOutputType (domain_addon_template.xsd) which has the following presentation:

image 66479

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 Plesk. Data type: integer.
  •  The guid node is optional. Returns the GUID of an add-on plan just added to Plesk. Data type: string.

Samples

This packet creates the copy of the add-on plan with id 1234 owned by user with login name JDoe and assigns the name Add-on copy to the copy.

<packet>
<service-plan-addon>
   <duplicate>
      <filter>
         <id>1234</id>
      </filter>
      <owner-login>JDoe</owner-login>
      <duplicate-name>Add-on copy</duplicate-name>
   </duplicate>
</service-plan-addon>
</packet>

Response:

<packet>
  <service-plan-addon>
    <duplicate>
      <result>
        <status>ok</status>
        <id>17</id>
        <guid>dea4315c-a1da-2ea7-4142-ddc42d0902f9</guid>
      </result>
    </duplicate>
  </service-plan>
</packet>