0

i am using this module " Cisco-IOS-XR-pfi-im-cmd-oper.yang" to get interface counts (UP , Down , Admin-Down), but i am stuck with symbol *[] , i dont understand what to put inside if there is no keys inside list brackets ,

 +--ro node-type-sets
 |  +--ro node-type-set* []
 |     +--ro node-name?           xr:Node-id
 |     +--ro type-set-name?       Interface-type-set
 |     +--ro interface-summary
 |        +--ro interface-counts
 |        |  +--ro interface-count?              uint32
 |        |  +--ro up-interface-count?           uint32
 |        |  +--ro down-interface-count?         uint32
 |        |  +--ro admin-down-interface-count?   uint32
 |        +--ro interface-type* []
 |           +--ro interface-counts
 |           |  +--ro interface-count?              uint32
 |           |  +--ro up-interface-count?           uint32
 |           |  +--ro down-interface-count?         uint32
 |           |  +--ro admin-down-interface-count?   uint32
 |           +--ro interface-type-name?          string
 |           +--ro interface-type-description?   string 

i figure out this path below , but it still keep tell me is worng

Cisco-IOS-XR-pfi-im-cmd-oper:interfaces/node-type-sets/node-type-set[type-set-name='hardware-interfaces',node-name='0/RP0/CPU0']/interface-summary/interface-type[interface-type-name='IFT_GETHERNET',interface-type-description='GigabitEthernet']/interface-counts

i want to get "interface-counts" when the :

type-set-name='hardware-interfaces' 
node-name='0/RP0/CPU0' 
interface-type-name='IFT_GETHERNET' 
interface-type-description='GigabitEthernet' 

all these info to get specific interface counts for this module

  • Please edit your question to include the actual query you are trying to perform, or provide more context, so it is evident what you are trying to accomplish. – predi Jun 09 '23 at 10:43
  • Ok , the question now edited – Mustafa Hussien Jun 09 '23 at 11:22
  • It is still unclear how you are requesting this data from the server. Are you performing a NETCONF `get`/`get-data` operation with a subtree/XPath filter? Or is this something else entirely? – predi Jun 10 '23 at 07:10
  • I am using MDT telemetry , this path is the filter path inside the XR CISCO device configuration , this path came from YANG model called "Cisco-IOS-XR-pfi-im-cmd-oper.yang" , it is similar to Netconf or it is based on it , thanks – Mustafa Hussien Jun 11 '23 at 06:37

1 Answers1

0

It is unclear what context your path is used in, but I'm assuming you need an instance identifier.

If you need to uniquely identify an instance that is a list without keys or has list ancestors without keys (config false data nodes), you need to follow RFC 7950, Section 9.13..

The syntax for an instance-identifier is a subset of the XPath abbreviated syntax, formally defined by the rule "instance-identifier" in Section 14. It is used to uniquely identify a node in the data tree. Predicates are used only for specifying the values for the key nodes for list entries, a value of a leaf-list entry, or a positional index for a list without keys. For identifying list entries with keys, each predicate consists of one equality test per key, and each key MUST have a corresponding predicate. If a key is of type "empty", it is represented as a zero-length string ("").

There's an example in Section 9.13.4:

     /* instance-identifier for a list entry without keys */
     /ex:stats/ex:port[3]
predi
  • 5,528
  • 32
  • 60
  • i want to get "interface-counts" when the : type-set-name='hardware-interfaces' node-name='0/RP0/CPU0' interface-type-name='IFT_GETHERNET' interface-type-description='GigabitEthernet' all these info to get specific interface counts for this module – Mustafa Hussien Jun 09 '23 at 08:41