Bug 4105: Add entity-owners yang module
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / yang / entity-owners.yang
1 module entity-owners {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:clustering:entity-owners";
4     prefix "entity-owners";
5
6     description
7         "This module contains the base YANG definitions for
8         an implementation of the EntityOwnershipService which stores
9         entity ownership information in the data store";
10
11     revision "2015-08-04" {
12         description "Initial revision.";
13     }
14
15     container entity-owners {
16
17         // The entity-owner list contains a list of all entities which have been assigned an owner
18         // Since an owner will be a cluster member it gives us a quick way to figure out all the entities
19         // that will need to have new owners assigned on the failure of a given cluster member
20         list entity-owner {
21             key name;
22             leaf name {
23                 type string;
24             }
25
26             // Group all entities of a given type together
27             list entity-type {
28                 key type;
29                 leaf type {
30                     type string;
31                 }
32
33                 list entity {
34                     key id;
35                     leaf id {
36                         type string;
37                     }
38                 }
39             }
40         }
41
42         // A list of all entities grouped by type
43         list entity-type {
44             key type;
45             leaf type {
46                 type string;
47             }
48
49             list entity {
50                 key id;
51                 leaf id {
52                     type string;
53                 }
54
55                 // A list of all the candidates that would like to own the entity
56                 list candidate {
57                     key id;
58                     leaf id {
59                         type string;
60                     }
61                 }
62             }
63         }
64     }
65 }