Skip to content

Commit

Permalink
Add link bandwidth community using schema string regex style (#1027)
Browse files Browse the repository at this point in the history
(M) release/models/bgp/openconfig-bgp-types.yang
* Add bgp link-bandwidth community type
  • Loading branch information
dplore authored Jan 25, 2024
1 parent ce2ebe9 commit 6836243
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
8 changes: 7 additions & 1 deletion release/models/bgp/openconfig-bgp-errors.yang
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ submodule openconfig-bgp-errors {
"This module defines BGP NOTIFICATION message error codes
and subcodes";

oc-ext:openconfig-version "5.5.0";
oc-ext:openconfig-version "5.6.0";

revision "2023-12-26" {
description
"Add regex for bgp link bandwidth";
reference "5.6.0";
}

revision "2023-09-06" {
description
Expand Down
29 changes: 28 additions & 1 deletion release/models/bgp/openconfig-bgp-types.yang
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ module openconfig-bgp-types {
policy. It can be imported by modules that make use of BGP
attributes";

oc-ext:openconfig-version "5.5.0";
oc-ext:openconfig-version "5.6.0";

revision "2023-12-26" {
description
"Add regex for bgp link bandwidth";
reference "5.6.0";
}

revision "2023-09-06" {
description
Expand Down Expand Up @@ -595,6 +601,27 @@ module openconfig-bgp-types {
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])$';
}
type string {
// Extended Link Bandwidth Community
// link-bandwidth:<2 byte asn>:<bandwidth value in bits/sec,
// optionally with Kilo/Mega/Giga suffix>
// Example: link-bandwidth:20:100M
pattern 'link-bandwidth:' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])(k|K|M|G)?';
oc-ext:posix-pattern '^link-bandwidth:' +
'(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' +
'|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' +
'429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[0-1][0-9]{8}|[1-3][0-9]{9}|' +
'[1-9][0-9]{1,8}|[0-9])(k|K|M|G)?$';
}

}
description
"Type definition for extended community attributes. In the case that
Expand Down

0 comments on commit 6836243

Please sign in to comment.