The set operation is used to update add-on plan settings.

Request Packet Structure

A request XML packet adjusting add-on plan settings includes the set operation node:

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

Note: When you update plan settings, all the associated unlocked subscriptions are automatically updated.

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

image 70105

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 add-on plans will be updated in 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 limits node is optional. It sets a collection of limits that will be updated for the specified add-on plans. Data type: domainLimits complex type (plesk_domain.xsd). See the structure of this node in the Limits section.
  • The hosting node is optional. Sets physical hosting settings for the specified add-on plans. Data type: DomainTemplatePhosting (domain_template.xsd) . See the structure of this node in the Hosting Settings section.
  • The performance node is optional. Sets subscription performance settings to the specified subscriptions. 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: none. See the structure of this node in the Permissions section.
  • The external-id node is optional. It holds the ID of the add-on plan in the Plesk components (for example, Business Manager). Data type: string.
  • The name node is optional. It specifies a new name of an add-on plan to be updated. 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 set node of the output XML packet is of type DomainAddonTemplateSetOutputType (domain_addon_template.xsd) which has the following presentation:

image 66488

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 result of the operation for a single add-on plan. 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. Is required if the operation fails. Returns the error code. Data type: unsignedInt.
  • The errtext node is optional. Can be returned if the operation fails. Returns the error message. Data type: string.
  • The id node is optional. If the request packet fails before the execution, this node is missing in the response packet. In all other cases it holds the identifier of the add-on plan (if this id was specified in the request packet). Data type: integer.
  • The name node is optional. If the request packet fails before the execution, this node is missing in the response packet. In all other cases it holds the name of the add-on plan (if this name was specified in the request packet). Data type: string.
  • The guid node is optional. It holds the GUID of the add-on plan. Data type: string.
  • The external-id node is optional. It holds the ID of the add-on plan in the Panel components (for example, Business Manager). Data type: string.

Samples

Update add-on plans that belong to a reseller

To update settings of update only plans of a particular reseller, specify their ID or username.

<packet>
<service-plan-addon>
<set>
   <filter>
      <name>base1</name>
   </filter>
   <owner-login>jdoe</owner-login>
        <limits>
          <limit>
            <name>max_db</name>
            <value>10</value>
          </limit>
        </limits>
</set>
</service-plan-addon>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <service-plan-addon>
    <set>
      <result>
        <status>ok</status>
        <name>base1</name>
      </result>
    </set>
  </service-plan-addon>
</packet>

Update add-on plans that belong to the Administrator

If you are authorized as the Administrator, you can omit the reseller details:

<packet>
<service-plan-addon>
<set>
   <filter>
      <name>base_plan</name>
   </filter>
        <limits>
          <limit>
            <name>max_db</name>
            <value>10</value>
          </limit>
        </limits>
</set>
</service-plan-addon>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <service-plan-addon>
    <set>
      <result>
        <status>ok</status>
        <name>base_plan</name>
      </result>
    </set>
  </service-plan-addon>
</packet>

Operating multiple add-on plans

Here is the sample packet that sets similar add-on plan settings for two different add-on plans, both specified by ID.

<packet>
<service-plan-addon>
<set>
   <filter>
      <id>11</id>
      <id>12</id>
   </filter>
        <limits>
          <limit>
            <name>max_db</name>
            <value>10</value>
          </limit>
        </limits>
</set>
</service-plan-addon>
</packet>

To set different settings for two add-on plans, use two different set operations:

<packet>
<service-plan-addon>
<set>
   <filter>
      <id>12</id>
   </filter>
   <owner-login>JDoe</owner-login>
        <limits>
          <limit>
            <name>max_db</name>
            <value>10</value>
          </limit>
        </limits>
</set>
<set>
   <filter>
      <name>base_plan</name>
   </filter>
        <limits>
          <limit>
            <name>max_db</name>
            <value>10</value>
          </limit>
        </limits>
</set>
</service-plan-addon>
</packet>

Limits

The following packet updates limits of a plan:

<packet>
<service-plan-addon>
<set>
   <filter>
      <id>12</id>
   </filter>
   <limits>
          <limit>
            <name>disk_space</name>
            <value>10737418240</value>
          </limit>
   </limits>
</set>
</service-plan-addon>
</packet>

Hosting

This packet updates physical hosting settings for the plan with ID 12.

<packet>
<service-plan-addon>
<set>
   <filter>
      <id>12</id>
   </filter>
   <hosting>

            <property>
              <name>ssl</name>
              <value>true</value>
            </property>

   </hosting>
</set>
</service-plan-addon>
</packet>

Performance

Here is the sample packet that updates performance settings for the plan with ID 12.

<packet>
<service-plan-addon>
<set>
   <filter>
      <id>12</id>
   </filter>
   <performance>
      <bandwidth>1000</bandwidth>
      <max_connections>20</max_connections>
   </performance>
</set>
</service-plan-addon>
</packet>