]> git.puffer.fish Git - matthieu/frr.git/commitdiff
yang: Corrected pyang errors in frr-pathd.yang
authorY Bharath <y.bharath@samsung.com>
Wed, 16 Apr 2025 07:17:31 +0000 (12:47 +0530)
committerY Bharath <y.bharath@samsung.com>
Wed, 16 Apr 2025 07:17:31 +0000 (12:47 +0530)
Corrected pyang warnings and errors in frr-pathd.yang

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
yang/frr-pathd.yang

index 5beda769c1a366abafa3f953bb38f542e358613f..96eafda9d410aed1f2219bd68e7dd555ea39c54d 100644 (file)
@@ -6,15 +6,9 @@ module frr-pathd {
   import ietf-inet-types {
     prefix inet;
   }
-  import ietf-yang-types {
-    prefix yang;
-  }
   import ietf-routing-types {
     prefix rt-types;
   }
-  import frr-interface {
-    prefix frr-interface;
-  }
 
   organization
     "Free Range Routing";
@@ -27,11 +21,10 @@ module frr-pathd {
   revision 2018-11-06 {
     description
       "Initial revision.";
+    reference "FRRouting";
   }
 
   typedef protocol-origin-type {
-    description
-      "Indication for the protocol origin of an object.";
     type enumeration {
       enum pcep {
         value 1;
@@ -46,6 +39,8 @@ module frr-pathd {
         description "The object was created through CLI, Yang model via Netconf, gRPC, etc";
       }
     }
+    description
+      "Indication for the protocol origin of an object.";
   }
 
   typedef originator-type {
@@ -57,7 +52,13 @@ module frr-pathd {
       }
 
   container pathd {
+    description
+      "Path properties for Segment Routing TE";
+
     container srte {
+      description
+        "Segment Routing TE properties";
+
       list segment-list {
         key "name";
         description "Segment-list properties";
@@ -91,9 +92,10 @@ module frr-pathd {
         }
         container nai {
           presence "The segment has a Node or Adjacency Identifier";
+          description
+            "Node or Adjacency Identifier for the segment";
+
           leaf type {
-            description "NAI type";
-            mandatory true;
             type enumeration {
               enum ipv4_node {
                 value 1;
@@ -132,42 +134,59 @@ module frr-pathd {
                 description "IPv6 prefix with optional algorithm";
               }
             }
+            mandatory true;
+            description "NAI type";
           }
           leaf local-address {
             type inet:ip-address;
             mandatory true;
+            description
+              "Local address of the NAI";
           }
           leaf local-prefix-len {
+            when "../type = 'ipv4_local_iface' or ../type = 'ipv6_local_iface' or ../type = 'ipv4_algo' or ../type = 'ipv6_algo'";
             type uint8;
             mandatory true;
-            when "../type = 'ipv4_local_iface' or ../type = 'ipv6_local_iface' or ../type = 'ipv4_algo' or ../type = 'ipv6_algo'";
+            description
+              "Prefix length of the local address";
           }
           leaf local-interface {
+            when "../type = 'ipv4_local_iface' or ../type = 'ipv6_local_iface' or ../type = 'ipv4_unnumbered_adjacency'";
             type uint32;
             mandatory true;
-            when "../type = 'ipv4_local_iface' or ../type = 'ipv6_local_iface' or ../type = 'ipv4_unnumbered_adjacency'";
+            description
+              "Local interface ID for the NAI";
           }
           leaf remote-address {
+            when "../type = 'ipv4_adjacency' or ../type = 'ipv6_adjacency' or ../type = 'ipv4_unnumbered_adjacency'";
             type inet:ip-address;
-              mandatory true;
-              when "../type = 'ipv4_adjacency' or ../type = 'ipv6_adjacency' or ../type = 'ipv4_unnumbered_adjacency'";
-            }
-            leaf remote-interface {
-              type uint32;
-              mandatory true;
-              when "../type = 'ipv4_unnumbered_adjacency'";
-            }
+            mandatory true;
+            description
+              "Remote address of the NAI";
+          }
+          leaf remote-interface {
+            when "../type = 'ipv4_unnumbered_adjacency'";
+            type uint32;
+            mandatory true;
+            description
+              "Remote interface ID for the NAI";
+          }
           leaf algorithm {
+            when "../type = 'ipv4_algo' or ../type = 'ipv6_algo'";
             type uint8;
             mandatory true;
-            when "../type = 'ipv4_algo' or ../type = 'ipv6_algo'";
-          }
+            description
+              "Algorithm to use for the NAI";
           }
+         }
         }
       }
       list policy {
         key "color endpoint";
         unique "name";
+        description
+          "List of SR Policies.";
+
         leaf color {
           type uint32;
           description
@@ -197,10 +216,10 @@ module frr-pathd {
             "True if a valid candidate path of this policy is operational in zebra, False otherwise";
         }
         list candidate-path {
+          key "preference";
           unique "name";
           description
             "List of Candidate Paths of the SR Policy.";
-          key "preference";
           leaf preference {
             type uint32;
             description
@@ -237,17 +256,21 @@ module frr-pathd {
             description "Candidate path distinguisher";
           }
           leaf type {
-            description
-              "Type of the Candidate Path.";
-            mandatory true;
             type enumeration {
               enum explicit {
                 value 1;
+                description
+                  "Explicit path defined by a segment list";
               }
               enum dynamic {
                 value 2;
+                description
+                  "Dynamic path computed by a routing protocol";
               }
             }
+            mandatory true;
+            description
+              "Type of the Candidate Path.";
           }
           leaf segment-list-name {
             type leafref {
@@ -271,10 +294,12 @@ module frr-pathd {
                   "If the bandwidth limitation is a requirement or only a suggestion";
               }
               leaf value {
-                mandatory true;
                 type decimal64 {
                     fraction-digits 6;
                 }
+                mandatory true;
+                description
+                  "The bandwidth value for the candidate path.";
               }
             }
             container affinity {
@@ -298,9 +323,10 @@ module frr-pathd {
             }
             list metrics {
               key "type";
+              description
+                "This list contains the different metrics that can be used to describe a path.";
+
               leaf type {
-                description
-                  "Type of the metric.";
                 type enumeration {
                   enum igp {
                     value 1;
@@ -387,6 +413,8 @@ module frr-pathd {
                     description "Border Node Count metric";
                   }
                 }
+                description
+                  "Type of the metric.";
               }
               leaf required {
                 type boolean;
@@ -405,10 +433,12 @@ module frr-pathd {
                   "Defines if the value has been generated by the originator of the path.";
               }
               leaf value {
-                mandatory true;
                 type decimal64 {
                     fraction-digits 6;
                 }
+                mandatory true;
+                description
+                  "Value of the metric.";
               }
             }
             container objective-function {
@@ -422,9 +452,6 @@ module frr-pathd {
                   "If an objective function is a requirement, or if it is only a suggestion";
               }
               leaf type {
-                description
-                  "Type of objective function.";
-                mandatory true;
                 type enumeration {
                   enum mcp {
                     value 1;
@@ -495,6 +522,9 @@ module frr-pathd {
                     description "Minimize the number of Shared Nodes";
                   }
                 }
+                mandatory true;
+                description
+                  "Type of objective function.";
               }
             }
           }