The set operation is used to update settings of site aliases stored in Plesk database. You can update all settings of a site alias in bulk or specify some particular settings. To get information on which site alias settings can be updated on a particular server, use the get-supported-services operation.

For more information visit the Site Alias Settings section.

Request Packet Structure

A request XML packet changing the site alias settings in the Plesk database includes the set operation node:

<packet>
<site-alias>
<set>
...
</set>
</site-alias>
</packet>

The set node graphical representation is as follows:

image 33844

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 specifies which site aliases will be affected. For more information, refer to the Available Filters section. Data type: DomainAliasFilterType (domainalias_input.xsd)
  • The settings node defines settings to be applied to these site aliases. For more information, please refer to the Site Alias Settings section. Data type: Settings (plesk_domainalias.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 34067

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. Specifies the execution status of the set operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. It returns the error code when the set operation fails. Data type: unsignedInt.
  • The errtext node is optional. It returns the error message if the set operation fails. Data type: string.
  • The filter-id node is optional. It returns a filtering rule parameter. For more information, refer to the Available Filters section. Data type: anySimple.
  • The id node is optional. It returns the site alias ID; it is required if the alias id was specified in the request packet. Data type: integer.

Samples

Updating settings of a single site alias

This packet sets up Web references between MyAlias.com and the primary site.

<packet>
<site-alias>
<set>
   <filter>
      <name>MyAlias.com</name>
   </filter>
   <settings>
      <pref>
          <web>1</web>
      </pref>
   </settings>
</set>
</site-alias>
</packet>

Response:

<packet>
<site-alias>
<set>
   <result>
      <status>ok</status>
      <id>7</id>
   </result>
</set>
</site-alias>
</packet>

Updating settings of multiple site aliases

This packet switches off mail redirection from site aliases to the primary site MyPrimary.com.

<packet>
<site-alias>
<set>
   <filter>
      <site-name>MyPrimary.com</site-name>
   </filter>
   <settings>
      <pref>
          <web>1</web>
          <mail>0</mail>
          <tomcat>0</tomcat>
      </pref>
   </settings>
</set>
</site-alias>
</packet>

Response:

<packet>
<site-alias>
<set>
   <filter>
      <site-name>MyPrimary.com</site-name>
   </filter>
   <settings>
      <pref>
          <full/>
      </pref>
   </settings>
</set>
</site-alias>
</packet>