Detaching Database Servers

Use the del operation to detach database servers from Plesk. This option is available only for remote database servers. Default database servers cannot be removed using this operation. You can detach multiple database servers in a single packet.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet detaching a database server from Plesk includes the del operation node:

<packet>
<db_server>
  <del>
  ...
  </del>
</db_server>
</packet>

 

The del node has the following graphical representation:

  • The filter node is required. Specifies the filtering rule. Data type: DatabaseServerFilterType (database_input.xsd).
  • The id node is optional. It specifies ID of the database server to be detached. Data type: integer.

Remarks

You can detach multiple database servers from Plesk in a single packet. Add as many id parameters as the number of database servers which are to be detached.

<db_server>
   <del>
     <filter>
     <id>...</id>
     ...
     <id>...</id>
     </filter>
   </del>
</db_server>
 

Response Packet Structure

The del 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 (database_output.xsd).
  • The status node is required. It specifies the execution status of the del operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. Is returns the error code if the del operation fails. Data type: integer
  • The errtext node is optional. It returns the error message if the del operation fails. Data type: string.
  • The id node is optional. It returns the ID of the database server. Data type: integer.

 

 

Samples

Unregistering a single database server

This packet detaches the database server specified by ID 5 from Plesk.

<packet>
<db_server>
 <del>
   <filter>
     <id>5</id>
   </filter>
 </del>
</db_server>
</packet>

Response:

<packet>
<db_server>
 <del>
   <result>
     <status>ok</status>
     <id>5</id>
   </result>
 </del>
</db_server>
</packet>

 

If the database server was a default database server, the response from the server looks as follows:

<packet>
<db_server>
 <del>
   <result>
     <status>error</status>
     <errcode>1023</errcode>
     <errtext>The default database server cannot be deleted.</errtext>
     <id>5</id>
   </result>
 </del>
</db_server>
</packet>

 

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

<packet>
<db_server>
 <del>
   <result>
     <status>error</status>
     <errcode>1013</errcode>
     <errtext>Database server does not exist.</errtext>
     <id>5</id>
   </result>
 </del>
</db_server>
</packet>
Unregistering multiple database servers

This packet detaches all remote database servers from Plesk.

<packet>
<db_server>
 <del>
   <filter/>
 </del>
</db_server>
</packet>

Reponse:

<packet>
<db_server>
 <del>
   <result>
     <status>ok</status>
     <id>5</id>
   </result>
   <result>
     <status>ok</status>
     <id>6</id>
   </result>
   <result>
     <status>ok</status>
     <id>7</id>
   </result>
 </del>
</db_server>
</packet>
 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.