The set operation is used to change subdomain hosting settings. You can change all settings of a subdomain at once or specify particular settings.

Request Packet Structure

request XML packet updating a subdomain hosting settings includes the set operation node:

<packet>
<subdomain>
   <set>
   ...
   </set>
</subdomain>
</packet>

The set node is presented by the SubdomainSetInputType (subdomain.xsd). Its graphical representation is as follows:

image 53507

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 specifies the filtering rule. For information on filters, refer to the Available Filters section. Data type: SubdomainFilterType (subdomain.xsd).
  • The property node is required. It specifies hosting property that is to be set for the subdomain. For information on the properties, refer to the Subdomain Properties section. Data type: SubdomainPropertyType (subdomain.xsd).

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

image 53577

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 retrieved from the server. Data type: ResultFilterType (common.xsd).
  • The status node is required. It specifies the execution status of the get operation. Data type: result_status (common.xsd). Allowed values: ok|error.
  • The errcode node is required if the set operation fails. It returns the error code. Data type: unsignedInt.
  • The errtext node is required if the set operation fails. It returns the error message. Data type: string.
  • The filter-id node is required if the set operation succeeds. It returns the parameter by which the subdomain was filtered in the request packet. Data type: anySimple.
  • The id node is required if the set operation succeeds. It returns the ID of the subdomain which settings are retrieved in the response packet. Data type: id_type (common.xsd).

Possible Errors

  • 1006 - Permission is denied.
  • 1013 - Subdomain does not exist.
  • 1015 - Parent site/subdomain is not found.
  • 1019 - Invalid property name.
  • 1023 - Operation failed.

Samples

Changing particular settings of a single subdomain on Linux hosting

This packet changes the home directory for forum. example.com.

<packet>
<subdomain>
<set>
   <filter>
      <name>forum.example.com</name>
   </filter>
   <property>
      <name>www_root</name>
      <value>/sample2</value>
   </property>
</set>
</subdomain>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <subdomain>
    <set>
      <result>
        <status>ok</status>
        <filter-id>forum.example.com</filter-id>
        <id>3</id>
      </result>
    </set>
  </subdomain>
</packet>

Changing settings of multiple subdomains

This packet sets Perl support for all subdomains on the site example.com.

<packet>
<subdomain>
<set>
   <filter>
      <parent-name>example.com</parent-name>
   </filter>
   <property>
      <name>perl</name>
      <value>true</value>
   </property>
      </set>
</subdomain>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <subdomain>
    <set>
      <result>
        <status>ok</status>
        <filter-id>example.com</filter-id>
        <id>3</id>
      </result>
    </set>
  </subdomain>
</packet>