Deleting FTP Accounts
Use the del operation to remove FTP accounts from Plesk database. You can use this operation for deleting particular FTP accounts defined by name or ID, for deleting all FTP accounts existing on particular sites, also defined by name or ID, or for deleting all FTP accounts existing on all sites you can manage. In the last case, Plesk Administrator deletes all additional FTP accounts created on the whole Plesk server, Plesk customer, in turn, deletes all additional FTP accounts created on his sites.
Request Packet Structure
A request XML packet deleting FTP account includes the del operation node:
<packet>
<ftp-user>
<del>
...
</del>
</ftp-user>
</packet>
The del node is presented by the FtpUserDelInputType complex type
(ftpuser.xsd
). The node has the following graphical representation:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.9.1/agent_input.svg.
- The filter node is required. It indicates which FTP accounts
are to be deleted with the request packet. Data type:
FtpUserFilterType (
ftpuser.xsd
). For information on this node structure, refer to Available Filters.
Remarks
With one packet, you can delete as many different FTP accounts with different filtering rules as you want. To do so, use the required number of del nodes in the packet.
Response Packet Structure
The del node of the output XML 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.9.1/agent_output.svg.
- The result node is required. It wraps the response received
from the server. Data type: resultFilterType (
ftpuser.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. It is used to return the error code when the del operation fails. Data type: unsignedInt.
- The errtext node is optional. It is used to return the error message if the del operation fails. Data type: string.
- The filter-id node is optional. It returns the filtering rule. For more information, refer to the Available Filters section. Data type: anySimple.
- The id node is optional. It returns the unique identifier of the FTP account that has been deleted with the request packet. Data type: integer.
Samples
Deleting single FTP account
This packet deletes FTP account with name photo4.
<packet>
<ftp-user>
<del>
<filter>
<name>photo4</name>
</filter>
</del>
</ftp-user>
</packet>
Response:
<packet>
<ftp-user>
<del>
<result>
<status>ok</status>
<filter-id>photo4</filter-id>
<id>15</id>
</result>
</del>
</ftp-user>
</packet>
Deleting multiple FTP accounts
This packet deletes FTP accounts with names ftpuser2, photo6.
<packet>
<ftp-user>
<del>
<filter>
<name>ftpuser2</name>
<name>photo6</name>
</filter>
</del>
</ftp-user>
</packet>
Response:
<packet>
<ftp-user>
<del>
<result>
<status>error</status>
<errcode>1013</errcode>
<errtext>ftp-user does not exist</errtext>
<filter-id>ftpuser2</filter-id>
</result>
<result>
<status>error</status>
<errcode>1013</errcode>
<errtext>ftp-user does not exist</errtext>
<filter-id>photo6</filter-id>
</result>
</del>
</ftp-user>
</packet>
Deleting all FTO accounts on a site
This packet deletes all FTP accounts existing on site example.com.
<packet>
<ftp-user>
<del>
<filter>
<webspace-name>example.com</webspace-name>
</filter>
</del>
</ftp-user>
</packet>
Response:
<packet>
<ftp-user>
<del>
<result>
<status>ok</status>
<filter-id>example.com</filter-id>
<id>2</id>
</result>
<result>
<status>ok</status>
<filter-id>example.com</filter-id>
<id>3</id>
</result>
<result>
<status>ok</status>
<filter-id>example.com</filter-id>
<id>4</id>
</result>
</del>
</ftp-user>
</packet>
Deleting all FTP accounts that can be managed by Plesk user
This packet removes all FTP accounts that can be managed by Plesk user defined in HTTP headers of the packet.
<packet>
<ftp-user>
<del>
<filter/>
</del>
</ftp-user>
</packet>
Response:
<packet>
<ftp-user>
<del>
<result>
<status>ok</status>
<filter-id>1</filter-id>
<id>1</id>
</result>
</del>
</ftp-user>
</packet>