Usage of Query Criteria
QueryCriteria is a general purpose container in order to specify resource, scope, search, sorting and other information while querying on a resource.
Specify scope with Filters
Filters
There are 3 kind of filters to specify the scope in QueryCriteria:
-
filters
A list of Filter, indicates including all the resources which meets any of filters. [OR operator]
-
extraFilters
A list of Filter, indicates including the resource which meets all of filters. [AND operator]
-
extraNotFilters
A list of Filter, indicates excluding the resource which meets any of filters. [AND NOT operator]
Structure of a Filter
Type | Value | Example |
AP | apMac | {AP, 11:22:33:44:55:66} |
APGROUP | apGroupId | {APGROUP, 758b6970-032a-11e7-9e78-0a0027000000} |
CLIENT | clientMac | {CLIENT, AB:CD:00:00:00:03} |
DOMAIN | domainId | {DOMAIN, 8b2081d5-9662-40d9-a3db-2a3cf4dde3f7} |
INDOORMAP | indoorMapId | {INDOORMAP, 08733520-0a32-11e7-89a3-0a0027000000} |
WLAN | wlanId | {WLAN, 1} |
ZONE | zoneId | {ZONE, 91fa3fe0-03da-11e7-8d82-0a0027000000} |
{
"filters": [
{
"type": "DOMAIN",
"value": "Domain1Id"
"operator": "eq"
},
{
"type": "DOMAIN",
"value": "Domain2Id"
"operator": "eq"
},
{
"type": "DOMAIN",
"value": "Domain3Id"
"operator": "eq"
},
{
"type": "ZONE",
"value": "Zone4Id"
"operator": "eq"
}
}
Filter Examples
Example 1: Get specific resource which is in Domain1 or Domain2 or Domain3 or Zone4
{
"filters": [
{
"type": "DOMAIN",
"value": "Domain1Id",
"operator": "eq"
},
{
"type": "DOMAIN",
"value": "Domain2Id",
"operator": "eq"
},
{
"type": "DOMAIN",
"value": "Domain3Id",
"operator": "eq"
},
{
"type": "ZONE",
"value": "Zone4Id",
"operator": "eq"
}
}
Example 2: Get specific resource which is in (Domain1 or Domain2) and syncedStatus is Online (AP for example)
{
"filters": [
{
"type": "DOMAIN",
"value": "Domain1Id",
"operator": "eq"
},
{
"type": "DOMAIN",
"value": "Domain2Id",
"operator": "eq"
}
],
"extraFilters": [
{
"type": "SYNCEDSTATUS",
"value": "Online",
"value": "eq"
}
]
}
Example 3: Get specific resource which in in (Domain1 or Domain2) and NOT in IndoorMap:indoorMapId
{
"filters": [
{
"type": "DOMAIN",
"value": "Domain1Id",
"operator": "eq"
},
{
"type": "DOMAIN",
"value": "Domain2Id",
"operator": "eq"
}
],
"extraNotFilters": [
{
"type": "INDOORMAP",
"value": "indoorMapId",
"value": "eq"
}
]
}
{
"filters": [
{
"type": "DOMAIN",
"value": "Domain1Id",
"operator": "eq"
},
{
"type": "DOMAIN",
"value": "Domain2Id",
"operator": "eq"
}
],
"extraNotFilters": [
{
"type": "INDOORMAP",
"value": "indoorMapId",
"value": "eq"
}
]
}
Full text search
Note that not all columns of entities support full text search.
Example: Search with all fields
"fullTextSearch":
{
"type": "AND",
"value": "keyword"
},
Example: Search with specific fileds
"fullTextSearch":
{
"type": "AND",
"value": "keyword",
"fields": [
"apMac",
"syncedDeviceName"
]
},
"fullTextSearch":
{
"type": "AND",
"value": "keyword",
"fields": [
"apMac",
"syncedDeviceName"
]
},
Sort
Example:
"sortInfo":
{
"sortColumn": "deviceName",
"dir": "ASC"
},
JSON Schema
Please refer to the request info of each URI.
Example:
{
"type": "object",
"additionalProperties": false,
"properties": {
"filters": {
"description": "Filters used to select specific resource scope",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"description": "Group type",
"enum": [
"SYSTEM",
"CATEGORY",
"CONTROLBLADE",
"DATABLADE",
"DOMAIN",
"ZONE",
"THIRD_PARTY_ZONE",
"APGROUP",
"WLANGROUP",
"INDOORMAP",
"AP",
"WLAN",
"BLADE",
"SYNCEDSTATUS",
"REGISTRATIONSTATE",
"STATUS"
]
},
"value": {
"description": "Group ID",
"type": "string"
},
"operator": {
"description": "operator",
"enum": [
"eq",
"gt",
"lt",
"gte",
"lte"
]
}
}
}
},
"extraFilters": {
"description": "\"AND\" condition for multiple filters",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"description": "Filters for specific attribute",
"enum": [
"CONTROLBLADE",
"DATABLADE",
"DOMAIN",
"ZONE",
"THIRD_PARTY_ZONE",
"APGROUP",
"WLANGROUP",
"INDOORMAP",
"AP",
"WLAN",
"ProtocolType",
"TIMERANGE",
"RADIOID",
"WLANID",
"CATEGORY",
"CLIENT",
"CP",
"DP",
"CLUSTER",
"NODE",
"BLADE",
"SYNCEDSTATUS",
"OSTYPE",
"APP",
"PORT",
"STATUS",
"REGISTRATIONSTATE",
"GATEWAY",
"APIPADDRESS",
"CLIENTIPADDRESS",
"SEVERITY",
"ACKNOWLEDGED",
"MVNOID",
"USER",
"USERID",
"WLANNAME",
"AUDITIPADDRESS",
"AUDITUSERUUID",
"AUDITOBJECT",
"AUDITACTION",
"AUDITTENANTUUID",
"AUDITOBJECTUUID",
"AUTHTYPE",
"AUDITTYPE",
"H20SuppportEnabled",
"AaaSuppportEnabled",
"GppSuppportEnabled",
"Type",
"RogueMac",
"ALARMSTATE"
]
},
"value": {
"description": "value to search",
"type": "string"
},
"operator": {
"description": "operator",
"enum": [
"eq",
"gt",
"lt",
"gte",
"lte"
]
}
}
}
},
"extraNotFilters": {
"description": "\"NOT\" condition for multiple filters",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"description": "Filters for specific attribute",
"enum": [
"CONTROLBLADE",
"DATABLADE",
"DOMAIN",
"ZONE",
"THIRD_PARTY_ZONE",
"APGROUP",
"WLANGROUP",
"INDOORMAP",
"AP",
"WLAN",
"ProtocolType",
"TIMERANGE",
"RADIOID",
"WLANID",
"CATEGORY",
"CLIENT",
"CP",
"DP",
"CLUSTER",
"NODE",
"BLADE",
"SYNCEDSTATUS",
"OSTYPE",
"APP",
"PORT",
"STATUS",
"REGISTRATIONSTATE",
"GATEWAY",
"APIPADDRESS",
"CLIENTIPADDRESS",
"SEVERITY",
"ACKNOWLEDGED",
"MVNOID",
"USER",
"USERID",
"WLANNAME",
"AUDITIPADDRESS",
"AUDITUSERUUID",
"AUDITOBJECT",
"AUDITACTION",
"AUDITTENANTUUID",
"AUDITOBJECTUUID",
"AUTHTYPE",
"AUDITTYPE",
"H20SuppportEnabled",
"AaaSuppportEnabled",
"GppSuppportEnabled"
]
},
"value": {
"description": "value not to search",
"type": "string"
}
}
}
},
"options": {
"description": "specified feature required informaion",
"type": "object",
"additionalProperties": false,
"properties": {
"auth_includeNa": {
"description": "include Not Available auth service option while returning result",
"type": "boolean"
},
"auth_includeLocalDb": {
"description": "include LocalDB auth service while returning result",
"type": "boolean"
},
"auth_includeGuest": {
"description": "include Guest auth service while returning result",
"type": "boolean"
},
"auth_includeAdGlobal": {
"description": "If AD is in list, include only AD with Global Catalog configured",
"type": "boolean"
},
"auth_type": {
"description": "authentication service types to get, use comma to separate, Ex: RADIUS,AD",
"type": "string"
},
"auth_realmType": {
"description": "To get specific authentication service information for configuring realm based authentication profile",
"enum": [
"ALL",
"RADIUS"
]
},
"acct_type": {
"description": "accounting service types to get, use comma to separate, Ex: RADIUS,CGF",
"type": "string"
},
"auth_testableOnly": {
"description": "only get testable service type",
"type": "boolean"
},
"acct_testableOnly": {
"description": "only get testable service type",
"type": "boolean"
},
"acct_includeNa": {
"description": "include Not Available acct service option while returning result",
"type": "boolean"
},
"forwarding_type": {
"description": "forwarding service types to get, use comma to separate, Ex: L2oGRE,TTGPDG,Bridge,Advanced",
"type": "string"
},
"includeSharedResources": {
"description": "Whether to include the resources of parent domain or not.",
"type": "boolean"
},
"INCLUDE_RBAC_METADATA": {
"description": "Whether to include RBAC metadata or not.",
"type": "boolean"
},
"TENANT_ID": {
"description": "Specify Tenant ID for query.",
"type": "string"
},
"inMap": {
"description": "Specify inMap status for query.",
"type": "boolean"
},
"globalFilterId": {
"description": "Specify GlobalFilter ID for query.",
"type": "string"
},
"auth_hostedAaaSupportedEnabled": {
"description": "Indicate if Hosted AAA Support is enabled",
"type": "boolean"
},
"auth_plmnIdentifierEnabled": {
"description": "Indicate if Configure PLMN identifier is enabled",
"type": "boolean"
},
"includeUsers": {
"description": "Should also retrieve users or not",
"type": "boolean"
},
"localUser_auditTime": {
"description": "Audit time of local users",
"type": "object",
"properties": {
"start": {
"description": "start time for auditTime",
"type": "number"
},
"end": {
"description": "end time for auditTime",
"type": "number"
},
"interval": {
"description": "time interval in second",
"type": "number"
}
}
},
"localUser_firstName": {
"description": "First name of local users",
"type": "string"
},
"localUser_lastName": {
"description": "Last name of local users",
"type": "string"
},
"localUser_mailAddress": {
"description": "Mail address of local users",
"type": "string"
},
"localUser_primaryPhoneNumber": {
"description": "Primary phone number of local users",
"type": "string"
},
"localUser_displayName": {
"description": "Display name of local users",
"type": "string"
},
"localUser_userName": {
"description": "User name of local users",
"type": "string"
},
"localUser_userSource": {
"description": "User source of local users",
"type": "string"
},
"localUser_subscriberType": {
"description": "Subscriber type of local users",
"type": "string"
},
"localUser_status": {
"description": "Status of local users",
"type": "string"
},
"guestPass_displayName": {
"description": "Display name of guest pass",
"type": "string"
},
"guestPass_expiration": {
"description": "Expiration time of guest pass",
"type": "object",
"properties": {
"start": {
"description": "start time of expiration",
"type": "number"
},
"end": {
"description": "end time of expiration",
"type": "number"
},
"interval": {
"description": "time interval in second",
"type": "number"
}
}
},
"guestPass_wlan": {
"description": "WLAN which used by quest pass",
"type": "string"
}
}
},
"extraTimeRange": {
"type": "object",
"additionalProperties": false,
"properties": {
"start": {
"description": "start time for collecting data",
"type": "number"
},
"end": {
"description": "end time for collecting data",
"type": "number"
},
"interval": {
"description": "time interval in second",
"type": "number"
},
"field": {
"description": "time field for collecting data",
"enum": [
"insertionTime"
]
}
},
"description": "Specified data time range of selection"
},
"fullTextSearch": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"description": "Search logic operator",
"enum": [
"AND",
"OR"
]
},
"value": {
"description": "Text or number to search",
"type": "string"
},
"fields": {
"description": "Specific fields to search",
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Specified search string"
},
"attributes": {
"description": "Get specific columns only",
"type": "array",
"items": {
"type": "string"
}
},
"sortInfo": {
"description": "About sorting",
"type": "object",
"additionalProperties": false,
"properties": {
"sortColumn": {
"type": "string"
},
"dir": {
"enum": [
"ASC",
"DESC"
]
}
}
},
"page": {
"description": "Page number to get",
"type": "integer",
"minimum": 1
},
"limit": {
"description": "Data offset",
"type": "integer",
"minimum": 1
},
"expandDomains": {
"description": "Whether to expand domains into sub domains/ zones or not",
"type": "boolean"
},
"criteria": {
"description": "Add backward compatibility for UI framework",
"type": "string"
},
"query": {
"description": "Add backward compatibility for UI framework",
"type": "string"
}
}
}