diff --git a/templates/cisco_nxos_show_ip_community-list.template b/templates/cisco_nxos_show_ip_community-list.template new file mode 100644 index 0000000000..7535e7ce52 --- /dev/null +++ b/templates/cisco_nxos_show_ip_community-list.template @@ -0,0 +1,19 @@ +Value Required,Filldown TYPE (Standard|Expanded) +Value Required,Filldown NAME (\S+) +Value Required SEQ (\d+) +Value Required ACTION (permit|deny) +Value List AS (\d+) +Value List TAG (\d+) +Value COMMUNITY (\D+) + +Start + ^${TYPE}\s+Community\s+List\s+${NAME}\s*$$ + ^\s+${SEQ}\s+${ACTION}\s+\"*${AS}:${TAG}\"* -> Continue + ^\s+\d+\s+(?:permit|deny)\s+\"*\d+:\d+\"*\s+\"*${AS}:${TAG}\"* -> Continue + ^\s+\d+\s+(?:permit|deny)\s+(?:\"*\d+:\d+\"*\s+){2}\"*${AS}:${TAG}\"* -> Continue + ^\s+\d+\s+(?:permit|deny)\s+(?:\"*\d+:\d+\"*\s+){3}\"*${AS}:${TAG}\"* -> Continue + ^\s+.+\"*\d+:\d+\"*\s+${COMMUNITY}\s*$$ -> Continue + ^\s+${SEQ}\s+${ACTION}\s+${COMMUNITY}\s*$$ -> Continue + ^\s+ -> Record + ^$$ + ^.*$$ -> Error diff --git a/templates/index b/templates/index index 6faf62273e..57eab8ed92 100644 --- a/templates/index +++ b/templates/index @@ -160,6 +160,7 @@ cisco_nxos_show_ipv6_interface_brief.template, .*, cisco_nxos, sh[[ow]] ipv[[6]] cisco_nxos_show_port-channel_summary.template, .*, cisco_nxos, sh[[ow]] po[[rt-channel]] sum[[mary]] cisco_nxos_show_cts_interface_brief.template, .*, cisco_nxos, sh[[ow]] cts inte[[rface]] br[[ief]] cisco_nxos_show_cts_interface_all.template, .*, cisco_nxos, sh[[ow]] ct[[s]] inter[[face]] al[[l]] +cisco_nxos_show_ip_community-list.template, .*, cisco_nxos, sh[[ow]] ip comm[[unity-list]] cisco_nxos_show_mac_address-table.template, .*, cisco_nxos, sh[[ow]] m[[ac]] addr[[ess-table]] cisco_nxos_show_interface_status.template, .*, cisco_nxos, sh[[ow]] int[[erface]] st[[atus]] cisco_nxos_show_ip_bgp_neighbors.template, .*, cisco_nxos, sh[[ow]] ip bgp nei[[ghbors]] diff --git a/tests/cisco_nxos/show_ip_community-list/cisco_nxos_show_ip_community-list.parsed b/tests/cisco_nxos/show_ip_community-list/cisco_nxos_show_ip_community-list.parsed new file mode 100644 index 0000000000..ea081cfb27 --- /dev/null +++ b/tests/cisco_nxos/show_ip_community-list/cisco_nxos_show_ip_community-list.parsed @@ -0,0 +1,44 @@ +--- +parsed_sample: + - type: "Expanded" + name: "ROUTES_CL1" + seq: '1' + action: "permit" + as: ["11111"] + tag: ["10000"] + community: "" + - type: "Standard" + name: "ROUTES_CL2" + seq: '1' + action: "permit" + as: ["11111"] + tag: ["10000"] + community: "" + - type: "Standard" + name: "ROUTES_CL2" + seq: '2' + action: "permit" + as: ["22222"] + tag: ["10000"] + community: "" + - type: "Standard" + name: "ROUTES_CL2" + seq: '3' + action: "permit" + as: ["33333"] + tag: ["10000"] + community: "" + - type: "Standard" + name: "ROUTES_CL2" + seq: '4' + action: "permit" + as: ["44444", "55555"] + tag: ["10000", "10005"] + community: "no-export" + - type: "Standard" + name: "ROUTES_CL2" + seq: '5' + action: "deny" + as: [] + tag: [] + community: "internet" diff --git a/tests/cisco_nxos/show_ip_community-list/cisco_nxos_show_ip_community-list.raw b/tests/cisco_nxos/show_ip_community-list/cisco_nxos_show_ip_community-list.raw new file mode 100644 index 0000000000..5ceec09d0c --- /dev/null +++ b/tests/cisco_nxos/show_ip_community-list/cisco_nxos_show_ip_community-list.raw @@ -0,0 +1,8 @@ +Expanded Community List ROUTES_CL1 + 1 permit "11111:10000" +Standard Community List ROUTES_CL2 + 1 permit 11111:10000 + 2 permit 22222:10000 + 3 permit 33333:10000 + 4 permit 44444:10000 55555:10005 no-export + 5 deny internet