Expose entity details in MDSAL
[controller.git] / opendaylight / md-sal / eos-dom-akka / src / main / yang / odl-akka-eos.yang
1 module odl-entity-owners {
2   namespace urn:opendaylight:params:xml:ns:yang:controller:entity-owners;
3   prefix entity-owners;
4
5   organization 'OpenDaylight Project';
6   description "An initial cut at modeling entity ownership status information
7                in a way which is not dependent on the datastore.
8
9                This model is considered experimental and
10                implementation-specific. It can change incompatibly between
11                OpenDaylight releases.";
12
13   typedef entity-type {
14     type string {
15       length 1..max;
16       // FIXME: it would be nice to have a pattern here, or even better
17       //        if we turn this into an extensible enum (i.e. identityref)
18     }
19   }
20
21   typedef entity-name {
22     type string {
23       length 1..max;
24     }
25   }
26
27   typedef node-name {
28     type string {
29       length 1..max;
30     }
31   }
32
33   grouping entity-id {
34     leaf type {
35       type entity-type;
36       mandatory true;
37     }
38     leaf name {
39       type entity-name;
40       mandatory true;
41     }
42   }
43
44   grouping owner {
45     leaf owner-node {
46       type node-name;
47     }
48   }
49
50   grouping candidates {
51     leaf-list candidate-nodes {
52       type node-name;
53       ordered-by user;
54       min-elements 1;
55     }
56   }
57
58   grouping details {
59      uses owner;
60      uses candidates;
61   }
62
63   rpc get-entities {
64     output {
65       list entities {
66         key 'type name';
67         uses entity-id;
68         uses details;
69       }
70     }
71   }
72
73   rpc get-entity {
74     input {
75       uses entity-id;
76     }
77
78     output {
79       uses details;
80     }
81   }
82
83   rpc get-entity-owner {
84     input {
85       uses entity-id;
86     }
87
88     output {
89       uses owner;
90     }
91   }
92 }
93