Getting Started
Scsitgt Initiators
Appliance Pools
Dd Systems
Stats Capacities
Alerts
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
Filesys
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
Vdisk Devices
Vdisk Pools
Vdisk Stimgs
Repl Contexts
Scsitgt Access Groups
Scsitgt Endpoints
Auth
Services
Services Asup
Services Asup Reset
Iscsi
Services License Server
Services Log
Mdtags Services
Services Ntp
Snmp
Settings
Tenant Units
Tenants
Snapshots
Stats
Stats Capacity
Comp Measurements Support Check
Comp Measurements
Stats File Replications
Filesys Stats
Stats Perf
Stats Performances Mtrees
Stats Systems File Replications
Stats Upgrades Schedules
Support Bundles
System
System Repl
System Space
Upgrades Schedules
Users
Users Id Pre Check
Sites
Config Template Audit
Config Template Audit History
Config Template Audit Schedule
Config Template
Config Templates Features
Config Template Apply
Profile Access Info
Resource Profile
Tasks

Filter the list result

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

Filtering in PowerProtect DDMC REST API is accomplished by using the filter query parameter. This parameter supports regular expression and multiple criteria. Always refer to the API documentation on regex and conditions that can be used in filter.

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

String filters

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

For example, if you want to filter users with name containing “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://<DDMC-SYSTEM-IP/FQDN>:3009/rest/v1.0/dd-systems/bb5bed4adc90eebb%3A4496a0e4def16e94/users?filter=name%3Dabc'

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

Number range filters

DDMC 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://<DDMC-SYSTEM-IP/FQDN>:3009/rest/v1.0/dd-systems/bb5bed4adc90eebb%3A4496a0e4def16e94/alerts?filter=alert_gen_epoch%3D(1582582529%2C1582582534)

It returns a list of alerts, which have been 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://<DDMC-SYSTEM-IP/FQDN>:3009/rest/v1.0/dd-systems/bb5bed4adc90eebb%3A4496a0e4def16e94/users?filter=name%3Dsys%20and%20role%3Duser'