Setting Up Server
Using the set operation, one can
- Change Administrator’s password
- Change Administrator’s personal info
- Set up server preferences
- Set up session settings, namely, session timeout
Request Packet Structure
A request XML packet changing Plesk server settings or Administrator’s information contains the set operation node:
<packet>
<server>
<set>
...
</set>
</server>
</packet>
The set node is presented by complex type AdminSetType
(server_input.xsd
) and structured as follows:
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 admin node is optional. It wraps the collection of data
describing Administrator’s personal information and settings. Data
type: adminType (
plesk_server.xsd
). For information on the node structure, refer to Administrator Personal Information. - The password node is optional. It specifies new Plesk
Administrator’s password (5 to 14 characters). Data type:
serverPassword (
plesk_server.xsd
). - The prefs node is optional. It wraps the collection of data
describing traffic usage statistics settings and Apache restart
interval. Data type: serverPrefs (
plesk_server.xsd
). For information on the node structure, refer to Server Preferences. - The session_setup node is optional. It holds data describing
settings of the user’s session in Plesk. Data type:
serverSessionSetup (
plesk_server.xsd
). - The login_timeout node is optional. It returns the period (in minutes) during which the user’s session can idle before it is automatically closed by the server. Data type: integer. Allowed values: 1 to 99999.
- The external-id node is optional. It defines the ID of the server in the Plesk components or third-party applications that interact with Plesk. Data type: string.
- The mode node is optional. It defines the Plesk interface view (either standard or Power User). Data type: string. Available values: standard | poweruser
- The certificate node is optional. It defines the SSL/TLS
certificates used to secure Plesk server and mail server. Data type:
serverCertificates (
plesk_server.xsd
). For information on the node structure, refer to List of SSL/TLS certificates.
Despite all child elements of the set node are optional, the all model group is used, which means that the request packet must contain the set node with at least one child node.
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 response packet is structured as follows:
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 set
operation. Data type: SetResultType (
server_output.xsd
). - The status node is required. It returns the execution status of the set operation defining whether server configuration or administrator’s information were successfully updated or not. 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.
Samples
Changing Administrator’s personal information and password
This packet changes Administrator’s personal information and password and defines SSL/TLS certificates to secure Plesk and mail server.
<packet version="1.6.7.0">
<server>
<set>
<admin>
<admin_cname>JohnDoe BV.</admin_cname>
<admin_pname>John Doe</admin_pname>
<admin_phone>+49 89333333</admin_phone>
<admin_fax>+49 893333303</admin_fax>
<admin_email>john@doe.de</admin_email>
<admin_address>Theatinerstrasse 96</admin_address>
<admin_city>Muenchen</admin_city>
<admin_state>Bavaria</admin_state>
<admin_pcode>80333</admin_pcode>
<admin_country>DE</admin_country>
<send_announce>true</send_announce>
</admin>
<password>gogo4ward</password>
<certificates>
<panel>
<name>default certificate</name>
<admin/>
</panel>
<mail-server>
<name>certificate1</name>
<site>example.com</site>
</mail-server>
</certificates>
</set>
</server>
</packet>
Response:
<packet version="1.6.7.0">
<server>
<set>
<result>
<status>ok</status>
</result>
</set>
</server>
</packet>
Configuring server traffic usage statistics
This packet configures server traffic usage statistics so that both inbound and outbound traffic is logged and the log is stored during 3 months; Apache should not restart automatically; session timeout is 30 minutes. Also, this packet enables the protection of site preview mode with password.
<packet version="1.6.7.0">
<server>
<set>
<prefs>
<stat_ttl>3</stat_ttl>
<traffic_accounting>3</traffic_accounting>
<restart_apache_interval>0</restart_apache_interval>
<preview_protection>true</preview_protection>
</prefs>
<session_setup>
<login_timeout>30</login_timeout>
</session_setup>
</set>
</server>
</packet>
Response:
<packet version="1.6.7.0">
<server>
<set>
<result>
<status>ok</status>
</result>
</set>
</server>
</packet>