Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor non-compliant/overlapping YANG definition for BGP MED #1165

Merged
merged 15 commits into from
Oct 23, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 44 additions & 14 deletions release/models/bgp/openconfig-bgp-policy.yang
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ module openconfig-bgp-policy {
It augments the base routing-policy module with BGP-specific
options for conditions and actions.";

oc-ext:openconfig-version "7.1.0";
oc-ext:openconfig-version "8.0.0";

revision "2024-08-15" {
description
"Separate the ability to set the BGP MED into a distinct value
with optional action.";
reference "8.0.0";
}

revision "2024-07-02" {
description
Expand Down Expand Up @@ -210,23 +217,37 @@ module openconfig-bgp-policy {
typedef bgp-set-med-type {
type union {
type uint32;
type string {
pattern '[+-][0-9]+';
oc-ext:posix-pattern '^[+-][0-9]+$';
}
type enumeration {
enum IGP {
description "set the MED value to the IGP cost toward the
next hop for the route";
description
"Set the MED value to the IGP cost toward the next hop for
the route";
}
}
}
description
"Type definition for specifying how the BGP MED can
be set in BGP policy actions. The three choices are to set
the MED directly using the uint32 type or increment/decrement
using +/- notation in the string type or setting it to
the IGP cost using the enum (predefined value).";
"Type definition for specifying how the BGP MED can be set in BGP
policy actions. The MED can be specified as a direct integer
value or setting it to the IGP cost. When set to the integer
value without a MED 'action', the value will be explicitly set.
If a MED 'action' is defined, the previous value will be modified
according to the action (e.g. ADD or SUBTRACT).";
}

typedef bgp-set-med-action {
type enumeration {
enum ADD {
description
"Action to increment the previous MED value.";
}
enum SUBTRACT {
description
"Action to decrement the previous MED value.";
}
dplore marked this conversation as resolved.
Show resolved Hide resolved
}
description
"If specified, this action will alter a previous MED value by the
value defined by the bgp-set-med-type.";
}

// grouping statements
Expand Down Expand Up @@ -1345,8 +1366,17 @@ module openconfig-bgp-policy {

leaf set-med {
type bgp-set-med-type;
description "set the med metric attribute in the route
update";
description
"Set the MED metric attribute in the route update. Can be used
in conjunction with 'set-med-action' in order to alter a
previous value by the value specified here.";
}

leaf set-med-action {
type bgp-set-med-action;
description
"Optionally used in conjunction with 'set-med' to alter a
previous value.";
}
}

Expand Down
Loading