Filtering is the way the request packets pick out FTP accounts to which the requested operation will be applied.
Filtering in Requests
The filter node is presented by the FtpUserFilterType complex type (
ftpuser.xsd). This data type is structured as follows:
- The id node is required. It specifies the FTP account ID in Plesk database. Data type: integer.
- The name node is required. It specifies the name of FTP account. Data type: string.
- The webspace-id node is required. It specifies the unique identifier of the site on which the FTP account exists. Data type: integer.
- The webspace-name node is required. It specifies the name of the site (in Unicode) on which the FTP account exists. Data type: string.
The filter allows two kinds of filtering:
- Nodes id and name serve to filter one to many FTP accounts individually. Individual filtering is allowed to Plesk Administrator, customer (on their own sites) and Plesk Domain Administrators (on their own site).
- Nodes site-id and site-name serve to filter all FTP accounts on a certain site (or several) at one stroke. This kind of filtering is allowed to Plesk Administrator, and Plesk customer (on their own sites).
The following packet requests information on properties of three FTP accounts specified by their ID:
The following packet is identical except it specifies accounts by their names:
The following packet is invalid as both the id and the name nodes are used in the same filter:
The following packet deletes all FTP accounts existing on sites specified by ID:
The same packet specifies sites by name:
The following packet is invalid as it uses both the site-id and the site-name nodes within one filter:
The following packet sent by Plesk Administrator deletes all FTP accounts existing in Plesk. If sent by customer, it deletes all FTP accounts on all sites of this customer.
Filtering in Responses
If an operation in a request packet (del, get, set) uses filters, the filter-id node is nested in a response packet. It returns the filtering rule. If one of the following values was set as a filter rule, it is returned as the filter-id value in the response packet:
- FTP account ID
- FTP account name
- Domain ID
- Domain name
It is done so to trace the request parameters in case of an error. Data type: anySimple. The node value can be integer (site or FTP account ID) or a string (site or FTP account name).
If the filter node is left blank (<filter/>), the filter-id parameter will hold the ID of the object. The blank filter means that all objects are matched by this rule.