<template name="bgp_neighbors" results="per_template">
<doc>
Getter template to parse inventory for network devices. Designed to work with 
[Network Automation Fabric](https://docs.norfablabs.com/) 
[Nornir Service](https://docs.norfablabs.com/workers/nornir/services_nornir_service/) 
[parse TTP task](https://docs.norfablabs.com/workers/nornir/services_nornir_service_tasks_parse/)

Supported platforms:

- Arista EOS
- Juniper Junos
- Cisco IOS XR

Returns normalized list of dictionaries, each dictionary has these keys:

- `name` - unique neighbor identifier composed as `vrf_remote_address`
- `vrf` - VRF the BGP session belongs to
- `state` - BGP session state (idle, connect, active, opensent, openconfirm, established)
- `peering_type` - peering relationship type: `external` or `internal`
- `remote_address` - IP address of the remote BGP peer
- `remote_as` - AS number of the remote peer
- `local_address` - local BGP update-source IP address
- `local_as` - local AS number
- `local_interface` - local interface used for the BGP session
- `router_id` - router ID of the remote peer
- `peer_group` - BGP peer-group name the neighbor belongs to, or `null`
- `description` - neighbor description string, or `null`
- `hold_time` - negotiated BGP hold-time in seconds
- `keepalive` - negotiated BGP keepalive interval in seconds
- `uptime` - session uptime in seconds (time since last transition to Established)
- `max_ttl` - maximum TTL hops configured (relevant for eBGP multihop)
- `afi` - list of IANA AFI/SAFI names negotiated for this session (e.g. `ipv4_unicast`, `l2vpn_evpn`)
- `import_policies` - inbound route-map name, or `null` if none configured
- `export_policies` - outbound route-map name, or `null` if none configured
- `prefix_list_in` - inbound prefix-list name, or `null` if none configured
- `prefix_list_out` - outbound prefix-list name, or `null` if none configured
- `afi_prefixes_sent` - number of prefixes advertised for each negotiated AFI/SAFI (e.g. `ipv4_unicast_prefixes_sent`)
- `afi_prefixes_received` - number of prefixes received for each negotiated AFI/SAFI (e.g. `ipv4_unicast_prefixes_received`)

</doc>

<extend template="ttp://platform/arista_eos_show_ip_bgp_neighbors_vrf_all_pipe_json.txt"/>

<extend template="ttp://platform/juniper_junos_show_bgp_neighbor_pipe_display_json.txt"/>

<extend template="ttp://platform/cisco_xr_show_bgp_neighbors.txt"/>

</template>