From d71d1c1c0712379f9c711c0943eea88abb41c919 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 9 Nov 2023 17:53:25 -0800 Subject: [PATCH] add refactored aft summary model --- release/models/aft/.spec.yml | 2 + .../models/aft/openconfig-aft-summary.yang | 120 ++++++++++++++++++ .../openconfig-route-summary.yang | 112 ---------------- 3 files changed, 122 insertions(+), 112 deletions(-) create mode 100644 release/models/aft/openconfig-aft-summary.yang delete mode 100644 release/models/network-instance/openconfig-route-summary.yang diff --git a/release/models/aft/.spec.yml b/release/models/aft/.spec.yml index 6320b2469..fd1079c0b 100644 --- a/release/models/aft/.spec.yml +++ b/release/models/aft/.spec.yml @@ -2,7 +2,9 @@ docs: - yang/aft/openconfig-aft.yang - yang/aft/openconfig-aft-types.yang + - yang/aft/openconfig-aft-summary.yang build: - yang/network-instance/openconfig-network-instance.yang - yang/aft/openconfig-aft-network-instance.yang + - yang/aft/openconfig-aft-summary.yang run-ci: true diff --git a/release/models/aft/openconfig-aft-summary.yang b/release/models/aft/openconfig-aft-summary.yang new file mode 100644 index 000000000..d3f1d896a --- /dev/null +++ b/release/models/aft/openconfig-aft-summary.yang @@ -0,0 +1,120 @@ +module openconfig-aft-summary { + yang-version "1"; + + namespace "http://openconfig.net/yang/aft-summary"; + + prefix "oc-rtsummary"; + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-yang-types { prefix "oc-yang-types"; } + import openconfig-policy-types { prefix "oc-pol-types"; } + import openconfig-network-instance { prefix "oc-ni"; } + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module provides summary of aft entry counts per protocol type for each network + instance."; + + oc-ext:openconfig-version "0.1.0"; + + revision "2023-11-09" { + description + "Initial version."; + reference "0.1.0"; + } + + grouping protocols-state { + description + "Grouping for protocol type state."; + + leaf origin-protocol { + description + "Protocol type that keys the protocol list."; + + type identityref { + base "oc-pol-types:INSTALL_PROTOCOL_TYPE"; + } + } + + container counters { + description + "Enclosing container for aft entry counters"; + + leaf aft-entries { + description + "Total number of entries in the aft."; + type oc-yang-types:counter64; + } + } + } + + grouping aft-summary { + description + "A summary of aft entries by protocol type."; + + container protocols { + description + "Enclosing container for a list of protocols"; + list protocol { + key "origin-protocol"; + + description + "Protocol type that keys the aft entry count list."; + + leaf origin-protocol { + type leafref { + path "../state/origin-protocol"; + } + description + "Reference to the protocol type which added the aft entry."; + } + + container state { + description + "State parameters for the aft entry list."; + uses protocols-state; + } + } + } + } + + grouping aft-summary-ipv4 { + description + "Grouping of all route summaries for ipv4."; + container ipv4-unicast { + description + "Container for ipv4 unicast route summary by protocol type."; + uses aft-summary; + } + } + + grouping aft-summary-ipv6 { + description + "Grouping of all route summaries for ipv6."; + container ipv6-unicast { + description + "Container for ipv4 route counts by protocol type."; + uses aft-summary; + } + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:afts" { + description + "Augment the afts model with the route summary container."; + + container aft-summaries { + uses aft-summary-ipv4; + uses aft-summary-ipv6; + + description + "Route summary for the network instance."; + } + } + +} diff --git a/release/models/network-instance/openconfig-route-summary.yang b/release/models/network-instance/openconfig-route-summary.yang deleted file mode 100644 index 169894b32..000000000 --- a/release/models/network-instance/openconfig-route-summary.yang +++ /dev/null @@ -1,112 +0,0 @@ -module openconfig-route-summary { - yang-version "1"; - - namespace "http://openconfig.net/yang/route-summary"; - - prefix "oc-rtsummary"; - - import openconfig-extensions { prefix "oc-ext"; } - import openconfig-yang-types { prefix "oc-yang-types"; } - import openconfig-policy-types { prefix "oc-pol-types"; } - import openconfig-network-instance { prefix "oc-ni"; } - - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - www.openconfig.net"; - - description - "This module provides summary of route counts per route type for each network - instance."; - - oc-ext:openconfig-version "1.0.0"; - - revision "2022-12-21" { - description - "Initial version."; - reference "1.0.0"; - } - - grouping route-counter { - description - "Route type counter item."; - - leaf origin-protocol { - description - "Route type that keys the route count list."; - - type identityref { - base "oc-pol-types:INSTALL_PROTOCOL_TYPE"; - } - } - - container total-count { - description - "A collection of route counts."; - uses total-count; - } - } - - grouping total-count { - description - "A collection of route counts."; - - leaf fib-count { - description - "Total number of routes in the FIB."; - type oc-yang-types:counter64; - } - } - - grouping route-summary { - description - "A summary of route count by route type."; - - list route-count { - key "origin-protocol"; - - description - "Route types that keys the route count list."; - - leaf origin-protocol { - type leafref { - path "../state/origin-protocol"; - } - description - "Reference to the source of the route."; - } - - container state { - description - "State parameters for the route summary list entry."; - uses route-counter; - } - } - } - - augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:afts/oc-ni:ipv6-unicast" { - description - "Augment the network-instance model with the route summary container for - IPv4."; - - container summary { - uses route-summary; - description - "IPv4 route summary for the network instance."; - } - } - - augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:afts/oc-ni:ipv4-unicast" { - description - "Augment the network-instance model with the route summary container for - IPv6."; - - container summary { - uses route-summary; - description - "IPv6 route summary for the network instance."; - } - } -}