Configuring Service Plan Settings

The set operation is used to update service plan settings.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet adjusting service plan settings includes the set operation node:

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

 

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

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

service-plan-web-settings-set

  • The filter node is required. It serves to specify the criteria by which service plans will be updated in the database. Data type: DomainTemplateFilterType (domain_template.xsd).
  • The owner-id node is optional. It specifies the ID of the service plan owner. Data type: integer.
  • The owner-login node is optional. It specifies the login name of the service plan owner. Data type: string.
  • The mail node is optional. It sets a collection of email preferences that will be updated for the specified service plans. Data type: MailPreferences complex type (plesk_mailname.xsd). See the structure of this node in the Mailing settings section.
  • The limits node is optional. It sets a collection of limits that will be updated for the specified service plans. Data type: domainLimits complex type (plesk_domain.xsd). See the structure of this node in the Limits section.
  • The log-rotation node is optional. It sets a collection of log file rotation settings for the specified service plans. Data type: LogRotationType complex type (domain_template.xsd). See the structure of this node in the Log rotation settings section.
  • The preferences node is optional. It sets a collection of preferences for the specified service plans. Data type: DomainTemplatePreferecesType complex type (domain_template.xsd). See the structure of this node in the Preferences section.
  • The hosting node is optional. Sets physical hosting settings for the specified service 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 a service 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 service plan in the Plesk components (for example, Business Manager). Data type: string.
  • The name node is optional. It specifies a new name of a service 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 plan subscriptions. Data type: phpSettings (domain_template.xsd). See the section PHP Settings for details.
  • The web-server-settings node is optional. It specifies custom web server settings that will act as a preset for all plan subscriptions. Data type: webServerSettings (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.

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.

 

Response Packet Structure

The set node of the output XML packet is of type DomainTemplateSetOutputType (domain_template.xsd) which is structured as follows:

  • The result node is required. It wraps the result of the set operation for a single service plan. Data type: resultType (common.xsd).
  • The status node is required. Specifies the execution status of the set operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is required if the set operation fails. Returns the error code. Data type: unsignedInt.
  • The errtext node is optional. Can be returned if the set 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 service 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 service plan (if this name was specified in the request packet). Data type: string.
  • The guid node is optional. It holds the GUID of the service plan. Data type: string.
  • The external-id node is optional. It holds the ID of the service plan in the Panel components (for example, Business Manager). Data type: string.
  • The problems node is optional. It holds the description of conflicts occurred on completion of the operation. Data type: string.

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.

 

Samples

Updating service plans specified by ID

This request packet updates two service plans specified by ID.

<packet version="1.6.3.0">
<service-plan>
<set>
   <filter>
      <id>11</id>
      <id>12</id>
   </filter>
   <mail>
      <webmail>false</webmail>
   </mail>
</set>
</service-plan>
</packet>

Response:

<packet version="1.6.3.0">
<service-plan>
<set>
   <result>
      <status>ok</status>
      <id>11</id>
   </result>
   <result>
      <status>ok</status>
      <id>12</id>
   </result>
</set>
</service-plan>
</packet>
Update service plans that belong to different Plesk users

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

<packet>
<service-plan>
<set>
   <filter>
      <name>base_plan</name>
   </filter>
   <owner-login>JDoe</owner-login>
   <mail>
      <webmail>true</webmail>
   </mail>
</set>
</service-plan>
</packet>

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

<packet>
<service-plan>
<set>
   <filter>
      <name>base_plan</name>
   </filter>
   <mail>
      <webmail>true</webmail>
   </mail>
</set>
</service-plan>
</packet>
Operating multiple service plans

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

<packet>
<service-plan>
<set>
   <filter>
      <id>11</id>
      <id>12</id>
   </filter>
   <mail>
      <webmail>true</webmail>
   </mail>
</set>
</service-plan>
</packet>

 

To set different settings for two service plans, use two different set operations:

<packet>
<service-plan>
<set>
   <filter>
      <id>12</id>
   </filter>
   <owner-login>JDoe</owner-login>
   <mail>
      <webmail>false</webmail>
   </mail>
</set>
<set>
   <filter>
      <name>base_plan</name>
   </filter>
   <mail>
      <webmail>true</webmail>
   </mail>
</set>
</service-plan>
</packet>

 

The following packet updates all service plans that belong to the request packet sender:

<packet>
<service-plan>
<set>
   <filter/>
   <mail>
      <webmail>false</webmail>
   </mail>
</set></service-plan>
</packet>
Mailing settings

The following packet updates mail settings for plan bounce_plan:

<packet>
<service-plan>
<set>
   <filter>
      <name>bounce_plan</name>
   </filter>
        <mail>
          <nonexistent-user>
            <reject/>
          </nonexistent-user>
          <webmail>none</webmail>
        </mail>
</set>
</service-plan>
</packet>
Limits

The following packet updates limits of a plan:

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

To disable log rotation for the plan with ID 12, use the following packet:

<packet>
<service-plan>
<set>
   <filter>
      <id>12</id>
   </filter>
   <log-rotation>
      <off/>
   </log-rotation>
</set>
</service-plan>
</packet>
Preferences

The following packet updates preferences for the plan with ID 12:

<packet>
<service-plan>
<set>
   <filter>
      <id>12</id>
   </filter>
        <preferences>
          <stat>3</stat>
          <maillists>false</maillists>
          <dns_zone_type>master</dns_zone_type>
        </preferences>
</set>
</service-plan>
</packet>
Hosting

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

<packet>
<service-plan>
<set>
   <filter>
      <id>12</id>
   </filter>
   <hosting>
      <vrt_hst>
            <property>
              <name>ssl</name>
              <value>true</value>
            </property>
      </vrt_hst>
   </hosting>
</set>
</service-plan>
</packet>
Performance

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

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

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.