feat: Add gNMI discovery CLI tools for YANG path exploration #21

Merged
Damien merged 6 commits from feat-discoverytools into main 2026-01-07 12:00:05 +00:00
Showing only changes of commit 8e460225c2 - Show all commits

View File

@@ -8,15 +8,15 @@ This document provides the complete reference of validated gNMI YANG paths for m
## Quick Reference
| Feature | Model Type | Config | State | Subscribe ON_CHANGE |
|---------|------------|--------|-------|---------------------|
| Interfaces | OpenConfig | ✅ | ✅ | ✅ |
| Loopbacks | OpenConfig | ✅ | ✅ | ✅ |
| VLANs | OpenConfig | ✅ | ✅ | ✅ |
| BGP | OpenConfig | ✅ | ✅ | ✅ |
| VXLAN | Arista Exp | ✅ | ✅ | ✅ |
| MLAG | Arista Exp | ✅ | ❌ | N/A |
| EVPN | Arista Exp | ✅ | ❌ | N/A |
| Feature | Model Type | Config | State | Subscribe ON_CHANGE |
| ---------- | ---------- | ------ | ----- | ------------------- |
| Interfaces | OpenConfig | ✅ | ✅ | ✅ |
| Loopbacks | OpenConfig | ✅ | ✅ | ✅ |
| VLANs | OpenConfig | ✅ | ✅ | ✅ |
| BGP | OpenConfig | ✅ | ✅ | ✅ |
| VXLAN | Arista Exp | ✅ | ✅ | ✅ |
| MLAG | Arista Exp | ✅ | ❌ | N/A |
| EVPN | Arista Exp | ✅ | ❌ | N/A |
---
@@ -24,15 +24,15 @@ This document provides the complete reference of validated gNMI YANG paths for m
**Model**: `openconfig-interfaces`
| Operation | Path |
|-----------|------|
| All interfaces | `/interfaces/interface` |
| Specific interface | `/interfaces/interface[name=Ethernet1]` |
| Interface config | `/interfaces/interface[name=Ethernet1]/config` |
| Interface state | `/interfaces/interface[name=Ethernet1]/state` |
| Oper status only | `/interfaces/interface[name=Ethernet1]/state/oper-status` |
| Admin status only | `/interfaces/interface[name=Ethernet1]/state/admin-status` |
| Interface counters | `/interfaces/interface[name=Ethernet1]/state/counters` |
| Operation | Path |
| ------------------ | ---------------------------------------------------------- |
| All interfaces | `/interfaces/interface` |
| Specific interface | `/interfaces/interface[name=Ethernet1]` |
| Interface config | `/interfaces/interface[name=Ethernet1]/config` |
| Interface state | `/interfaces/interface[name=Ethernet1]/state` |
| Oper status only | `/interfaces/interface[name=Ethernet1]/state/oper-status` |
| Admin status only | `/interfaces/interface[name=Ethernet1]/state/admin-status` |
| Interface counters | `/interfaces/interface[name=Ethernet1]/state/counters` |
### Example: Get Interface State
@@ -55,11 +55,11 @@ gnmic -a 172.16.0.50:6030 -u admin -p admin --insecure \
**Model**: `openconfig-interfaces`
| Operation | Path |
|-----------|------|
| Loopback0 | `/interfaces/interface[name=Loopback0]` |
| Loopback1 (VTEP) | `/interfaces/interface[name=Loopback1]` |
| Loopback config | `/interfaces/interface[name=Loopback0]/config` |
| Operation | Path |
| ---------------- | ---------------------------------------------- |
| Loopback0 | `/interfaces/interface[name=Loopback0]` |
| Loopback1 (VTEP) | `/interfaces/interface[name=Loopback1]` |
| Loopback config | `/interfaces/interface[name=Loopback0]/config` |
---
@@ -67,12 +67,12 @@ gnmic -a 172.16.0.50:6030 -u admin -p admin --insecure \
**Model**: `openconfig-network-instance`, `openconfig-vlan`
| Operation | Path |
|-----------|------|
| All VLANs | `/network-instances/network-instance[name=default]/vlans/vlan` |
| Specific VLAN | `/network-instances/network-instance[name=default]/vlans/vlan[vlan-id=40]` |
| VLAN config | `/network-instances/network-instance[name=default]/vlans/vlan[vlan-id=40]/config` |
| SVI interface | `/interfaces/interface[name=Vlan40]` |
| Operation | Path |
| ------------- | --------------------------------------------------------------------------------- |
| All VLANs | `/network-instances/network-instance[name=default]/vlans/vlan` |
| Specific VLAN | `/network-instances/network-instance[name=default]/vlans/vlan[vlan-id=40]` |
| VLAN config | `/network-instances/network-instance[name=default]/vlans/vlan[vlan-id=40]/config` |
| SVI interface | `/interfaces/interface[name=Vlan40]` |
---
@@ -88,18 +88,18 @@ gnmic -a 172.16.0.50:6030 -u admin -p admin --insecure \
### Paths
| Operation | Path (relative to base) |
|-----------|-------------------------|
| BGP global config | `/global/config` |
| BGP global state | `/global/state` |
| Router ID | `/global/config/router-id` |
| AS number | `/global/config/as` |
| All neighbors | `/neighbors/neighbor` |
| Specific neighbor | `/neighbors/neighbor[neighbor-address=10.0.1.0]` |
| Neighbor state | `/neighbors/neighbor[neighbor-address=10.0.1.0]/state` |
| Neighbor session state | `/neighbors/neighbor[neighbor-address=10.0.1.0]/state/session-state` |
| IPv4 Unicast AFI | `/neighbors/neighbor[neighbor-address=10.0.1.0]/afi-safis/afi-safi[afi-safi-name=IPV4_UNICAST]` |
| EVPN AFI | `/neighbors/neighbor[neighbor-address=10.0.1.0]/afi-safis/afi-safi[afi-safi-name=L2VPN_EVPN]` |
| Operation | Path (relative to base) |
| ---------------------- | ----------------------------------------------------------------------------------------------- |
| BGP global config | `/global/config` |
| BGP global state | `/global/state` |
| Router ID | `/global/config/router-id` |
| AS number | `/global/config/as` |
| All neighbors | `/neighbors/neighbor` |
| Specific neighbor | `/neighbors/neighbor[neighbor-address=10.0.1.0]` |
| Neighbor state | `/neighbors/neighbor[neighbor-address=10.0.1.0]/state` |
| Neighbor session state | `/neighbors/neighbor[neighbor-address=10.0.1.0]/state/session-state` |
| IPv4 Unicast AFI | `/neighbors/neighbor[neighbor-address=10.0.1.0]/afi-safis/afi-safi[afi-safi-name=IPV4_UNICAST]` |
| EVPN AFI | `/neighbors/neighbor[neighbor-address=10.0.1.0]/afi-safis/afi-safi[afi-safi-name=L2VPN_EVPN]` |
### Example: Get All BGP Neighbors State
@@ -123,17 +123,17 @@ gnmic -a 172.16.0.50:6030 -u admin -p admin --insecure \
**Model**: `arista-exp-eos-vxlan` (augments `openconfig-interfaces`)
| Operation | Path |
|-----------|------|
| VXLAN interface | `/interfaces/interface[name=Vxlan1]` |
| VXLAN augment | `/interfaces/interface[name=Vxlan1]/arista-vxlan` |
| VXLAN config | `/interfaces/interface[name=Vxlan1]/arista-vxlan/config` |
| VXLAN state | `/interfaces/interface[name=Vxlan1]/arista-vxlan/state` |
| Source interface | `/interfaces/interface[name=Vxlan1]/arista-vxlan/config/src-ip-intf` |
| UDP port | `/interfaces/interface[name=Vxlan1]/arista-vxlan/config/udp-port` |
| All VLAN-to-VNI mappings | `/interfaces/interface[name=Vxlan1]/arista-vxlan/vlan-to-vnis` |
| Specific VNI mapping | `/interfaces/interface[name=Vxlan1]/arista-vxlan/vlan-to-vnis/vlan-to-vni[vlan=40]` |
| VRF-to-VNI (L3 VNI) | `/interfaces/interface[name=Vxlan1]/arista-vxlan/vrf-to-vnis` |
| Operation | Path |
| ------------------------ | ----------------------------------------------------------------------------------- |
| VXLAN interface | `/interfaces/interface[name=Vxlan1]` |
| VXLAN augment | `/interfaces/interface[name=Vxlan1]/arista-vxlan` |
| VXLAN config | `/interfaces/interface[name=Vxlan1]/arista-vxlan/config` |
| VXLAN state | `/interfaces/interface[name=Vxlan1]/arista-vxlan/state` |
| Source interface | `/interfaces/interface[name=Vxlan1]/arista-vxlan/config/src-ip-intf` |
| UDP port | `/interfaces/interface[name=Vxlan1]/arista-vxlan/config/udp-port` |
| All VLAN-to-VNI mappings | `/interfaces/interface[name=Vxlan1]/arista-vxlan/vlan-to-vnis` |
| Specific VNI mapping | `/interfaces/interface[name=Vxlan1]/arista-vxlan/vlan-to-vnis/vlan-to-vni[vlan=40]` |
| VRF-to-VNI (L3 VNI) | `/interfaces/interface[name=Vxlan1]/arista-vxlan/vrf-to-vnis` |
### Example: Get VXLAN VNI Mappings
@@ -159,22 +159,22 @@ gnmic -a 172.16.0.50:6030 -u admin -p admin --insecure \
> ⚠️ **Limitation**: Only configuration is exposed via gNMI. Operational state (peer status, role, negotiation) requires eAPI.
| Operation | Path |
|-----------|------|
| Full MLAG | `/arista/eos/mlag` |
| Operation | Path |
| ----------- | ------------------------- |
| Full MLAG | `/arista/eos/mlag` |
| MLAG config | `/arista/eos/mlag/config` |
### Config Fields
| Field | Description |
|-------|-------------|
| `domain-id` | MLAG domain identifier |
| `local-intf` | Local VLAN interface (e.g., Vlan4090) |
| `peer-address` | MLAG peer IP address |
| `peer-link-intf` | Peer-link port-channel |
| `dual-primary-action` | Action on dual-primary detection |
| `dual-primary-detection-delay` | Detection delay in seconds |
| `heartbeat-peer-address` | Heartbeat peer IP and VRF |
| Field | Description |
| ------------------------------ | ------------------------------------- |
| `domain-id` | MLAG domain identifier |
| `local-intf` | Local VLAN interface (e.g., Vlan4090) |
| `peer-address` | MLAG peer IP address |
| `peer-link-intf` | Peer-link port-channel |
| `dual-primary-action` | Action on dual-primary detection |
| `dual-primary-detection-delay` | Detection delay in seconds |
| `heartbeat-peer-address` | Heartbeat peer IP and VRF |
### Example: Get MLAG Config
@@ -200,22 +200,22 @@ curl -X POST https://switch/command-api \
> ⚠️ **Limitation**: Only configuration is exposed via gNMI. Learned routes and MACs require eAPI.
| Operation | Path |
|-----------|------|
| All EVPN | `/arista/eos/evpn` |
| EVPN instances | `/arista/eos/evpn/evpn-instances` |
| Operation | Path |
| ----------------- | -------------------------------------------------------- |
| All EVPN | `/arista/eos/evpn` |
| EVPN instances | `/arista/eos/evpn/evpn-instances` |
| Specific instance | `/arista/eos/evpn/evpn-instances/evpn-instance[name=40]` |
### Config Fields
| Field | Path |
|-------|------|
| Name | `.../evpn-instance[name=X]/config/name` |
| Field | Path |
| ------------------- | ------------------------------------------------------ |
| Name | `.../evpn-instance[name=X]/config/name` |
| Route Distinguisher | `.../evpn-instance[name=X]/config/route-distinguisher` |
| Redistribute | `.../evpn-instance[name=X]/config/redistribute` |
| Redistribute | `.../evpn-instance[name=X]/config/redistribute` |
| Route Target Import | `.../evpn-instance[name=X]/route-target/config/import` |
| Route Target Export | `.../evpn-instance[name=X]/route-target/config/export` |
| VLANs | `.../evpn-instance[name=X]/vlans/vlan` |
| VLANs | `.../evpn-instance[name=X]/vlans/vlan` |
### Example: Get EVPN Config
@@ -230,12 +230,12 @@ gnmic -a 172.16.0.50:6030 -u admin -p admin --insecure \
**Model**: `openconfig-interfaces`, `openconfig-if-aggregate`
| Operation | Path |
|-----------|------|
| Port-Channel interface | `/interfaces/interface[name=Port-Channel999]` |
| LAG config | `/interfaces/interface[name=Port-Channel999]/aggregation/config` |
| LAG state | `/interfaces/interface[name=Port-Channel999]/aggregation/state` |
| Member interfaces | `/interfaces/interface[name=Ethernet1]/ethernet/config/aggregate-id` |
| Operation | Path |
| ---------------------- | -------------------------------------------------------------------- |
| Port-Channel interface | `/interfaces/interface[name=Port-Channel999]` |
| LAG config | `/interfaces/interface[name=Port-Channel999]/aggregation/config` |
| LAG state | `/interfaces/interface[name=Port-Channel999]/aggregation/state` |
| Member interfaces | `/interfaces/interface[name=Ethernet1]/ethernet/config/aggregate-id` |
---