From 6739615985dbc694b3575af945941898cf2ca4b7 Mon Sep 17 00:00:00 2001 From: Eddy Lem Date: Mon, 15 Jul 2024 11:33:09 -0700 Subject: [PATCH 1/2] Add support for BGP Asn Notation --- models/enterprise_sonic/bgp/deleted_example_01.txt | 9 +++++++++ models/enterprise_sonic/bgp/deleted_example_02.txt | 3 +++ models/enterprise_sonic/bgp/merged_example_01.txt | 8 ++++++++ models/enterprise_sonic/bgp/sonic_bgp.yaml | 5 +++++ 4 files changed, 25 insertions(+) diff --git a/models/enterprise_sonic/bgp/deleted_example_01.txt b/models/enterprise_sonic/bgp/deleted_example_01.txt index d5b438f85..2159ce3d2 100644 --- a/models/enterprise_sonic/bgp/deleted_example_01.txt +++ b/models/enterprise_sonic/bgp/deleted_example_01.txt @@ -14,6 +14,10 @@ # bestpath med missing-as-worst confed # bestpath compare-routerid #! +#router bgp 10.2 vrf VrfCheck3 +# log-neighbor-changes +# as-notation asdot+ +#! #router bgp 4 # router-id 10.2.2.4 # bestpath as-path ignore @@ -54,6 +58,8 @@ # med: # confed: True # missing_as_worst: True +# - bgp_as: 10.2 +# as_notation: "asdot+" # state: deleted # After state: # ------------ @@ -66,6 +72,9 @@ # log-neighbor-changes # bestpath compare-routerid #! +#router bgp 655362 vrf VrfCheck3 +# log-neighbor-changes +#! #router bgp 4 # log-neighbor-changes # bestpath compare-routerid diff --git a/models/enterprise_sonic/bgp/deleted_example_02.txt b/models/enterprise_sonic/bgp/deleted_example_02.txt index 5a7d84ff7..9b01615bb 100644 --- a/models/enterprise_sonic/bgp/deleted_example_02.txt +++ b/models/enterprise_sonic/bgp/deleted_example_02.txt @@ -14,6 +14,9 @@ # bestpath med missing-as-worst confed # bestpath compare-routerid #! +#router bgp 655362 vrf VrfCheck3 +# log-neighbor-changes +#! #router bgp 4 # router-id 10.2.2.4 # bestpath as-path ignore diff --git a/models/enterprise_sonic/bgp/merged_example_01.txt b/models/enterprise_sonic/bgp/merged_example_01.txt index 53d1b0818..190073ef5 100644 --- a/models/enterprise_sonic/bgp/merged_example_01.txt +++ b/models/enterprise_sonic/bgp/merged_example_01.txt @@ -40,6 +40,10 @@ # med: # confed: True # missing_as_worst: True +# - bgp_as: 655362 +# log_neighbor_changes: True +# vrf_name: 'VrfCheck3' +# as_notation: "asdot+" # state: merged # # After state: @@ -56,6 +60,10 @@ # bestpath med missing-as-worst confed # bestpath compare-routerid #! +#router bgp 10.2 vrf VrfCheck3 +# log-neighbor-changes +# as-notation asdot+ +#! #router bgp 4 # router-id 10.2.2.4 # bestpath as-path ignore diff --git a/models/enterprise_sonic/bgp/sonic_bgp.yaml b/models/enterprise_sonic/bgp/sonic_bgp.yaml index eea7259d7..05a2bba1c 100644 --- a/models/enterprise_sonic/bgp/sonic_bgp.yaml +++ b/models/enterprise_sonic/bgp/sonic_bgp.yaml @@ -46,6 +46,11 @@ DOCUMENTATION: | description: - Enable/disable logging neighbor up/down and reset reason. type: bool + as_annotation: + description: + - Specify the AS number notation format + type: str + choices: [ 'asdot', 'asdot+' ] bestpath: description: - Configures the BGP bestpath. From 1094d384b2a61beb955fc8d44f50891a8dd333fc Mon Sep 17 00:00:00 2001 From: Eddy Lem Date: Wed, 17 Jul 2024 10:00:42 -0700 Subject: [PATCH 2/2] Update Bgp asn type to str and asdot notation in description --- models/enterprise_sonic/bgp/sonic_bgp.yaml | 3 ++- .../bgp_neighbors/sonic_bgp_neighbors.yaml | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/models/enterprise_sonic/bgp/sonic_bgp.yaml b/models/enterprise_sonic/bgp/sonic_bgp.yaml index 05a2bba1c..63f3c798a 100644 --- a/models/enterprise_sonic/bgp/sonic_bgp.yaml +++ b/models/enterprise_sonic/bgp/sonic_bgp.yaml @@ -31,6 +31,7 @@ DOCUMENTATION: | bgp_as: description: - Specifies the BGP Autonomous System (AS) number to configure on the device. + - The range is from 1 to 4294967295 or asdot notation. type: str required: true vrf_name: @@ -50,7 +51,7 @@ DOCUMENTATION: | description: - Specify the AS number notation format type: str - choices: [ 'asdot', 'asdot+' ] + choices: ['asdot', 'asdot+'] bestpath: description: - Configures the BGP bestpath. diff --git a/models/enterprise_sonic/bgp_neighbors/sonic_bgp_neighbors.yaml b/models/enterprise_sonic/bgp_neighbors/sonic_bgp_neighbors.yaml index 60e3419c7..e31aca5de 100644 --- a/models/enterprise_sonic/bgp_neighbors/sonic_bgp_neighbors.yaml +++ b/models/enterprise_sonic/bgp_neighbors/sonic_bgp_neighbors.yaml @@ -54,8 +54,8 @@ DOCUMENTATION: | peer_as: description: - Specifies remote AS number. - - The range is from 1 to 4294967295. - type: int + - The range is from 1 to 4294967295 or asdot notation. + type: str peer_type: description: - Specifies type of bgp peer. @@ -177,7 +177,8 @@ DOCUMENTATION: | as: description: - Local autonomous system number. - type: int + - The range is from 1 to 4294967295 or asdot notation. + type: str required: True no_prepend: description: @@ -324,8 +325,8 @@ DOCUMENTATION: | peer_as: description: - Specifies remote AS number. - - The range is from 1 to 4294967295. - type: int + - The range is from 1 to 4294967295 or asdot notation. + type: str peer_type: description: - Specifies type of bgp peer. @@ -450,7 +451,8 @@ DOCUMENTATION: | as: description: - Local autonomous system number. - type: int + - The range is from 1 to 4294967295 or asdot notation. + type: str required: True no_prepend: description: