Top, Skip and Count
The $top system query option indicates the top number of items in the queried collection to be included in the result.
nfa1000
The
$top
system query option indicates the top number of items in the queried collection to be included in the result.The
$skip
system query option indicates the number of items in the queried collection that are to be skipped and not included in the result. You can request a particular page of an item by combining $top
and $skip
.The $count system query option indicates the clients to display a count of the matching resources in the response. The
$count
query option has a Boolean value of true
or false
.- true: Indicates the client to display a count of the matching resources.
- false: Indicates the client not to display a count of the matching resources.
Resource URL
http://<nfa odata host>:<nfa odata port>/odata/api/<EntityType Name>?$top=<value>&$skip=<value>&$count=<value>
Method
GET
Parameters
The following table includes the mandatory parameter.
Parameters | Description |
EntityType Name | Indicates the type of entity. For more information about list of valid EntityType Name, see Metadata. |
Sample Request
This sample API performs the following operations:
- Displays top 3 values of router entity.
- Skips the first value in router entity.
- Displays the total count of matching resources.
http://127.0.0.1:8981/odata/api/routers?$top=3&$skip=1&$count=true
Sample Response
{ "@odata.context": "$metadata#routers", "@odata.count": 3, "value": [ { "ID": 1500002, "routerAddress": "127.0.0.1", "sysDescr": "127.0.0.1", "sysName": "", "deviceName": "127.0.0.1", "deviceAlias": "127.0.0.1", "sysUptime": 0, "lastData": 0, "lastReboot": 1535031377, "lastRefresh": 0, "lastDiscovery": 0, "lastHarvesterUpdate": 0, "firstPollError": 1535031440, "nextPollRetry": 0, "harvesterID": 2, "profileId": 0, "snmpVersion": 2, "snmpPort": 161, "snmpTimeout": 3, "snmpRetry": 3, "snmpMaxRows": 10, "ifNumber": 0, "interfaceCount": 10, "agentCount": 10, "dnsLastLookupTime": 1535373746, "dnsExpireTime": 1535978546, "syncUpdateTime": 0, "routerName": null, "routerUpdatedOn": 1533559103, "templateId": 1, "snmpProxyAddress": "127.0.0.1", "dnsProxyAddress": "127.0.0.1", "tenantId": 8, "domainID": 1 }, { "ID": 1500003, "routerAddress": "127.0.0.1", "sysDescr": "127.0.0.1", "sysName": "", "deviceName": "127.0.0.1", "deviceAlias": "127.0.0.1", "sysUptime": 0, "lastData": 0, "lastReboot": 1535031377, "lastRefresh": 0, "lastDiscovery": 0, "lastHarvesterUpdate": 0, "firstPollError": 1535031440, "nextPollRetry": 0, "harvesterID": 2, "profileId": 0, "snmpVersion": 2, "snmpPort": 161, "snmpTimeout": 3, "snmpRetry": 3, "snmpMaxRows": 10, "ifNumber": 0, "interfaceCount": 10, "agentCount": 10, "dnsLastLookupTime": 1535373746, "dnsExpireTime": 1535978546, "syncUpdateTime": 0, "routerName": null, "routerUpdatedOn": 1533559103, "templateId": 1, "snmpProxyAddress": "127.0.0.1", "dnsProxyAddress": "127.0.0.1", "tenantId": 8, "domainID": 1 }, { "ID": 1500004, "routerAddress": "127.0.0.1", "sysDescr": "127.0.0.1", "sysName": "", "deviceName": "127.0.0.1", "deviceAlias": "127.0.0.1", "sysUptime": 0, "lastData": 0, "lastReboot": 1535031377, "lastRefresh": 0, "lastDiscovery": 0, "lastHarvesterUpdate": 0, "firstPollError": 1535031440, "nextPollRetry": 0, "harvesterID": 2, "profileId": 0, "snmpVersion": 2, "snmpPort": 161, "snmpTimeout": 3, "snmpRetry": 3, "snmpMaxRows": 10, "ifNumber": 0, "interfaceCount": 10, "agentCount": 10, "dnsLastLookupTime": 1535373746, "dnsExpireTime": 1535978546, "syncUpdateTime": 0, "routerName": null, "routerUpdatedOn": 1533559103, "templateId": 1, "snmpProxyAddress": "127.0.0.1", "dnsProxyAddress": "127.0.0.1", "tenantId": 8, "domainID": 1 } ]}