Changing Database Server Preferences

Use the set operation to change preferences of the database server specified by ID. You can change preferences for multiple database servers in a single packet.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet changing a database server preferences includes the set operation node:

<packet>
<db_server>
  <set>
  ...
  </set>
</db_server>
</packet>

 

The set node is presented by type DatabaseServerDescriptionOpt (plesk_db.xsd) and has the following graphical representation:

Remarks

You can change preferences for multiple database servers in a single packet. Add as many set operations as the number of database servers which preferences are to be changed.

<db_server>
   <set>
   ...
   </set>
...
   <set>
   ...
   </set>
</db_server>

Important: 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:

 

 

Samples

Changing preferences of a database server

This packet changes IP address of the database server specified by ID 1.

<packet>
<db_server>
 <set>
   <host>11.122.23.14</host>
   <port>3306</port>
   <admin>senior</admin>
   <password>senior</password>
   <id>1</id>
 </set>
</db_server>
</packet>

Response:

<packet>
<db_server>
 <set>
   <result>
   <status>ok</status>
   <id>1</id>
   </result>
 </set>
</db_server>
</packet>

 

If the database server with ID 1 was not found on the server, the response looks as follows:

<packet>
<db_server>
 <set>
   <result>
    <status>error</status>
    <errcode>1013</errcode>
    <errtext>Database server does not exist</errtext>
   </result>
 </set>
</db_server>
</packet>
Changing preferences of multiple database servers

This request packet changes ports of the MySQL and PostgreSQL database servers specified by ID 7 and ID 8.

<packet>
<db_server>
 <set>
   <host>localhost</host>
   <port>336</port>
   <admin>senior</admin>
   <password>senior</password>
   <id>7</id>
 </set>
 <set>
   <host>localhost</host>
   <port>337</port>
   <admin>senior</admin>
   <password>senior</password>
   <id>8</id>
 </set>
</db_server>
</packet>

 If preferences of the database server with ID 7 were successfully changed, and the database server with ID 8 was not found on the server, the response looks as follows:

<packet>
<db_server>
 <set>
   <result>
   <status>ok</status>
   <id>7</id>
   </result>
 </set>

 <set>
   <result>
    <status>error</status>
    <errcode>1013</errcode>
    <errtext>Database server does not exist</errtext>
   </result>
 </set>
</db_server>
</packet>