The set operation is used to change settings of additional FTP accounts existing in Plesk database. You can change settings of particular FTP accounts, or of all FTP accounts existing on particular sites or in the whole Plesk database, depending on what Plesk user credentials are specified in HTML headers of request packet.
Note: Plesk customers can change quota on disk space used by home directory only if they are granted the Hard disk quota assignment permission.
A request XML packet changing FTP account settings in the Plesk database includes the set operation node:
<packet>
<ftp-user>
<set>
...
</set>
</ftp-user>
</packet>
The set node is presented with the FtpUserSetInputType complex type (ftpuser.xsd
), its graphical representation is as follows:
ftpuser.xsd
). For information on this node structure, refer to Available Filters.ftpuser.xsd
).true
is required if new home directory defined with the home node does not exist. Data type: boolean.Remarks
1. The home node should contain a full path to FTP account home directory starting with root site directory. For example: /httpdocs/billy/pub
. If the home node is left blank (<home/>), then home directory for FTP account will be set to default one, which is the site's root directory.
2. Creating new folders in site root directory is prohibited by Plesk. Therefore, it is impossible to make some /Global_Upload folder a home directory for an account. Do not include to your packets lines like
<home>/Global_Upload</home>
<create-non-existent>true</create-non-existent>
3. To change FTP account quota to unlimited, specify value "-1" in the quota node:
<quota>-1</quota>
4. With one packet, you can change settings of as many different FTP accounts with different filtering rules as you want. To do so, use the required number of add nodes in the packet.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The set node of the output XML packet is structured as follows:
ftpuser.xsd
).
This packet sets up new password for FTP account with name "ftpuser2".
<packet>
<ftp-user>
<set>
<filter>
<name>ftpuser2</name>
</filter>
<values>
<password>jkRR67hVBB</password>
</values>
</set>
</ftp-user>
</packet>
Response:
<packet>
<ftp-user>
<set>
<result>
<status>ok</status>
<filter-id>ftpuser2</filter-id>
<id>6</id>
</result>
</set>
</ftp-user>
</packet>
This packet updates settings of FTP account with ID 1: It creates new account home directory /httpdocs/Pub
and allows read and write permissions.
<packet>
<ftp-user>
<set>
<filter>
<id>1</id>
</filter>
<values>
<home>/httpdocs/Pub</home>
<create-non-existent>true</create-non-existent>
<permissions>
<read>true</read>
<write>true</write>
</permissions>
</values>
</set>
</ftp-user>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<ftp-user>
<set>
<result>
<status>ok</status>
<filter-id>1</filter-id>
<id>1</id>
</result>
</set>
</ftp-user>
</packet>
This packet is incorrect as it intends to give the same new name to all FTP accounts existing in the webspace with ID 1.
<packet>
<ftp-user>
<set>
<filter>
<webspace-id>1</webspace-id>
</filter>
<values>
<name>ftp-doe1</name>
</values>
</set>
</ftp-user>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
<ftp-user>
<set>
<result>
<status>ok</status>
<filter-id>1</filter-id>
<id>1</id>
</result>
</set>
</ftp-user>
</packet>