Orderby

The $orderby system query option specifies the order in which items are returned from the NFA OData service. The value of the $orderby system query option contains a comma-separated list of expressions whose result are used to sort the items. The expression can include a suffix 'asc' for ascending or 'desc' for descending, separated from the property name by one or more spaces. If asc or desc is not specified, the service must order by the specified property in ascending order. You can order the entities based on different harvesters. You can also use the order by with the Expand operation.
nfa1000
The $orderby system query option specifies the order in which items are returned from the NFA OData service. The value of the $orderby system query option contains a comma-separated list of expressions whose result are used to sort the items. The expression can include a suffix 'asc' for ascending or 'desc' for descending, separated from the property name by one or more spaces. If asc or desc is not specified, the service must order by the specified property in ascending order. You can order the entities based on different harvesters. You can also use the order by with the Expand operation.
Resource URL
http://<nfa odata host>:<nfa odata port>/odata/api/<EntityType Name>?$orderby=<Property Name 1>, <Property Name 2>
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.
Property Name 1, Property Name 2
Indicates the property of a given Entity type.
For more information about list of valid Property Name, see Metadata.
Sample Request
This example displays list of
availableInterfaces
entity data
orderby
ifIndex
property.
http://127.0.0.1:8981/odata/api/availableInterfaces?$orderby=ifIndex
Sample Response
{
"@odata.context": "$metadata#availableInterfaces",
"value": [
{
"ID": 1,
"routerId": 1500001,
"name": "10.0.9.20",
"description": "10.0.9.20",
"speed": 0,
"ifMapId": 1,
"ifIndex": 1,
"ifDescr": "Interface 1",
"ifType": 1,
"ifName": "",
"portName": "",
"vrfName": "",
"ifAlias": "",
"UpdatedOn": 1542306911,
"enabled": "N",
"LastFlow": 1541996116,
"IpAddr": null
},
{
"ID": 7,
"routerId": 1500002,
"name": "10.5.0.29",
"description": "10.5.0.29",
"speed": 0,
"ifMapId": 1,
"ifIndex": 5,
"ifDescr": "Interface 5",
"ifType": 1,
"ifName": "",
"portName": "",
"vrfName": "",
"ifAlias": "",
"UpdatedOn": 1542306913,
"enabled": "N",
"LastFlow": 1541996116,
"IpAddr": null
},
{
"ID": 24,
"routerId": 1500003,
"name": "10.0.42.4",
"description": "10.0.42.4",
"speed": 0,
"ifMapId": 1,
"ifIndex": 31,
"ifDescr": "Interface 31",
"ifType": 1,
"ifName": "",
"portName": "",
"vrfName": "",
"ifAlias": "",
"UpdatedOn": 1542306912,
"enabled": "N",
"LastFlow": 1541996116,
"IpAddr": null
}
],
}