cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
287
Views
5
Helpful
1
Replies
Jeremy Halcomb
Beginner

Yang MAC Address 'matm-oper' Filter

Using Postman, I am able to pull down the MAC address table of a Catalyst 9200 with this URL: https://1.1.1.1/restconf/data/Cisco-IOS-XE-matm-oper:matm-oper-data/matm-table

 

The results look like:

 

{
  "Cisco-IOS-XE-matm-oper:matm-table": [
    {
      "table-type": "mat-vlan",
      "vlan-id-number": 1,
      "aging-time": 300,
      "matm-mac-entry": [
        {
          "table-type": "mat-vlan",
          "vlan-id-number": 1,
          "mac": "11:11:11:22:22:22",
          "mat-addr-type": "dynamic",
          "port": "Te1/1/4"
        },
        {
          "table-type": "mat-vlan",
          "vlan-id-number": 1,
          "mac": "11:22:33:22:33:11",
          "mat-addr-type": "dynamic",
          "port": "Te1/1/4"
        },
        {
          "table-type": "mat-vlan",
          "vlan-id-number": 1,
          "mac": "00:00:00:11:11:11",
          "mat-addr-type": "dynamic",
          "port": "Te1/1/4"
        },...

 

 

How would I add a filter to only receive back only a single result, say I know the MAC address and want to use it as a filter?

 

The YANG model looks like this:

 

module: Cisco-IOS-XE-matm-oper
  +--ro matm-oper-data
     +--ro matm-table* [table-type vlan-id-number]
        +--ro aging-time?       uint32
        +--ro matm-mac-entry* [table-type vlan-id-number mac]
        |  +--ro mat-addr-type?    matm-ios-xe-oper:e-matm-addr-type
        |  +--ro port?             string
        |  +--ro vlan-all?         empty
        |  +--ro table-type        matm-ios-xe-oper:e-matm-table-type
        |  +--ro vlan-id-number    uint32
        |  +--ro mac               yang:mac-address
        +--ro table-type        matm-ios-xe-oper:e-matm-table-type
        +--ro vlan-id-number    uint32

 

 

I have tried:

https://1.1.1.1/restconf/data/Cisco-IOS-XE-matm-oper:matm-oper-data/matm-table/mac=00:11:22:33:44:55

https://1.1.1.1/restconf/data/Cisco-IOS-XE-matm-oper:matm-oper-data/matm-table/matm-mac-entry

https://1.1.1.1/restconf/data/Cisco-IOS-XE-matm-oper:matm-oper-data/matm-table/matm-mac-entry/mac=00:11:22:33:44:55

and 1000 other combinations.

 

Thanks!!

1 REPLY 1
yangorelik
Participant

Hello Jeremy

The node matm-table is a list with keys table-type and vlan-id-number. The list matm-mac-entry also has 3 keys: table-type, vlan-id-number, mac. Therefore, in order to get single entry, you need to specify all of the keys in the query. Example:

https://1.1.1.1/restconf/data/Cisco-IOS-XE-matm-oper:matm-oper-data/matm-table/table-type=mat-vlan&vlan-id-number=1/matm-mac-entry/table-type=mat-vlan&vlan-id-number=1&mac=00:11:22:33:44:55

 

Yan Gorelik
YDK Solutions
Content for Community-Ad