YangModels / yang

YANG modules from standards organizations such as the IETF, The IEEE, The Metro Ethernet Forum, open source such as Open Daylight or vendor specific modules
1.51k stars 1.19k forks source link

Cisco-IOS-XR-um-router-bgp-cfg presence containers such as advertise-as-vpn don't work #1506

Open JonasKs opened 10 months ago

JonasKs commented 10 months ago

Hi, Tested on 771.

The advertise-as-vpn presence containers cannot be fetched with gNMI/NETCONF using the UM Cisco-IOS-XR-um-router-bgp-cfg.yang.

❯ gnmic -a <ip:port> --insecure get --path "/Cisco-IOS-XR-um-vrf-cfg:vrfs/vrf/address-family/ipv4/unicast/Cisco-IOS-XR-um-router-bgp-cfg:import/from/vrf" -e json_ietf
[
  {
    "source": "10.242.0.33:4126",
    "timestamp": 1700253262950613603,
    "time": "2023-11-17T21:34:22.950613603+01:00",
    "updates": [
      {
        "Path": "Cisco-IOS-XR-um-vrf-cfg:vrfs/vrf/address-family/ipv4/unicast/Cisco-IOS-XR-um-router-bgp-cfg:import/from/vrf",
        "values": {
          "Cisco-IOS-XR-um-vrf-cfg:vrfs/vrf/address-family/ipv4/unicast/Cisco-IOS-XR-um-router-bgp-cfg:import/from/vrf": null
        }
      }
    ]
  }
] 

Getting the VRF directly:

{
  "path": [
    {
      "origin": "Cisco-IOS-XR-um-vrf-cfg",
      "elem": [
        {
          "name": "vrfs"
        },
        {
          "name": "vrf",
          "key": {
            "vrf-name": "adsfg"
          }
        },
        {
          "name": "address-family"
        }
      ]
    }
  ],
  "encoding": "JSON_IETF"
}

returns

{
  "ipv4": {
    "unicast": {
      "Cisco-IOS-XR-um-router-bgp-cfg:import": {
        "route-policy": "my-route-policy"
      }
    }
  }
} 

even though the configuration is:

RP/0/RP0/CPU0:iosxr-golang-1(config-vrf)#do sh run vrf adsfg
Fri Nov 17 20:39:55.888 UTC
vrf adsfg
 description adsf
 address-family ipv4 unicast
  import route-policy my-route-policy
  import from vrf advertise-as-vpn
 ! 

The normal, non UM interface, Cisco-IOS-XR-ipv4-bgp-cfg.yang exposes the same setting, advertise-as-vpn as a leaf instead of a presence container, and works as expected:

{
  "path": [
    {
      "origin": "Cisco-IOS-XR-infra-rsi-cfg",
      "elem": [
        {
          "name": "vrfs"
        },
        {
          "name": "vrf",
          "key": {
            "vrf-name": "adsfg"
          }
        },
        {
          "name": "afs"
        },
        {
          "name": "af",
          "key": {
            "saf-name": "unicast",
            "af-name": "ipv4"
          }
        },
        {
          "name": "Cisco-IOS-XR-ipv4-bgp-cfg:bgp"
        }
      ]
    }
  ],
  "encoding": "JSON_IETF"
}

returns:

{
  "import-route-policy": "my-route-policy",
  "import-vrf-options": {
    "advertise-as-vpn": true,
    "import-allow-backup": false,
    "import-allow-best-external": false
  }
}
einarnn commented 9 months ago

@JonasKs I've passed this on to Cisco's XR team.

ncorran commented 9 months ago

See https://endets.cisco.com/CSCwi30182 and https://endets.cisco.com/CSCwi38914