Filter parameter
Use the filter parameter to filter the retrieved objects. For example, all filesets with
ID less than 2 can be retrieved by using ?filter=status.id<2
. The fields that
are used in the filter parameter are always added to the result set and therefore they do not have
to be specified by using the field parameter. Filters can be concatenated by
using ",".
The following list provides the supported operators for different field types:
- String
- "=", "!=" using a regular expression as the value is supported. For example,
?filter=config.filesetName=' ' 'fs.*' ' '
. - Numeric
- "=", "!=", " < ", " >". For example,
?filter=status.id<2
. - Boolean
- "=", "!=" by using "true" or "false" as the value. For example,
?filter=config.isIndependent=false
.
The following examples show how to use filter parameter in a request:
curl -k -u admin:admin001 -X GET -H content-type:application/json
'https://198.51.100.1:443/scalemgmt/v2/filesystems/gpfs0/filesets?filter=status.rootInode>3'
{
"filesets" : [ {
"config" : {
"filesetName" : "fs1",
"filesystemName" : "gpfs0"
},
"status" : {
"rootInode" : 10752
}
} ],
"status" : {
"code" : 0,
"message" : "List of filesets for filesystem"
}
}
Retrieve all file systems with
encryption=”yes”:
curl -H content-type:application/json -K -u admin:admin001 -X GET
'https://198.51.100.1:443/scalemgmt/v2/filesystems?filter=encryption=yes'
(
"filesystems" : [ (
"encryption: : "yes"
"filesystemName" : "objfs"
} ],
"status" : {
"code" : 200,
"message" : "List of all file systems"
}
}