Use get operation to retrieve parameters of the database server specified by ID. You can retrieve preferences of multiple database servers in a single operation.
A request XML packet retrieving a database server info includes the get operation node:
<packet>
<db_server>
<get>
...
</get>
</db_server>
</packet>
The get node has the following graphical representation:
Note: If the filter node is left blank (<filter/>), the operation will return info on all database servers.
Remarks
A single operation can retrieve the data of multiple database servers. Add as many different id parameters as the number of database servers info on which you want to retrieve.
<db_server>
<get>
...
</get>
...
<get>
...
</get>
</db_server>
The get node of the output XML packet is structured as follows:
database_output.xsd
).plesk_db.xsd
) If the get operation succeeded it returns the following data:
This packet retrieves the database server specified by ID 7
<packet>
<db_server>
<get>
<filter>
<id>7</id>
</filter>
</get>
</db_server>
</packet>
Response:
<packet>
<db_server>
<get>
<result>
<status>ok</status>
<id>7</id>
<data>
<host>14.13.11.2</host>
<port>5432</port>
<type>mysql</type>
<admin></admin>
<status>CREDENTIALS_NOT_SET</status>
<db_num>0</db_num>
</data>
</result>
</get>
</db_server>
</packet>
If the database server was not found, the result is as follows:
<packet>
<db_server>
<get>
<result>
<status>error</status>
<errcode>1013</errcode>
<errtext>Database server does not exist.</errtext>
</result>
</get>
</db_server>
</packet>
This request packet retrieves info on the database servers specified by ID 2 and ID 92.
<packet>
<db_server>
<get>
<filter>
<id>2</id><id>92</id>
</filter>
</get>
</db_server>
</packet>
Response:
<packet>
<db_server>
<get>
<result>
<status>ok</status>
<id>2</id>
<data>
<host>localhost</host>
<port>5432</port>
<type>postgresql</type>
<admin></admin>
<status>CREDENTIALS_NOT_SET</status>
<db_num>0</db_num>
<default></default>
<local></local>
</data>
</result>
<result>
<status>ok</status>
<id>92</id>
<data>
<host>some.host</host>
<port>5432</port>
<type>postgresql</type>
<admin>admin</admin>
<password>qweqwe</password>
<status>OTHER_ERROR</status>
<db_num>0</db_num>
</data>
</result>
</get>
</db_server>
</packet>