From 3625b86d58725fec55ada0bc6d0ee543f5944a07 Mon Sep 17 00:00:00 2001 From: omid Date: Tue, 26 Mar 2024 17:20:48 -0400 Subject: [PATCH 01/11] Releasing v24.3 From 6cd6d759da6928677096839d381af7189e2192db Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Wed, 21 Feb 2024 14:05:00 +0100 Subject: [PATCH 02/11] Extend ShowBgpAddressFamily class to parse additional BGP commands This commit extends the ShowBgpAddressFamily class to include parsing logic for the following additional BGP commands: - show bgp {address_family} community {community} - show bgp {address_family} community {community} {exact_match} The parsing logic ensures that the output format of these new commands aligns with the format of 'show bgp', maintaining compatibility with existing parsing logic. Unit tests have been added to validate the correctness of parsing for the new commands. --- sdk_generator/outputs/github_parser.json | 22 ++++++++++++++++++++++ src/genie/libs/parser/iosxr/show_bgp.py | 17 +++++++++++------ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/sdk_generator/outputs/github_parser.json b/sdk_generator/outputs/github_parser.json index b71b010b89..f5882c7f6c 100644 --- a/sdk_generator/outputs/github_parser.json +++ b/sdk_generator/outputs/github_parser.json @@ -17675,6 +17675,28 @@ } } }, + "show bgp {address_family} community {community}": { + "iosxr": { + "class": "ShowBgpAddressFamily", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n ", + "module_name": "show_bgp", + "package": "genie.libs.parser", + "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", + "uid": "show_bgp_address_family_community_community", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9091" + } + }, + "show bgp {address_family} community {community} {exact_match}": { + "iosxr": { + "class": "ShowBgpAddressFamily", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n ", + "module_name": "show_bgp", + "package": "genie.libs.parser", + "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", + "uid": "show_bgp_address_family_community_community_exact_match", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9091" + } + }, "show bgp {address_family} evi {evi}": { "folders": { "iosxe": { diff --git a/src/genie/libs/parser/iosxr/show_bgp.py b/src/genie/libs/parser/iosxr/show_bgp.py index 2475ddbeed..8695b3ee39 100644 --- a/src/genie/libs/parser/iosxr/show_bgp.py +++ b/src/genie/libs/parser/iosxr/show_bgp.py @@ -9123,15 +9123,20 @@ class ShowBgpAddressFamily(ShowBgpAddressFamilySchema): 'show bgp' 'show bgp {address_family}' ''' + cli_command = [ + 'show bgp', + 'show bgp {address_family}', + 'show bgp {address_family} community {community}', + 'show bgp {address_family} community {community} {exact_match}',] - cli_command = ['show bgp', - 'show bgp {address_family}'] + def cli(self, address_family=None, community=None, exact_match=None, output=None): - def cli(self, address_family=None, output=None): - - # Execute command if output is None: - if address_family: + if address_family and community and exact_match: + command = self.cli_command[3].format(address_family=address_family, community=community, exact_match=exact_match) + elif address_family and community: + command = self.cli_command[2].format(address_family=address_family, community=community) + elif address_family: command = self.cli_command[1].format(address_family=address_family) else: command = self.cli_command[0] From 9c18d3265e8ac165fbe50199f75e9971a0f1f00a Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Fri, 23 Feb 2024 09:14:20 +0100 Subject: [PATCH 03/11] Refactor regex pattern in ShowBgpAddressFamily class Fixed the regex pattern in the ShowBgpAddressFamily class to properly match IPv6 addresses in the prefix field. The previous pattern was missing support for hexadecimal characters. This update ensures accurate parsing of IPv6 addresses. Refactored the regex pattern in the ShowBgpAddressFamily class to improve readability and ensure correct matching of next hop and number fields. Added explicit newline matching for better pattern coverage. This enhances the reliability of parsing BGP address family information. --- src/genie/libs/parser/iosxr/show_bgp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/genie/libs/parser/iosxr/show_bgp.py b/src/genie/libs/parser/iosxr/show_bgp.py index 8695b3ee39..ad529f15cc 100644 --- a/src/genie/libs/parser/iosxr/show_bgp.py +++ b/src/genie/libs/parser/iosxr/show_bgp.py @@ -9130,7 +9130,7 @@ class ShowBgpAddressFamily(ShowBgpAddressFamilySchema): 'show bgp {address_family} community {community} {exact_match}',] def cli(self, address_family=None, community=None, exact_match=None, output=None): - + # Execute command if output is None: if address_family and community and exact_match: command = self.cli_command[3].format(address_family=address_family, community=community, exact_match=exact_match) @@ -9199,8 +9199,8 @@ def cli(self, address_family=None, community=None, exact_match=None, output=None # *>i192.168.111.0/24 10.189.99.98 0 0 i # *> 10.7.7.7/32 10.10.10.107 0 0 65107.65107 ? p11 = re.compile(r'^(?P(i|s|x|S|d|h|\*|\>|\s)+)' - r' *(?P(?P[0-9\.\:\[\]]+)\/(?P\d+))?' - r' +(?P\S+) +(?P[\d\.\s\{\}]+)' + r' *(?P(?P[0-9a-f\.\:\[\]]+)\/(?P\d+))?[\n\r]*' + r' +(?P\S+)[\n\r]* +(?P[\d\.\s\{\}]+)' r'(?: *(?P(i|e|\?)))?$') # Processed 40 prefixes, 50 paths From 7c4980c4fe6bdefcee2cf02813e2d5d8399c2123 Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Mon, 26 Feb 2024 14:33:51 +0100 Subject: [PATCH 04/11] Update regular expressions for iosxr ShowBgpVrf - include IPv6 addresses - handle newline characters --- src/genie/libs/parser/iosxr/show_bgp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/genie/libs/parser/iosxr/show_bgp.py b/src/genie/libs/parser/iosxr/show_bgp.py index ad529f15cc..b42069d9b0 100644 --- a/src/genie/libs/parser/iosxr/show_bgp.py +++ b/src/genie/libs/parser/iosxr/show_bgp.py @@ -8697,8 +8697,8 @@ def cli(self, vrf=None, address_family=None, summary=None, value=None, output=No # *>i192.168.111.0/24 10.189.99.98 0 0 i # *> 10.7.7.7/32 10.10.10.107 0 0 65107.65107 ? p13 = re.compile(r'^(?P(i|s|x|S|d|h|\*|\>|\s)+)' - r' *(?P(?P[0-9\.\:\[\]]+)\/(?P\d+))?' - r' +(?P\S+) +(?P[\d\.\s\{\}]+)' + r' *(?P(?P[0-9a-f\.\:\[\]]+)\/(?P\d+))?[\n\r]*' + r' +(?P\S+)[\n\r]* +(?P[\d\.\s\{\}]+)' r'(?: *(?P(i|e|\?)))?$') # Processed 40 prefixes, 50 paths From 17c85d36c32c270f1d5e71037349fe1a8bb2013a Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Thu, 4 Apr 2024 09:49:50 +0200 Subject: [PATCH 05/11] Upgrade parser.json file with 24.3 release --- sdk_generator/outputs/github_parser.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sdk_generator/outputs/github_parser.json b/sdk_generator/outputs/github_parser.json index f5882c7f6c..867c742fd8 100644 --- a/sdk_generator/outputs/github_parser.json +++ b/sdk_generator/outputs/github_parser.json @@ -17683,7 +17683,7 @@ "package": "genie.libs.parser", "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", "uid": "show_bgp_address_family_community_community", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9091" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } }, "show bgp {address_family} community {community} {exact_match}": { @@ -17694,7 +17694,7 @@ "package": "genie.libs.parser", "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", "uid": "show_bgp_address_family_community_community_exact_match", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9091" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } }, "show bgp {address_family} evi {evi}": { @@ -18227,6 +18227,14 @@ "uid": "show_bgp_address_family_bgp_prefix", "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9491" } + "iosxr": { + "class": "ShowBgpAddressfamilyPrefix", + "doc": "Parser for:\n * 'show bgp {address_family} {bgp_prefix}'\n ", + "module_name": "show_bgp", + "package": "genie.libs.parser", + "schema": "{\n'address_family': {\n Any (str) *: {\n 'prefix': ,\n 'last_modified': ,\n 'paths': {\n 'total_available_paths': ,\n 'best_path': ,\n 'path': {\n Any (str) *: {\n Optional (str) advertised_peer_pe: ,\n Optional (str) advertised_peer_ce: ,\n 'as_path': {\n Any (str) *: {\n 'bgp_peer_neighbor_ip': {\n Any (str) *: {\n Optional (str) metric: ,\n 'origin_neighbors_ip': ,\n 'origin_router_id': ,\n 'bgp_peer_neighbor_ip': ,\n Optional (str) originator: ,\n Optional (str) received_label: ,\n 'origin_metric': ,\n Optional (str) weight: ,\n 'localpref': ,\n 'origin_codes': ,\n 'status_codes': ,\n 'received_path_id': ,\n 'local_path_id': ,\n 'version': ,\n Optional (str) cluster_list: ListOf (type) ,\n Optional (str) source_afi: ,\n Optional (str) source_vrf: ,\n Optional (str) source_rd: ,\n Optional (str) psid_type: {\n Any (str) *: {\n 'psid_type': ,\n 'subtlv_count': ,\n 'subtlv': {\n 't_value': ,\n 'sid_value': ,\n 'behaviour': ,\n 'sstlv_count': ,\n Optional (str) subsubtlv: {\n 't_value': ,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n}", + "uid": "show_bgp_address_family_bgp_prefix", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9496" } }, "show bgp {address_family} {ip_address} bestpath-compare": { From d5cb74fbd8201d7a5fb06a8dddc783c0a2d54030 Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Thu, 4 Apr 2024 10:41:59 +0200 Subject: [PATCH 06/11] Add changelog for changes in ShowBgpAddressFamily class --- ...elog_show_bgp_address_family_iosxr_20240404103239.rst | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 changelog/undistributed/changelog_show_bgp_address_family_iosxr_20240404103239.rst diff --git a/changelog/undistributed/changelog_show_bgp_address_family_iosxr_20240404103239.rst b/changelog/undistributed/changelog_show_bgp_address_family_iosxr_20240404103239.rst new file mode 100644 index 0000000000..3fc40108b0 --- /dev/null +++ b/changelog/undistributed/changelog_show_bgp_address_family_iosxr_20240404103239.rst @@ -0,0 +1,9 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* IOSXR + * Modified ShowBgpAddressFamily: + * New Show Command - show bgp {address_family} community {community} + * New Show Command - show bgp {address_family} community {community} {exact_match} + * Updated regex for handling IPv6 adresses/prefixes + * Updated regex pattern for handling new lines in IPv6 address family output From 211d9279357b7b916fcdb2d51baa21bd1c6aefb4 Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Mon, 29 Apr 2024 13:12:15 +0200 Subject: [PATCH 07/11] Add tests for ShowBgpAddressFamily with arguments --- .../cli/equal/golden_output2_arguments.json | 5 + .../cli/equal/golden_output2_expected.py | 240 ++++++++++++++++++ .../cli/equal/golden_output2_output.txt | 42 +++ 3 files changed, 287 insertions(+) create mode 100644 src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_arguments.json create mode 100644 src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_expected.py create mode 100644 src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_output.txt diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_arguments.json b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_arguments.json new file mode 100644 index 0000000000..8f4a4c6819 --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_arguments.json @@ -0,0 +1,5 @@ +{ + "address_family": "ipv6 all", + "community": "1234:1234", + "exact_match": "exact_match" +} \ No newline at end of file diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_expected.py b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_expected.py new file mode 100644 index 0000000000..dc2c010a7e --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_expected.py @@ -0,0 +1,240 @@ +expected_output = { + 'address_family': { + 'ipv6_all': { + 'bgp_table_version': 5530, + 'generic_scan_interval': 60, + 'local_as': 1234, + 'non_stop_routing': True, + 'nsr_initial_init_ver_status': 'reached', + 'nsr_initial_initsync_version': '7', + 'nsr_issu_sync_group_versions': '5530/0', + 'route_distinguisher': { + '1234:1234': { + 'prefix': { + '2001:0db8:85a3:0:0:0:0:1403::/48': { + 'index': { + 1: { + 'locprf': '0', + 'next_hop': '192.0.2.1', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '0', + 'next_hop': '192.0.2.1', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + '2001:0db8:85a3::/64': { + 'index': { + 1: { + 'locprf': '0', + 'next_hop': '192.0.2.1', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '0', + 'next_hop': '192.0.2.1', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + }, + }, + '1234:2505005': { + 'prefix': { + '2001:0db8:85a3:0:0:0:0:6:10:205::/112': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6:192:168:201::/112': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6:195:113:123:128:0/112': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6:195:113:123:80/125': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6:195:113:123:96:0/112': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6::10/127': { + 'index': { + 1: { + 'locprf': '0', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '0', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + }, + }, + '1234:2505118': { + 'prefix': { + '2001:0db8:85a3:0:0:0:0:18::/56': { + 'index': { + 1: { + 'locprf': '100', + 'next_hop': '203.0.113.7', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '100', + 'next_hop': '203.0.113.7', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:1e08::/48': { + 'index': { + 1: { + 'locprf': '100', + 'next_hop': '203.0.113.7', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '100', + 'next_hop': '203.0.113.7', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + }, + }, + }, + 'router_identifier': '192.168.1.1', + 'scan_interval': 60, + 'table_state': 'active', + }, + }, + } \ No newline at end of file diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_output.txt b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_output.txt new file mode 100644 index 0000000000..9ddc19a9c2 --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_output.txt @@ -0,0 +1,42 @@ +RP/0/RSP0/CPU0:router# show bgp ivp6 all community 1234:1234 exact-match +Address Family: VPNv6 Unicast +----------------------------- + +BGP router identifier 192.168.1.1, local AS number 1234 +BGP generic scan interval 60 secs +Non-stop routing is enabled +BGP table state: Active +Table ID: 0x0 +BGP main routing table version 5530 +BGP NSR Initial initsync version 7 (Reached) +BGP NSR/ISSU Sync-Group versions 5530/0 +BGP scan interval 60 secs + +Status codes: s suppressed, d damped, h history, * valid, > best i - internal, r RIB-failure, S stale, N Nexthop-discard +Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path +Route Distinguisher: 1234:1234 +Route Distinguisher Version: 53 +*>i2001:0db8:85a3::/64 192.0.2.1 0 100 0 i +* i 192.0.2.1 0 100 0 i +*>i2001:0db8:85a3:0:0:0:0:1403::/48 192.0.2.1 0 100 0 i +* i 192.0.2.1 0 100 0 i +Route Distinguisher: 1234:2505005 +Route Distinguisher Version: 54 +*>i2001:0db8:85a3:0:0:0:0:6::10/127 192.0.2.2 0 100 0 i +* i 192.0.2.2 0 100 0 i +*>i2001:0db8:85a3:0:0:0:0:6:195:113:123:80/125 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +*>i2001:0db8:85a3:0:0:0:0:6:10:205::/112 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +*>i2001:0db8:85a3:0:0:0:0:6:192:168:201::/112 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +*>i2001:0db8:85a3:0:0:0:0:6:195:113:123:96:0/112 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +*>i2001:0db8:85a3:0:0:0:0:6:195:113:123:128:0/112 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +Route Distinguisher: 1234:2505118 +Route Distinguisher Version: 49 +*>i2001:0db8:85a3:0:0:0:0:18::/56 203.0.113.7 100 100 0 i +* i 203.0.113.7 100 100 0 i +*>i2001:0db8:85a3:0:0:0:0:1e08::/48 203.0.113.7 100 100 0 i +* i 203.0.113.7 100 100 0 i \ No newline at end of file From e7e03f92dc7b4d0f679b72eec7ea08b749b0a9ab Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Mon, 29 Apr 2024 13:12:46 +0200 Subject: [PATCH 08/11] Add available commands to docs --- sdk_generator/outputs/github_parser.json | 31 +++++++++++++++++++++--- src/genie/libs/parser/iosxr/show_bgp.py | 2 ++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/sdk_generator/outputs/github_parser.json b/sdk_generator/outputs/github_parser.json index 867c742fd8..4d0346b7cd 100644 --- a/sdk_generator/outputs/github_parser.json +++ b/sdk_generator/outputs/github_parser.json @@ -15425,6 +15425,14 @@ "uid": "show_bgp", "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } + "iosxr": { + "class": "ShowBgpAddressFamily", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", + "module_name": "show_bgp", + "package": "genie.libs.parser", + "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", + "uid": "show_bgp", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } }, "show bgp all": { @@ -17477,6 +17485,23 @@ "uid": "show_bgp_address_family", "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } + "iosxe": { + "class": "ShowBgp", + "doc": " Parser for:\n * 'show bgp {address_family} rd {rd}'\n * 'show bgp {address_family} vrf {vrf}'\n * 'show bgp {address_family} unicast'\n ", + "module_name": "show_bgp", + "package": "genie.libs.parser", + "schema": "{\n'vrf': {\n Any (str) *: {\n 'address_family': {\n Any (str) *: {\n Optional (str) bgp_table_version: ,\n Optional (str) route_identifier: ,\n Optional (str) vrf_route_identifier: ,\n Optional (str) route_distinguisher: ,\n Optional (str) default_vrf: ,\n Optional (str) af_private_import_to_address_family: ,\n Optional (str) pfx_count: ,\n Optional (str) pfx_limit: ,\n Optional (str) routes: {\n Optional (Any) Any (str) *: {\n Optional (str) index: {\n Optional (Any) Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) localpref: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n },\n },\n}", + "uid": "show_bgp_address_family", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxe/show_bgp.py#L653" + }, + "iosxr": { + "class": "ShowBgpAddressFamily", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", + "module_name": "show_bgp", + "package": "genie.libs.parser", + "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", + "uid": "show_bgp_address_family", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } }, "show bgp {address_family} all": { @@ -17678,7 +17703,7 @@ "show bgp {address_family} community {community}": { "iosxr": { "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n ", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", "module_name": "show_bgp", "package": "genie.libs.parser", "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", @@ -17689,7 +17714,7 @@ "show bgp {address_family} community {community} {exact_match}": { "iosxr": { "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n ", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", "module_name": "show_bgp", "package": "genie.libs.parser", "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", @@ -18234,7 +18259,7 @@ "package": "genie.libs.parser", "schema": "{\n'address_family': {\n Any (str) *: {\n 'prefix': ,\n 'last_modified': ,\n 'paths': {\n 'total_available_paths': ,\n 'best_path': ,\n 'path': {\n Any (str) *: {\n Optional (str) advertised_peer_pe: ,\n Optional (str) advertised_peer_ce: ,\n 'as_path': {\n Any (str) *: {\n 'bgp_peer_neighbor_ip': {\n Any (str) *: {\n Optional (str) metric: ,\n 'origin_neighbors_ip': ,\n 'origin_router_id': ,\n 'bgp_peer_neighbor_ip': ,\n Optional (str) originator: ,\n Optional (str) received_label: ,\n 'origin_metric': ,\n Optional (str) weight: ,\n 'localpref': ,\n 'origin_codes': ,\n 'status_codes': ,\n 'received_path_id': ,\n 'local_path_id': ,\n 'version': ,\n Optional (str) cluster_list: ListOf (type) ,\n Optional (str) source_afi: ,\n Optional (str) source_vrf: ,\n Optional (str) source_rd: ,\n Optional (str) psid_type: {\n Any (str) *: {\n 'psid_type': ,\n 'subtlv_count': ,\n 'subtlv': {\n 't_value': ,\n 'sid_value': ,\n 'behaviour': ,\n 'sstlv_count': ,\n Optional (str) subsubtlv: {\n 't_value': ,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n}", "uid": "show_bgp_address_family_bgp_prefix", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9496" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9498" } }, "show bgp {address_family} {ip_address} bestpath-compare": { diff --git a/src/genie/libs/parser/iosxr/show_bgp.py b/src/genie/libs/parser/iosxr/show_bgp.py index b42069d9b0..094a347574 100644 --- a/src/genie/libs/parser/iosxr/show_bgp.py +++ b/src/genie/libs/parser/iosxr/show_bgp.py @@ -9122,6 +9122,8 @@ class ShowBgpAddressFamily(ShowBgpAddressFamilySchema): '''Parser for: 'show bgp' 'show bgp {address_family}' + 'show bgp {address_family} community {community}' + 'show bgp {address_family} community {community} {exact_match}' ''' cli_command = [ 'show bgp', From c4c26cf0750181f46838e82d62b697fe96f1d31f Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Tue, 21 May 2024 12:24:26 +0200 Subject: [PATCH 09/11] Recreate Parser json file due to changes with version 24.4 --- sdk_generator/outputs/github_parser.json | 85 +++++++++--------------- 1 file changed, 31 insertions(+), 54 deletions(-) diff --git a/sdk_generator/outputs/github_parser.json b/sdk_generator/outputs/github_parser.json index 4d0346b7cd..20a458c990 100644 --- a/sdk_generator/outputs/github_parser.json +++ b/sdk_generator/outputs/github_parser.json @@ -15415,7 +15415,7 @@ "folders": { "iosxr": { "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n ", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", "module_name": "iosxr.show_bgp", "package": "genie.libs.parser", "schema": "{\n 'address_family': {\n Any('*'): {\n Optional('router_identifier'): str,\n Optional('local_as'): Or (, ),\n Optional('generic_scan_interval'): int,\n Optional('non_stop_routing'): bool,\n Optional('table_state'): str,\n Optional('table_id'): str,\n Optional('rd_version'): int,\n Optional('bgp_table_version'): int,\n Optional('dampening_status'): str,\n Optional('nsr_initial_initsync_version'): str,\n Optional('nsr_issu_sync_group_versions'): str,\n Optional('nsr_initial_init_ver_status'): str,\n Optional('scan_interval'): int,\n Optional('processed_prefix'): int,\n Optional('processed_paths'): int,\n Optional('route_distinguisher'): {\n Any('*'): {\n Optional('default_vrf'): str,\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n },\n },\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n Optional('operation_mode'): str,\n Optional('process'): {\n Any('*'): {\n 'rcvtblver': int,\n 'brib_rib': int,\n 'labelver': int,\n 'importver': int,\n 'sendtblver': int,\n 'standbyver': int,\n },\n },\n Optional('neighbor'): {\n Any('*'): {\n 'remote_as': Or (, ),\n 'tbl_ver': int,\n 'spk': int,\n 'msg_rcvd': int,\n 'msg_sent': int,\n 'input_queue': int,\n 'output_queue': int,\n 'up_down': str,\n 'state_pfxrcd': str,\n },\n },\n },\n },\n}", @@ -15425,14 +15425,6 @@ "uid": "show_bgp", "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } - "iosxr": { - "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", - "module_name": "show_bgp", - "package": "genie.libs.parser", - "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", - "uid": "show_bgp", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } }, "show bgp all": { @@ -15775,7 +15767,7 @@ "os": "iosxr" }, "uid": "show_bgp_dampened-paths", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9806" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9813" } } }, @@ -17475,7 +17467,7 @@ }, "iosxr": { "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n ", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", "module_name": "iosxr.show_bgp", "package": "genie.libs.parser", "schema": "{\n 'address_family': {\n Any('*'): {\n Optional('router_identifier'): str,\n Optional('local_as'): Or (, ),\n Optional('generic_scan_interval'): int,\n Optional('non_stop_routing'): bool,\n Optional('table_state'): str,\n Optional('table_id'): str,\n Optional('rd_version'): int,\n Optional('bgp_table_version'): int,\n Optional('dampening_status'): str,\n Optional('nsr_initial_initsync_version'): str,\n Optional('nsr_issu_sync_group_versions'): str,\n Optional('nsr_initial_init_ver_status'): str,\n Optional('scan_interval'): int,\n Optional('processed_prefix'): int,\n Optional('processed_paths'): int,\n Optional('route_distinguisher'): {\n Any('*'): {\n Optional('default_vrf'): str,\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n },\n },\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n Optional('operation_mode'): str,\n Optional('process'): {\n Any('*'): {\n 'rcvtblver': int,\n 'brib_rib': int,\n 'labelver': int,\n 'importver': int,\n 'sendtblver': int,\n 'standbyver': int,\n },\n },\n Optional('neighbor'): {\n Any('*'): {\n 'remote_as': Or (, ),\n 'tbl_ver': int,\n 'spk': int,\n 'msg_rcvd': int,\n 'msg_sent': int,\n 'input_queue': int,\n 'output_queue': int,\n 'up_down': str,\n 'state_pfxrcd': str,\n },\n },\n },\n },\n}", @@ -17485,23 +17477,6 @@ "uid": "show_bgp_address_family", "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } - "iosxe": { - "class": "ShowBgp", - "doc": " Parser for:\n * 'show bgp {address_family} rd {rd}'\n * 'show bgp {address_family} vrf {vrf}'\n * 'show bgp {address_family} unicast'\n ", - "module_name": "show_bgp", - "package": "genie.libs.parser", - "schema": "{\n'vrf': {\n Any (str) *: {\n 'address_family': {\n Any (str) *: {\n Optional (str) bgp_table_version: ,\n Optional (str) route_identifier: ,\n Optional (str) vrf_route_identifier: ,\n Optional (str) route_distinguisher: ,\n Optional (str) default_vrf: ,\n Optional (str) af_private_import_to_address_family: ,\n Optional (str) pfx_count: ,\n Optional (str) pfx_limit: ,\n Optional (str) routes: {\n Optional (Any) Any (str) *: {\n Optional (str) index: {\n Optional (Any) Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) localpref: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n },\n },\n}", - "uid": "show_bgp_address_family", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxe/show_bgp.py#L653" - }, - "iosxr": { - "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", - "module_name": "show_bgp", - "package": "genie.libs.parser", - "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", - "uid": "show_bgp_address_family", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" } }, "show bgp {address_family} all": { @@ -17701,25 +17676,35 @@ } }, "show bgp {address_family} community {community}": { - "iosxr": { - "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", - "module_name": "show_bgp", - "package": "genie.libs.parser", - "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", - "uid": "show_bgp_address_family_community_community", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" + "folders": { + "iosxr": { + "class": "ShowBgpAddressFamily", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", + "module_name": "iosxr.show_bgp", + "package": "genie.libs.parser", + "schema": "{\n 'address_family': {\n Any('*'): {\n Optional('router_identifier'): str,\n Optional('local_as'): Or (, ),\n Optional('generic_scan_interval'): int,\n Optional('non_stop_routing'): bool,\n Optional('table_state'): str,\n Optional('table_id'): str,\n Optional('rd_version'): int,\n Optional('bgp_table_version'): int,\n Optional('dampening_status'): str,\n Optional('nsr_initial_initsync_version'): str,\n Optional('nsr_issu_sync_group_versions'): str,\n Optional('nsr_initial_init_ver_status'): str,\n Optional('scan_interval'): int,\n Optional('processed_prefix'): int,\n Optional('processed_paths'): int,\n Optional('route_distinguisher'): {\n Any('*'): {\n Optional('default_vrf'): str,\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n },\n },\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n Optional('operation_mode'): str,\n Optional('process'): {\n Any('*'): {\n 'rcvtblver': int,\n 'brib_rib': int,\n 'labelver': int,\n 'importver': int,\n 'sendtblver': int,\n 'standbyver': int,\n },\n },\n Optional('neighbor'): {\n Any('*'): {\n 'remote_as': Or (, ),\n 'tbl_ver': int,\n 'spk': int,\n 'msg_rcvd': int,\n 'msg_sent': int,\n 'input_queue': int,\n 'output_queue': int,\n 'up_down': str,\n 'state_pfxrcd': str,\n },\n },\n },\n },\n}", + "tokens": { + "os": "iosxr" + }, + "uid": "show_bgp_address_family_community_community", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" + } } }, "show bgp {address_family} community {community} {exact_match}": { - "iosxr": { - "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", - "module_name": "show_bgp", - "package": "genie.libs.parser", - "schema": "{\n'address_family': {\n Any (str) *: {\n Optional (str) router_identifier: ,\n Optional (str) local_as: Or (, ),\n Optional (str) generic_scan_interval: ,\n Optional (str) non_stop_routing: ,\n Optional (str) table_state: ,\n Optional (str) table_id: ,\n Optional (str) rd_version: ,\n Optional (str) bgp_table_version: ,\n Optional (str) dampening_status: ,\n Optional (str) nsr_initial_initsync_version: ,\n Optional (str) nsr_issu_sync_group_versions: ,\n Optional (str) nsr_initial_init_ver_status: ,\n Optional (str) scan_interval: ,\n Optional (str) processed_prefix: ,\n Optional (str) processed_paths: ,\n Optional (str) route_distinguisher: {\n Any (str) *: {\n Optional (str) default_vrf: ,\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n },\n },\n Optional (str) prefix: {\n Any (str) *: {\n Optional (str) index: {\n Any (str) *: {\n Optional (str) next_hop: ,\n Optional (str) status_codes: ,\n Optional (str) metric: ,\n Optional (str) locprf: ,\n Optional (str) weight: ,\n Optional (str) path: ,\n Optional (str) origin_codes: ,\n },\n },\n },\n },\n Optional (str) operation_mode: ,\n Optional (str) process: {\n Any (str) *: {\n 'rcvtblver': ,\n 'brib_rib': ,\n 'labelver': ,\n 'importver': ,\n 'sendtblver': ,\n 'standbyver': ,\n },\n },\n Optional (str) neighbor: {\n Any (str) *: {\n 'remote_as': Or (, ),\n 'tbl_ver': ,\n 'spk': ,\n 'msg_rcvd': ,\n 'msg_sent': ,\n 'input_queue': ,\n 'output_queue': ,\n 'up_down': ,\n 'state_pfxrcd': ,\n },\n },\n },\n },\n}", - "uid": "show_bgp_address_family_community_community_exact_match", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" + "folders": { + "iosxr": { + "class": "ShowBgpAddressFamily", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", + "module_name": "iosxr.show_bgp", + "package": "genie.libs.parser", + "schema": "{\n 'address_family': {\n Any('*'): {\n Optional('router_identifier'): str,\n Optional('local_as'): Or (, ),\n Optional('generic_scan_interval'): int,\n Optional('non_stop_routing'): bool,\n Optional('table_state'): str,\n Optional('table_id'): str,\n Optional('rd_version'): int,\n Optional('bgp_table_version'): int,\n Optional('dampening_status'): str,\n Optional('nsr_initial_initsync_version'): str,\n Optional('nsr_issu_sync_group_versions'): str,\n Optional('nsr_initial_init_ver_status'): str,\n Optional('scan_interval'): int,\n Optional('processed_prefix'): int,\n Optional('processed_paths'): int,\n Optional('route_distinguisher'): {\n Any('*'): {\n Optional('default_vrf'): str,\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n },\n },\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n Optional('operation_mode'): str,\n Optional('process'): {\n Any('*'): {\n 'rcvtblver': int,\n 'brib_rib': int,\n 'labelver': int,\n 'importver': int,\n 'sendtblver': int,\n 'standbyver': int,\n },\n },\n Optional('neighbor'): {\n Any('*'): {\n 'remote_as': Or (, ),\n 'tbl_ver': int,\n 'spk': int,\n 'msg_rcvd': int,\n 'msg_sent': int,\n 'input_queue': int,\n 'output_queue': int,\n 'up_down': str,\n 'state_pfxrcd': str,\n },\n },\n },\n },\n}", + "tokens": { + "os": "iosxr" + }, + "uid": "show_bgp_address_family_community_community_exact_match", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" + } } }, "show bgp {address_family} evi {evi}": { @@ -18250,16 +18235,8 @@ "os": "iosxr" }, "uid": "show_bgp_address_family_bgp_prefix", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9491" - } - "iosxr": { - "class": "ShowBgpAddressfamilyPrefix", - "doc": "Parser for:\n * 'show bgp {address_family} {bgp_prefix}'\n ", - "module_name": "show_bgp", - "package": "genie.libs.parser", - "schema": "{\n'address_family': {\n Any (str) *: {\n 'prefix': ,\n 'last_modified': ,\n 'paths': {\n 'total_available_paths': ,\n 'best_path': ,\n 'path': {\n Any (str) *: {\n Optional (str) advertised_peer_pe: ,\n Optional (str) advertised_peer_ce: ,\n 'as_path': {\n Any (str) *: {\n 'bgp_peer_neighbor_ip': {\n Any (str) *: {\n Optional (str) metric: ,\n 'origin_neighbors_ip': ,\n 'origin_router_id': ,\n 'bgp_peer_neighbor_ip': ,\n Optional (str) originator: ,\n Optional (str) received_label: ,\n 'origin_metric': ,\n Optional (str) weight: ,\n 'localpref': ,\n 'origin_codes': ,\n 'status_codes': ,\n 'received_path_id': ,\n 'local_path_id': ,\n 'version': ,\n Optional (str) cluster_list: ListOf (type) ,\n Optional (str) source_afi: ,\n Optional (str) source_vrf: ,\n Optional (str) source_rd: ,\n Optional (str) psid_type: {\n Any (str) *: {\n 'psid_type': ,\n 'subtlv_count': ,\n 'subtlv': {\n 't_value': ,\n 'sid_value': ,\n 'behaviour': ,\n 'sstlv_count': ,\n Optional (str) subsubtlv: {\n 't_value': ,\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n },\n}", - "uid": "show_bgp_address_family_bgp_prefix", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9498" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9498" + } } }, "show bgp {address_family} {ip_address} bestpath-compare": { From 55bba54a1f01cf0fdd4110b26641aa5ab846a891 Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Thu, 23 May 2024 06:31:20 +0200 Subject: [PATCH 10/11] Add example: ShowBgpVrf regex handles IPv6 addresses and newlines in output now --- src/genie/libs/parser/iosxr/show_bgp.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/genie/libs/parser/iosxr/show_bgp.py b/src/genie/libs/parser/iosxr/show_bgp.py index 094a347574..60fd79f3b8 100644 --- a/src/genie/libs/parser/iosxr/show_bgp.py +++ b/src/genie/libs/parser/iosxr/show_bgp.py @@ -8696,6 +8696,13 @@ def cli(self, vrf=None, address_family=None, summary=None, value=None, output=No # *>i10.169.1.0/24 10.64.4.4 2219 100 0 300 33299 51178 47751 {27016} e # *>i192.168.111.0/24 10.189.99.98 0 0 i # *> 10.7.7.7/32 10.10.10.107 0 0 65107.65107 ? + # OR + # s>i2001:718::2:99/128 195.113.156.4 0 100 0 i + # s i 195.113.156.4 0 100 0 i + # s>i2001:718::2:101/128 + # 10.2.8.1 0 100 0 i + # s i 10.2.8.1 0 100 0 i + # s>i2001:718::2:116/128 p13 = re.compile(r'^(?P(i|s|x|S|d|h|\*|\>|\s)+)' r' *(?P(?P[0-9a-f\.\:\[\]]+)\/(?P\d+))?[\n\r]*' r' +(?P\S+)[\n\r]* +(?P[\d\.\s\{\}]+)' @@ -9200,6 +9207,13 @@ def cli(self, address_family=None, community=None, exact_match=None, output=None # *>i10.169.1.0/24 10.64.4.4 2219 100 0 300 33299 51178 47751 {27016} e # *>i192.168.111.0/24 10.189.99.98 0 0 i # *> 10.7.7.7/32 10.10.10.107 0 0 65107.65107 ? + # OR + # s>i2001:718::2:99/128 195.113.156.4 0 100 0 i + # s i 195.113.156.4 0 100 0 i + # s>i2001:718::2:101/128 + # 10.2.8.1 0 100 0 i + # s i 10.2.8.1 0 100 0 i + # s>i2001:718::2:116/128 p11 = re.compile(r'^(?P(i|s|x|S|d|h|\*|\>|\s)+)' r' *(?P(?P[0-9a-f\.\:\[\]]+)\/(?P\d+))?[\n\r]*' r' +(?P\S+)[\n\r]* +(?P[\d\.\s\{\}]+)' From 6aafd2167e14f4d0611516d73404b25f0227c204 Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Thu, 23 May 2024 10:31:36 +0200 Subject: [PATCH 11/11] Add tests for ShowBgpVrf with IPv6 arguments --- .../cli/equal/golden_output_8_arguments.json | 4 + .../cli/equal/golden_output_8_expected.py | 265 ++++++++++++++++++ .../cli/equal/golden_output_8_output.txt | 130 +++++++++ 3 files changed, 399 insertions(+) create mode 100644 src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_arguments.json create mode 100644 src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_expected.py create mode 100644 src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_output.txt diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_arguments.json b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_arguments.json new file mode 100644 index 0000000000..d489d031dd --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_arguments.json @@ -0,0 +1,4 @@ +{ + "vrf": "xNet", + "address_family": "ipv6 unicast" +} diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_expected.py b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_expected.py new file mode 100644 index 0000000000..3375a1e928 --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_expected.py @@ -0,0 +1,265 @@ +expected_output = {'vrf': {'xnet': {'address_family': {'ipv6_unicast': {'bgp_route_distinguisher': '20.3.3.1:100', + 'bgp_table_version': 217936, + 'bgp_vrf': 'xnet', + 'default_vrf': 'xnet', + 'local_as': 4852, + 'non_stop_routing': True, + 'nsr_initial_init_ver_status': 'reached', + 'nsr_initial_initsync_version': '17', + 'nsr_issu_sync_group_versions': '217936/0', + 'prefix': {'2700:2000:5130:f4gc:0:3d::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:4e::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:52::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:5b::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:5f::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:65::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:68::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:72::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:96::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:97::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:98::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:99::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:9a::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:9d::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:9e::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:a1::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:a2::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '3001:828:0:700:0:258:258:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:0:700:0:2a:2a:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:0:700:0:3b:3b:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1300:7:196:114:124:90/125': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1300:7::20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1307:193:169:202::/112': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1307:196:114:124:106:0/112': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1307:196:114:124:138:0/112': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1307:20:306::/112': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1500:4::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1504::/48': {'index': {1: {'locprf': '0', + 'next_hop': '20.3.5.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '3001:828:19::/56': {'index': {1: {'alloc_mode': '0', + 'local_sid': '150', + 'locator': 'i', + 'locprf': '100', + 'next_hop': '196.114.157.8', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '3001:828:2f09::/48': {'index': {1: {'alloc_mode': '0', + 'local_sid': '150', + 'locator': 'i', + 'locprf': '100', + 'next_hop': '196.114.157.8', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '3001:828:300:26::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:27::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:28::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:2::4:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:2::4:30/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:2::5:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:2::5:30/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:301:ffff::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:316::/48': {'index': {1: {'locprf': '100', + 'metric': '100', + 'next_hop': '20.3.9.2', + 'origin_codes': '?', + 'path': '65221', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3001:828:317::/48': {'index': {1: {'locprf': '100', + 'metric': '100', + 'next_hop': '20.3.9.2', + 'origin_codes': '?', + 'path': '65221', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3001:828:318::/48': {'index': {1: {'locprf': '100', + 'metric': '100', + 'next_hop': '20.3.9.2', + 'origin_codes': '?', + 'path': '65221', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3001:828:900:7::2:0/126': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:900:7::3:0/126': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:907::/48': {'index': {1: {'locprf': '100', + 'metric': '200', + 'next_hop': '20.3.4.2', + 'origin_codes': 'i', + 'path': '65086', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3001:828::3:116/128': {'index': {1: {'status_codes': '*>i'}}}, + '3b06:48d8::/40': {'index': {1: {'locprf': '160', + 'metric': '100', + 'next_hop': '20.3.7.2', + 'origin_codes': '?', + 'path': '210498', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3b13:950:2::/127': {'index': {1: {'locprf': '0', + 'next_hop': '20.3.12.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '3b13:950:2::/48': {'index': {1: {'locprf': '100', + 'metric': '0', + 'next_hop': '196.114.157.54', + 'origin_codes': 'i', + 'path': '210367', + 'status_codes': '*i', + 'weight': '0'}, + 2: {'locprf': '100', + 'metric': '0', + 'next_hop': '20.3.12.2', + 'origin_codes': 'i', + 'path': '210367', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3b13:950:2::3/127': {'index': {1: {'locprf': '0', + 'next_hop': '20.3.12.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '::/0': {'index': {1: {'locprf': '205', + 'next_hop': '196.114.157.10', + 'origin_codes': 'i', + 'status_codes': '*>i', + 'weight': '0'}}}}, + 'processed_paths': 72, + 'processed_prefix': 51, + 'rd_version': 217935, + 'route_distinguisher': '20.3.3.1:100', + 'router_identifier': '20.3.3.1', + 'table_id': '0xe0800011', + 'table_state': 'active', + 'vrf_id': '0x60000002', + 'vrf_state': 'active'}}}}} diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_output.txt b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_output.txt new file mode 100644 index 0000000000..8a4311d869 --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_output.txt @@ -0,0 +1,130 @@ +show bgp vrf xNet ipv6 unicast +BGP VRF xNet, state: Active +BGP Route Distinguisher: 20.3.3.1:100 +VRF ID: 0x60000002 +BGP router identifier 20.3.3.1, local AS number 4852 +Non-stop routing is enabled +BGP table state: Active +Table ID: 0xe0800011 RD version: 217935 +BGP main routing table version 217936 +BGP NSR Initial initsync version 17 (Reached) +BGP NSR/ISSU Sync-Group versions 217936/0 + +Status codes: s suppressed, d damped, h history, * valid, > best + i - internal, r RIB-failure, S stale, N Nexthop-discard +Origin codes: i - IGP, e - EGP, ? - incomplete + Network Next Hop Metric LocPrf Weight Path +Route Distinguisher: 20.3.3.1:100 (default for vrf xNet) +Route Distinguisher Version: 217935 +*>i::/0 196.114.157.10 205 0 i +*>i3001:828::3:116/128 + 196.114.157.25 1000 100 0 65086 i +*>i3001:828:0:700:0:2a:2a:20/127 + 20.3.1.1 0 100 0 i +*>i3001:828:0:700:0:3b:3b:20/127 + 20.3.3.2 0 100 0 i +*>i3001:828:0:700:0:258:258:20/127 + 196.114.157.10 0 100 0 i +*>i3001:828:19::/56 196.114.157.8 100 100 0 i +* 3001:828:19:3::2 + 150 0 i +*>i3001:828:300:2::4:20/127 + 20.3.9.2 0 100 0 i +*>i3001:828:300:2::4:30/127 + 20.3.7.2 0 100 0 i +*>i3001:828:300:2::5:20/127 + 20.3.9.2 0 100 0 i +*>i3001:828:300:2::5:30/127 + 20.3.7.2 0 100 0 i +*>i3001:828:300:26::/64 + 20.3.9.2 100 100 0 65221 ? +*>i3001:828:300:27::/64 + 20.3.9.2 100 100 0 65221 ? +*>i3001:828:300:28::/64 + 20.3.9.2 100 100 0 65221 ? +*>i3001:828:301:ffff::/64 + 20.3.9.2 100 100 0 65221 ? +*>i3001:828:316::/48 20.3.9.2 100 100 0 65221 ? +*>i3001:828:317::/48 20.3.9.2 100 100 0 65221 ? +*>i3001:828:318::/48 20.3.9.2 100 100 0 65221 ? +*>i3001:828:900:7::2:0/126 + 196.114.157.25 0 100 0 i +*>i3001:828:900:7::3:0/126 + 20.3.4.2 0 100 0 i +*>i3001:828:907::/48 20.3.4.2 200 100 0 65086 i +*>i3001:828:1300:7::20/127 + 20.3.6.2 0 100 0 i +*>i3001:828:1300:7:196:114:124:90/125 + 20.3.6.2 100 0 65031 i +*>i3001:828:1307:20:306::/112 + 20.3.6.2 100 0 65031 i +*>i3001:828:1307:193:169:202::/112 + 20.3.6.2 100 0 65031 i +*>i3001:828:1307:196:114:124:106:0/112 + 20.3.6.2 100 0 65031 i +*>i3001:828:1307:196:114:124:138:0/112 + 20.3.6.2 100 0 65031 i +*>i3001:828:1500:4::/64 + 20.3.5.2 0 100 0 i +*>i3001:828:1504::/48 20.3.5.2 0 100 0 i +*>i3001:828:2f09::/48 196.114.157.8 100 100 0 i +* 3001:828:19:3::2 + 150 0 i +*>i2700:2000:5130:f4gc:0:3d::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:4e::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:52::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:5b::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:5f::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:65::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:68::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:72::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:96::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:97::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:98::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:99::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:9a::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:9d::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:9e::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:a1::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:a2::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i3b06:48d8::/40 20.3.7.2 100 160 0 210498 ? +* i3b13:950:2::/48 196.114.157.54 0 100 0 210367 i +*>i 20.3.12.2 0 100 0 210367 i +*>i3b13:950:2::/127 20.3.12.2 0 100 0 i +*>i3b13:950:2::3/127 20.3.12.2 0 100 0 i + +Processed 51 prefixes, 72 paths