Fix eos entity lookups with YangInstanceIdentifier
[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 union {
23       type instance-identifier;
24       type string {
25         length 1..max;
26       }
27     }
28   }
29
30   typedef node-name {
31     type string {
32       length 1..max;
33     }
34   }
35
36   grouping entity-id {
37     leaf type {
38       type entity-type;
39       mandatory true;
40     }
41     leaf name {
42       type entity-name;
43       mandatory true;
44     }
45   }
46
47   grouping owner {
48     leaf owner-node {
49       type node-name;
50     }
51   }
52
53   grouping candidates {
54     leaf-list candidate-nodes {
55       type node-name;
56       ordered-by user;
57       min-elements 1;
58     }
59   }
60
61   grouping details {
62      uses owner;
63      uses candidates;
64   }
65
66   rpc get-entities {
67     output {
68       list entities {
69         key 'type name';
70         uses entity-id;
71         uses details;
72       }
73     }
74   }
75
76   rpc get-entity {
77     input {
78       uses entity-id;
79     }
80
81     output {
82       uses details;
83     }
84   }
85
86   rpc get-entity-owner {
87     input {
88       uses entity-id;
89     }
90
91     output {
92       uses owner;
93     }
94   }
95 }
96