- Add GraphQL query mlag_intent.gql: queries InfraMlagPeerConfig by device name, returning local IP, peer address, heartbeat peer IP, MLAG domain (domain-id, virtual-mac, heartbeat VRF, dual-primary detection settings, peer/iBGP VLANs, peer devices), local interface SVI name, and peer-link LAG name - Add Jinja2 template mlag_yang.j2: renders a JSON object targeting Arista-native YANG path /arista-mlag-augments:mlag/config; returns empty array [] for devices with no MLAG config (spines); all optional relationship accesses guarded with 'is defined and is not none' checks - Update .infrahub.yml: register mlag_intent query and mlag_yang_transform - Add unit test fixtures for leaf1 (full MLAG config) and spine1 (empty response → []) following jinja2-transform-unit-render format Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
97 lines
2.4 KiB
JSON
97 lines
2.4 KiB
JSON
{
|
|
"data": {
|
|
"InfraMlagPeerConfig": {
|
|
"edges": [
|
|
{
|
|
"node": {
|
|
"local_interface_ip": {
|
|
"value": "10.0.199.254/31"
|
|
},
|
|
"peer_address": {
|
|
"value": "10.0.199.255"
|
|
},
|
|
"heartbeat_peer_ip": {
|
|
"value": "172.16.0.50"
|
|
},
|
|
"device": {
|
|
"node": {
|
|
"name": {
|
|
"value": "leaf1"
|
|
}
|
|
}
|
|
},
|
|
"mlag_domain": {
|
|
"node": {
|
|
"domain_id": {
|
|
"value": "leafs-1-2"
|
|
},
|
|
"virtual_mac": {
|
|
"value": "c001.cafe.babe"
|
|
},
|
|
"heartbeat_vrf": {
|
|
"value": "mgmt"
|
|
},
|
|
"dual_primary_detection": {
|
|
"value": true
|
|
},
|
|
"dual_primary_delay": {
|
|
"value": 10
|
|
},
|
|
"dual_primary_action": {
|
|
"value": "errdisable"
|
|
},
|
|
"devices": {
|
|
"edges": [
|
|
{
|
|
"node": {
|
|
"name": {
|
|
"value": "leaf1"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"node": {
|
|
"name": {
|
|
"value": "leaf2"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"peer_vlan": {
|
|
"node": {
|
|
"vlan_id": {
|
|
"value": 4090
|
|
}
|
|
}
|
|
},
|
|
"ibgp_vlan": {
|
|
"node": {
|
|
"vlan_id": {
|
|
"value": 4091
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"local_interface": {
|
|
"node": {
|
|
"name": {
|
|
"value": "Vlan4090"
|
|
}
|
|
}
|
|
},
|
|
"peer_link": {
|
|
"node": {
|
|
"name": {
|
|
"value": "Port-Channel999"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|