Available Filters

Filtering is the way the request packets pick out FTP accounts to which the requested operation will be applied.

 

In this chapter:

Filtering in Requests

Filtering in Responses

 

Filtering in Requests

The filter node is presented by the FtpUserFilterType complex type (ftpuser.xsd). This data type is structured as follows:

ftpuser_filter

The filter allows two kinds of filtering:

 

Individual filtering

The following packet requests information on properties of three FTP accounts specified by their ID:

<packet>
<ftp-user>
<get>
   <filter>
      <id>65</id>
      <id>66</id>
      <id>67</id>
   </filter>
</get>
</ftp-user>
</packet>

 

The following packet is identical except it specifies accounts by their names:

<packet>
<ftp-user>
<get>
   <filter>
      <name>willy</name>
      <name>billy</name>
      <name>dilly</name>
   </filter>
</get>
</ftp-user>
</packet>

 

The following packet is invalid as both the id and the name nodes are used in the same filter:

<packet>
<ftp-user>
<get>
   <filter>
      <name>willy</name>
      <id>66</id>
      <name>dilly</name>
   </filter>
</get>
</ftp-user>
</packet>

 

Bulk filtering

The following packet deletes all FTP accounts existing on sites specified by ID:

<packet>
<ftp-user>
<del>
   <filter>
      <webspace-id>638</webspace-id>
      <webspace-id>1498</webspace-id>
   </filter>
</del>
</ftp-user>
</packet>

 

The same packet specifies sites by name:

<packet>
<ftp-user>
<del>
   <filter>
      <webspace-name>doe1.com</webspace-name>
      <webspace-name>doe2.com</webspace-name>
   </filter>
</del>
</ftp-user>
</packet>

 

The following packet is invalid as it uses both the site-id and the site-name nodes within one filter:

<packet>
<ftp-user>
<del>
   <filter>
      <webspace-id>638</webspace-id>
      <webspace-name>doe2.com</webspace-name>
   </filter>
</del>
</ftp-user>
</packet>

 

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.

<packet>
<ftp-user>
<del>
   <filter/>
</del>
</ftp-user>
</packet>

 

 

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:

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.