- Add GraphQL query vrf_intent.gql: queries InfraVRFDeviceAssignment by device name, returning device-specific RD, VRF attributes (name, description, l3vni), and both device-level and VRF-level import/export route targets for fallback logic - Add Jinja2 template vrf_yang.j2: renders a JSON array of VRF config objects with RD fallback (device → VRF-level) and RT merge logic (device-level if present, otherwise VRF-level); all optional relationships guarded with 'is defined and is not none' checks - Update .infrahub.yml: register vrf_intent query and vrf_yang_transform - Add unit test fixtures for leaf3: input.json (mock GraphQL response) and output.json (expected rendered JSON array) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16 lines
293 B
JSON
16 lines
293 B
JSON
[
|
|
{
|
|
"description": "VRF gold - L3 VXLAN with symmetric IRB",
|
|
"export_targets": [
|
|
"1:100001"
|
|
],
|
|
"import_targets": [
|
|
"1:100001"
|
|
],
|
|
"l3vni": 100001,
|
|
"redistribute_connected": true,
|
|
"route_distinguisher": "10.0.250.13:1",
|
|
"vrf_name": "gold"
|
|
}
|
|
]
|