module yumaworks-lock {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:yumaworks-lock";
  prefix "ywlock";

  organization "YumaWorks, Inc.";

  contact
    "Support <support@yumaworks.com>";

  description
    "This module contains the <lock-all> and <unlock-all>
     operations. They can be used to lock and unlock
     all datastores at once.";

  revision 2023-04-29 {
    description
       "Initial version";
  }

  rpc lock-all {
    description
      "Lock all global configuration datastores.

       -  This always includes the <running> datastore.
       -  If the :candidate capability is supported then
          it also includes the <candidate> datastore.
       -  If the :startup capability is supported then
          it also includes the <startup> datastore.

       If all datastores are ok to lock by this session
       then the server will lock all-or-none
       configuration datastores and return 'ok'.

       If this operation is used to lock datastores then the
       'unlock-all' operation must be used to unlock all
       the datastores at once.  The 'unlock' operation
       will be rejected if the 'lock' operation was not used
       to obtain the datastore lock.

       If any datastore is not ok to lock, e.g. already locked
       by any session, then the server will
       return 'in-use' and not lock any datastores.";
   }

  rpc unlock-all {
    description
      "Unlock all global configuration datastores.

       -  This always includes the <running> datastore.
       -  If the :candidate capability is supported then
          it also includes the <candidate> datastore.
       -  If the :startup capability is supported then
          it also includes the <startup> datastore.

       If all datastores are ok to unlock by this session
       then the server will unlock all the datastores
        and return 'ok'.

       If the event any datastore is not ok to unlock
       the server will return the appropriate error.";
   }

}
