module lock-manager { namespace "urn:opendaylight:vpnservice:lockmanager"; prefix lockmgr; revision "2015-08-19" { description "YANG model describes methods that ensure locking while accessing the datastore"; } typedef time-units { type enumeration { enum days; enum hours; enum microseconds; enum milliseconds; enum minutes; enum nanoseconds; enum seconds; } } container locks { description "Holds the list of lock name and lock owner"; list lock { key "lock-name"; leaf lock-name { type string; mandatory true; } leaf lock-owner { type string; mandatory true; } } } rpc lock { description "Method that checks if its locked already. If not adds the lock to the list of locks. Else tries until it acquires the lock"; input { leaf lock-name { type string; mandatory true; } } } rpc try-lock { description "Method that checks if its locked already. If not adds the lock to the list of locks. Else tries for the specified time"; input { leaf lock-name { type string; mandatory true; } leaf time { type uint32; } leaf time-unit { type time-units; } } } rpc unlock { description "Method that removes the lock from the list of locks"; input { leaf lock-name { type string; mandatory true; } } } }