Define PCEP LSP operational state instruction
[bgpcep.git] / pcep / topology-api / src / main / yang / network-topology-pcep.yang
index 0a2adc92693ab49628079d81b67efd182ac5dbc9..74a2ce1ad06cf3f60b01f8acdcfafd94c93bbde7 100644 (file)
@@ -5,7 +5,6 @@ module network-topology-pcep {
        prefix "pn";
 
        import network-topology { prefix nt; revision-date 2013-10-21; }
-       import network-topology-programming { prefix ntp; revision-date 2013-11-02; }
        import pcep-types { prefix pcep; revision-date 2013-10-05; }
 
        organization "Cisco Systems, Inc.";
@@ -15,6 +14,16 @@ module network-topology-pcep {
                "This module contains the PCEP extensions to base topology model. It
         exposes the LSPs for which a particular node is the head end.
 
+        This module exposes three programming instructions,add-lsp,
+        remove-lsp and update-lsp, which map to actively-stateful PCEP
+        operations using PCInitiate and PCUpd messages to initiate,
+        destroy and udpate LSP configuration. The lifecycle of these
+        instructions follows draft-crabbe-pce-pce-initiated-lsp and
+        draft-ietf-pce-stateful-pce, completing execution once the head-end
+        router has acknowledged operation success. Should the router become
+        disconnected, the instruction resolve to Cancelled if the message
+        has not been sent into the TCP socket, or Failed it they have.
+
                Copyright (c)2013 Cisco Systems, Inc. All rights reserved.";
 
        revision "2013-10-24" {
@@ -71,9 +80,7 @@ module network-topology-pcep {
                 }
                 key name;
 
-                container lsp {
-                    uses pcep:lsp-object;
-                }
+                uses pcep:lsp-object;
 
                 container path {
                     uses pcep:path-definition;
@@ -88,82 +95,112 @@ module network-topology-pcep {
                uses pcep-client-attributes;
        }
 
-    rpc add-lsp {
-        input {
-            uses ntp:topology-instruction-input;
+    typedef failure-type {
+        type enumeration {
+            enum unsent;
+            enum no-ack;
+            enum failed;
+        }
+    }
 
-            leaf node {
-                type nt:node-ref;
-                mandatory true;
-            }
+    grouping lsp-id {
+        leaf node {
+            type nt:node-ref;
+            mandatory true;
+        }
 
-            leaf name {
-                type pcep:symbolic-path-name;
-                mandatory true;
-            }
+        leaf name {
+            type pcep:symbolic-path-name;
+            mandatory true;
+        }
+    }
 
-            container arguments {
-                leaf administrative {
-                    type boolean;
-                    default true;
-                }
+    grouping operation-result {
+        leaf failure {
+            type failure-type;
+        }
+    }
 
-                               container endpoints {
-                                       uses pcep:endpoints-object;
-                               }
+    grouping add-lsp-args {
+        uses lsp-id;
 
-                uses pcep:path-definition;
+        container arguments {
+            leaf administrative {
+                type boolean;
+                default true;
             }
+
+                       uses pcep:endpoints-object;
+
+            uses pcep:path-definition;
+        }
+    }
+
+    rpc add-lsp {
+        input {
+            uses add-lsp-args;
         }
         output {
-            uses ntp:topology-instruction-output;
+            uses operation-result;
         }
     }
 
+    grouping remove-lsp-args {
+        uses lsp-id;
+    }
+
     rpc remove-lsp {
         input {
-            uses ntp:topology-instruction-input;
+            uses remove-lsp-args;
+        }
+        output {
+            uses operation-result;
+        }
+    }
 
-            leaf node {
-                type nt:node-ref;
-                mandatory true;
-            }
+    grouping update-lsp-args {
+        uses lsp-id;
 
-            leaf name {
-                type pcep:symbolic-path-name;
-                mandatory true;
+        container arguments {
+            leaf administrative {
+                type boolean;
+                default true;
             }
-        }
-        output {
-            uses ntp:topology-instruction-output;
+
+            uses pcep:path-definition;
         }
     }
 
     rpc update-lsp {
         input {
-            uses ntp:topology-instruction-input;
+            uses update-lsp-args;
+        }
+        output {
+            uses operation-result;
+        }
+    }
 
-            leaf node {
-                type nt:node-ref;
-                mandatory true;
-            }
+    grouping ensure-lsp-operational-args {
+        uses lsp-id;
 
-            leaf name {
-                type pcep:symbolic-path-name;
+        container arguments {
+            leaf operational {
+                type pcep:operational-status;
                 mandatory true;
             }
+        }
+    }
 
-            container arguments {
-                leaf administrative {
-                    type boolean;
-                    default true;
-                }
+    rpc ensure-lsp-operational {
+        description
+            "Ensure that the target LSP is provisioned and has specified
+             operational status.";
 
-                uses pcep:path-definition;
-            }
+        input {
+            uses ensure-lsp-operational-args;
         }
         output {
-            uses ntp:topology-instruction-output;
+            uses operation-result;
         }
     }
 }