Bump versions by 0.1.0 for next dev cycle
[vpnservice.git] / idmanager / idmanager-api / src / main / yang / id-manager.yang
1 module id-manager {
2     namespace "urn:opendaylight:vpnservice:idmanager";
3     prefix idmgr;
4
5     revision "2015-04-03" {
6         description "YANG model describes methods for allocating or releasing Ids as well as to create/delete Id Pools. The child pools
7                       are created inside the IdManager. This helps to improve ID Pool scalability/performance";
8     }
9
10     container id-pools {
11       description "Parent Id Pool is responsible allocating block (or) set of Ids to child Id Pools. The number of child pools are determined using some algorthimic approach inside IdManager. For example,  spawning child pools based on Id allocation request rate for the given Pool, one child pool per blade in the cluster etc";
12       config true;
13       list id-pool {
14         key "pool-name";
15         leaf pool-name {
16             type string;
17             mandatory true;
18         }
19         leaf block-size {
20             type uint16;
21             mandatory true;
22         }
23         leaf parent-pool-name {
24             type string;
25         }
26         list child-pools {
27             key "child-pool-name";
28             leaf child-pool-name {
29                 type string;
30                 mandatory true;
31             }
32             leaf last-access-time {
33                 type uint32;
34             }
35         }
36         list id-entries {
37             description "Id entry for the given Id Pool, where id-key is used to identify the id entry";
38             key "id-key";
39             leaf id-key { type string;}
40             leaf id-value { type uint32;}
41         }
42         container available-ids-holder {
43             uses available-ids;
44         }
45         container released-ids-holder {
46             uses released-ids;
47         }
48       }
49     }
50
51     grouping available-ids {
52         leaf start {
53             type uint32;
54         }
55         leaf end {
56             type uint32;
57         }
58         leaf cursor {
59             type int64;
60         }
61     }
62
63     grouping released-ids {
64         leaf available-id-count {
65             type uint32;
66         }
67         leaf delayed-time-sec {
68             type uint32;
69             mandatory true;
70         }
71         list delayed-id-entries {
72             uses delayed-id-entry;
73         }
74     }
75
76     grouping delayed-id-entry {
77         leaf id {
78             type uint32;
79             mandatory true;
80         }
81         leaf ready-time-sec {
82             type uint32;
83             mandatory true;
84         }
85     }
86
87     rpc createIdPool {
88         input {
89             leaf pool-name {
90                 type string;
91             }
92             leaf low {
93                 type uint32;
94             }
95             leaf high {
96                 type uint32;
97             }
98         }
99     }
100
101     rpc deleteIdPool {
102         input {
103             leaf pool-name {
104                 type string;
105             }
106         }
107     }
108
109     rpc allocateId {
110         input {
111              leaf pool-name {
112                 type string;
113              }
114              leaf id-key {
115                 type string;
116              }
117         }
118         output {
119             leaf id-value {
120                 type uint32;
121             }
122         }
123     }
124
125     rpc releaseId {
126         input {
127              leaf pool-name {
128                 type string;
129              }
130              leaf id-key {
131                 type string;
132              }
133         }
134     }
135 }