A default database server manages all databases of the corresponding type. Only one default database server for each type of databases is available in Plesk. Use the set-default operation to set a database server as default.
Request Packet Structure
A request XML packet setting a default database server includes the set-default operation node:
The set-default node has the following graphical representation:
- The id node is required. It specifies the remote database server ID. Data type: integer.
- The type node is required. If specified, the local database server will be set as default for managing the databases of the specified type. Data type: string. Allowed values: mysql | postgresql | mssql.
Note: You can set only one default database server for each type of databases.
You can set multiple database servers as default in a single packet. Add as many set-default operations as the number of database servers which status is to be changed.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The set-default node of the output XML packet is structured as follows:
- The result node is required. It wraps the response retrieved from the server. Data type: DatabaseServerResultType (
- The status node is required. It specifies the execution status of the set-default operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. Is returns the error code if the set-default operation fails. Data type: integer.
- The errtext node is optional. It returns the error message if the set-default operation fails. Data type: string.
- The id node is optional. If the set-default operation succeeds and ID was specified in the request packet, it returns the ID of the database server. Data type: integer.
Changing status of a database server
Upon supposition that the type of remote database server with ID 1 is mysql, the following request packet sets the database server as default for managing MySQL databases.
If the database server with ID 1 was not found on the server, the response looks as follows:
Changing status of multiple database servers
This packet sets the remote database server with ID 1 and local Microsoft SQL database server as default for MySQL and Microsoft SQL databases correspondingly.