Bug 8621 - Add shutdown-shard-replica rpc to MdsalLowLevelTestProvider
[controller.git] / opendaylight / md-sal / samples / clustering-test-app / model / src / main / yang / odl-mdsal-lowlevel-control.yang
index 4c0871551cec0b5a46d9a94f5eea9e10346dc3f5..bc3e03998c473e92763712f2b0b9f5ba36617212 100644 (file)
@@ -102,8 +102,8 @@ module odl-mdsal-lowlevel-control {
             If the application is instantiated, it immediatelly un-registers itself.
             When the application instance is closed, it increments flap-count
             and if active flag is set, re-registers the application implementation as a singleton.
-            If either un-registration or re-registration fails, flap-count is set
-            to negative of its previous value (minus one in case of un-registration)
+            If either un-registration or re-registration fails, 'active' flag is unset,
+            flap-count is set to negative of its previous value (minus one in case of un-registration)
             to signal a failure has happened.";
         // No input.
         // No output.
@@ -124,11 +124,13 @@ module odl-mdsal-lowlevel-control {
         }
     }
 
-    rpc publish-notifications {
-        description "Upon receiving this, the member shall start publishing llt:id-sequence
-            notifications with the given id and sequence numbers, increasing, from 1.
-            The RPC shall not return until all publishes are successful,
-            or an exception is raised (the exception should propagate to restconf response).";
+    rpc start-publish-notifications {
+        description "Upon receiving this, the member checks whether it is already in the middle of publishing,
+            for this id, and fails if yes. If no, the member shall clear any state tracking data possibly present
+            from the previous call wth this id, and start publishing llt:id-sequence
+            notifications with the given id and sequence numbers increasing from 1.
+            The RPC shall return immediatelly before the first notification is published.
+            The publishing task stops on first error of after the given time.";
         input {
             uses llc:id-grouping;
             leaf seconds {
@@ -145,6 +147,35 @@ module odl-mdsal-lowlevel-control {
         // No output.
     }
 
+    rpc check-publish-notifications {
+        description "Upon receiving this, the member shall immediatelly return
+            the current tracking data related to the current (or previous) task
+            started by start-publish-notifications with this id.";
+        input {
+            uses llc:id-grouping;
+        }
+        output {
+            leaf active {
+                description "True if a publishing task for this id is running, false otherwise.";
+                mandatory true;
+                type boolean;
+            }
+            leaf publish-count {
+                description "How many notifications were published for this id since last start.
+                    If there was no start-publish-notifications call for this id, this leaf is absent.";
+                mandatory false;
+                type int64;
+            }
+            leaf last-error {
+                description "If no task has been started by start-publish-notifications for this id,
+                    or if the last such call has not encountered an error, this leaf is absent.
+                    Otherwise it contains a string message from the last error, including stacktrace if possible.";
+                mandatory false;
+                type string;
+            }
+        }
+    }
+
     rpc subscribe-ynl {
         description "Upon receiving this, the member checks whether it has already subscribed
             a yang listener for the given id, and fails if yes.
@@ -232,7 +263,23 @@ module odl-mdsal-lowlevel-control {
                 type boolean;
             }
         }
-        // No output.
+        output {
+            leaf all-tx {
+                description "Number of all transactions executed.";
+                type int64;
+                mandatory true;
+            }
+            leaf insert-tx {
+                description "Number of transactions that inserted data.";
+                type int64;
+                mandatory true;
+            }
+            leaf delete-tx {
+                description "Number of transactions that deleted data.";
+                type int64;
+                mandatory true;
+            }
+        }
     }
 
     rpc produce-transactions {
@@ -274,36 +321,62 @@ module odl-mdsal-lowlevel-control {
                 type boolean;
             }
         }
-        // No output.
+        output {
+            leaf all-tx {
+                description "Number of all transactions executed.";
+                type int64;
+                mandatory true;
+            }
+            leaf insert-tx {
+                description "Number of transactions that inserted data.";
+                type int64;
+                mandatory true;
+            }
+            leaf delete-tx {
+                description "Number of transactions that deleted data.";
+                type int64;
+                mandatory true;
+            }
+        }
     }
 
-    rpc become-prefix-leader {
-        description "Upon receiving this, the member shall ask the appropriate API
-            to become Leader of the given shard (presumably the llt:list-ints one,
-            created by produce-transactions) and return immediatelly.";
+    rpc create-prefix-shard {
+        description "Upon receiving this, the member creates a prefix shard at the instance-identifier, with replicas
+                on the required members.";
         input {
-            leaf shard-name {
-                description "TBD.
 
-                FIXME: Ask Java implementation developer about the format needed.";
+            leaf prefix {
                 mandatory true;
+                type instance-identifier;
+            }
+            leaf-list replicas {
+                min-elements 1;
                 type string;
             }
         }
-        // No output.
     }
 
-    rpc become-module-leader {
-        description "Upon receiving this, the member shall ask appropriate API
-            to become Leader of given config shard and return immediatelly.";
+    rpc remove-prefix-shard {
+        description "Upon receiving this, the member removes the prefix based shard identifier by this prefix.
+                This must be called from the same node that created the shard.";
+
         input {
-            leaf shard-name {
-                description "TBD.
+            leaf prefix {
+                mandatory true;
+                type instance-identifier;
+            }
+        }
+    }
 
-                FIXME: Ask Java implementation developer about the format needed.
-                TODO: Perhaps the names are compatible and one 'become-leader' would suffice?";
+
+    rpc become-prefix-leader {
+        description "Upon receiving this, the member shall ask the appropriate API
+            to become Leader of the given shard (presumably the llt:list-ints one,
+            created by produce-transactions) and return immediatelly.";
+        input {
+            leaf prefix {
                 mandatory true;
-                type string;
+                type instance-identifier;
             }
         }
         // No output.
@@ -357,12 +430,10 @@ module odl-mdsal-lowlevel-control {
     rpc subscribe-dtcl {
         description "Upon receiving this, the member checks whether it has already subscribed
             and fails if yes. If no, the member subscribes a Data Tree Change Listener
-            to listen for changes on whole llt:id-ints, and stores the state
-            from the initial notification to a local variable (called the local copy).
-            Each Data Tree Change from further Notifications shall be applied
-            to the local copy if it is compatible
-            (the old state from notification is equal to the local copy state).
-            If a notification is not compatible, it shall be ignored.";
+            to listen for changes on whole llt:id-ints. The first notification received is stored immediately.
+            Every notification received after the first one has the data(getDataBefore()) compared with the
+            last stored notification(called local copy), if they match the local copy is overwritten with
+            this notifications data(getDataAfter()). If they don't match the new notification is ignored.";
         // No input.
         // No output.
     }
@@ -442,4 +513,15 @@ module odl-mdsal-lowlevel-control {
         // No output.
     }
 
+    rpc shutdown-shard-replica {
+        description "Upon receiving this, the member will try to gracefully shutdown local configuration
+            data store module-based shard replica.";
+        input {
+            leaf shard-name {
+                type string;
+                description "The name of the configuration data store module-based shard to be shutdown
+                    gracefully.";
+            }
+        }
+    }
 }