Getting Started
Vdisk Devices
Auth
Alerts Notifylists
Cloud Profiles
Cloud Unit
Data Movement Policy
Data Movement
Data Movement Stats Files
Data Movement Stats Mtrees
Data Movement Stats Recall
Managed Files
Licenses
Mdtags
Mtrees
Mtrees Id Rlfiles
Mtrees Id Stats
Mtrees Id Stats Capacity
Mtree Id Stats Compressions
Networks
Network
Network Nic
Cifs Shares
Ddboost
Ddboost Clients
Ddboost Storage Units
Ddboost Users
Nfs Exports
Nfs Exports Id Clients
Nfs Exports Id Referrals
Vdisk Devgrps
Alerts
Vdisk Pools
Vdisk Stimgs
Services
Services Asup
Services Asup Reset
Services License Server
Services Log
Mdtags Services
Services Ntp
Snmp
Settings
Tenant Units
Tenants
Stats
Stats Capacity
Comp Measurements Support Check
Comp Measurements
Stats File Replications
Filesys Stats
Stats Performances Mtrees
Stats Systems File Replications
Support Bundles
System
System Repl
System Space
Users
Users Id Pre Check
Sso Registration
Trust

Filter the list result

In this tutorial, you can learn how to tailor responses according to your filtering requirements.

Filtering in PowerProtect DD REST API is accomplished by using the filter query parameter. This parameter supports regular expression and multiple criteria.

?filter=<field-name>=<value> [and <field-name>=<value>] ...

String filters

DD REST API supports filtering the list result that is targeted on a specific string “abc”.

For example, if you want to filter users with names that contain “abc”, use this filter:

?filter=name=abc

If you want to filter users with names that start with “abc”, use this filter:

?filter=name=^abc

If you want to filter users with names that end with “abc”, use this filter:

?filter=name=abc$

If you want to filter users with names that exactly match “abc”, use this filter:

?filter=name=^abc$

Full sample code with URL-encoded query:

curl --request GET \
     --header 'content-type: application/json' \
     --header 'X-DD-AUTH-TOKEN: <auth-token>' \
     --url 'https://<DD-SYSTEM-IP/FQDN>:3009/rest/v1.0/dd-systems/0/users?filter=name%3Dabc'

The query returns a list of users, whose names contain “abc”.

Number range filters

PowerProtect DD REST API also supports filtering the list result by specifying a range in integers.

Regular expression Number range filter syntax
a <= x <= b (a,b)
x >= a (a, )
x <= b ( ,b)
x == a (a,a)

For example, if you want to filter alerts generated before timestamp “b” including b, use this filter:

?filter=alert_gen_epoch=(,b)

If you want to filter alerts generated after timestamp “a” including a, use this filter:

?filter=alert_gen_epoch=(a,)

If you want to filter alerts generated between timestamp “a” and “b” including a and b, use this filter:

?filter=alert_gen_epoch=(a,b)

Full sample code with URL-encoded query:

curl --request GET \
     --header 'content-type: application/json' \
     --header 'X-DD-AUTH-TOKEN: <auth-token>' \
     --url 'https://<DD-SYSTEM-IP/FQDN>:3009/rest/v1.0/dd-systems/0/alerts?filter=alert_gen_epoch%3D(1582582529%2C1582582534)

The query returns a list of alerts that are generated in (1582582529, 1582582534) in epoch time.

If you have more than one field to filter, you can use the and operator to connect the expressions:

?fitler=name=sys and role=user

Full sample code with URL-encoded query:

curl --request GET \
     --header 'content-type: application/json' \
     --header 'X-DD-AUTH-TOKEN: <auth-token>' \
     --url 'https://<DD-SYSTEM-IP/FQDN>:3009/rest/v1.0/dd-systems/0/users?filter=name%3Dsys%20and%20role%3Duser'