Cisco Cisco Evolved Programmable Network Manager 2.0 Entwickleranleitung

Seite von 88
 Sorting
 
 
 Cisco Evolved Programmable Network Manager 2.0 RESTCONF NBI Guide 
 84
 
9  Sorting 
Sorting lets you control the order in which resources are returned. They can be sorted in 
Ascending or Descending order based on user preference.  
 
Sorting is enabled using the .sort (attribute_name) query parameter. Sorting is 
supported for all request types. 
 
For example, to sort a list of Devices by their latest collection times, you may use the 
following URL: 
https://<server_name>/restconf/data/v1/epnm-restconf-xmp-im-ext-
managedelement:ManagedElement?.sort(+collectionTime)
  
Ascending vs. Descending 
Ascending or Descending order is controlled by adding a "+" or "-" in front of the 
attribute name. 
 
 
To sort based on collectionTime in ascending order, use the + sign (the default): 
https://<server_name>/restconf/data/v1/epnm-restconf-xmp-im-ext-
managedelement:ManagedElement?.sort(+collectionTime)
  
 
To sort based on collectionTime in descending order, use the – sign: 
https://<server_name>/restconf/data/v1/epnm-restconf-xmp-im-ext-
managedelement:ManagedElement?.sort(-collectionTime)