"description":"IGP link-state topology (BGP-LS) as a node graph. Scope with the BGP Peer feed, IGP protocol, and AS to keep the graph readable. Edge labels are IGP metric; node rings show Segment Routing capability.",
"rawSql":"SELECT n.hash_id::text AS id,\n CASE WHEN COALESCE(n.name,'') = '' THEN n.igp_router_id ELSE n.name END AS title,\n n.router_id AS mainstat,\n n.protocol::text AS secondarystat,\n n.igp_router_id AS detail__igp_id,\n 'AS ' || n.asn AS detail__asn,\n COALESCE(NULLIF(n.sr_capabilities,''),'none') AS detail__sr_caps,\n CASE WHEN COALESCE(n.sr_capabilities,'') <> '' THEN 1 ELSE 0 END AS arc__sr,\n CASE WHEN COALESCE(n.sr_capabilities,'') = '' THEN 1 ELSE 0 END AS arc__plain\nFROM ls_nodes n\nWHERE n.iswithdrawn = false\n AND n.peer_hash_id = '$peer_hash'\n AND n.protocol::text IN ($protocol)\n AND ($asn = 0 OR n.asn = $asn)\nORDER BY title",
"rawSql":"SELECT l.local_node_hash_id::text || '->' || l.remote_node_hash_id::text AS id,\n l.local_node_hash_id::text AS source,\n l.remote_node_hash_id::text AS target,\n MAX(l.igp_metric)::bigint AS mainstat,\n MAX(l.protocol::text) AS secondarystat,\n MAX(l.te_def_metric)::text AS detail__te_metric,\n MAX(l.max_link_bw)::text AS detail__max_bw\nFROM ls_links l\nJOIN ls_nodes ln ON ln.hash_id = l.local_node_hash_id AND ln.peer_hash_id = l.peer_hash_id\nWHERE l.iswithdrawn = false\n AND l.peer_hash_id = '$peer_hash'\n AND l.protocol::text IN ($protocol)\n AND ($asn = 0 OR ln.asn = $asn)\nGROUP BY l.local_node_hash_id, l.remote_node_hash_id",
"definition":"SELECT __text,__value FROM (select peername as __text, peer_hash_id as __value, count(*) as count from v_ls_nodes group by peername,peer_hash_id) d where count > 0",
"hide":0,
"includeAll":false,
"label":"BGP Peer feed",
"multi":false,
"name":"peer_hash",
"options":[],
"query":"SELECT __text,__value FROM (select peername as __text, peer_hash_id as __value, count(*) as count from v_ls_nodes group by peername,peer_hash_id) d where count > 0",