8b22d666a6ae9faf45e966c58cc82842ec3a50ba
[ccsdk/sli/plugins.git] / grToolkit / model / src / main / yang / gr-toolkit.yang
1 module gr-toolkit{\r
2   namespace "org:onap:ccsdk:sli:plugins:gr-toolkit";\r
3   prefix gr-toolkit;\r
4 \r
5   import ietf-inet-types {\r
6     prefix inet;\r
7   }\r
8   import ietf-yang-types {\r
9     prefix yang;\r
10   }\r
11   description\r
12     "This ODL feature is designed to gauge the health of all cluster members.";\r
13   revision "2018-09-26" {\r
14     description\r
15       "Release 19.02 draft";\r
16   }\r
17 \r
18   grouping member {\r
19     leaf address {\r
20       type string;\r
21       mandatory true;\r
22     }\r
23     leaf role {\r
24       type string;\r
25       mandatory true;\r
26     }\r
27     leaf up {\r
28       type boolean;\r
29       mandatory true;\r
30     }\r
31     leaf unreachable {\r
32       type boolean;\r
33       mandatory true;\r
34     }\r
35     leaf voting {\r
36       type boolean;\r
37       mandatory true;\r
38     }\r
39     list leader {\r
40       leaf shard {\r
41         type string;\r
42         mandatory true;\r
43       }\r
44     }\r
45     list replicas {\r
46       leaf shard {\r
47         type string;\r
48         mandatory true;\r
49       }\r
50     }\r
51     list commit-status {\r
52       leaf shard {\r
53         type string;\r
54         mandatory true;\r
55       }\r
56       leaf delta {\r
57         type int32;\r
58         mandatory true;\r
59       }\r
60     }\r
61   }\r
62 \r
63   grouping site {\r
64     leaf id {\r
65       type string;\r
66       mandatory true;\r
67     }\r
68     leaf role {\r
69       type string;\r
70       mandatory true;\r
71     }\r
72     leaf health {\r
73       type string;\r
74       mandatory true;\r
75     }\r
76   }\r
77 \r
78   grouping node {\r
79     leaf node { \r
80       type string;\r
81       mandatory true;\r
82     }\r
83     leaf port { \r
84       type string;\r
85       mandatory true;\r
86     }\r
87   }\r
88 \r
89   rpc cluster-health {\r
90     description\r
91       "Parses akka.conf for seed nodes and queries Jolokia for the health\r
92       of each node.";\r
93     output {\r
94       leaf status { type string; }\r
95       leaf message { type string; }\r
96       leaf site1-health { type string; }\r
97       leaf site2-health { type string; }\r
98       list members {\r
99         uses member;\r
100       }\r
101     }\r
102   }\r
103 \r
104   rpc database-health {\r
105     description\r
106       "Uses DbLibService connection info to determine if the database is reachable.";\r
107     output {\r
108       leaf status { type string; }\r
109       leaf health { type string; }\r
110     }\r
111   }\r
112 \r
113   rpc admin-health {\r
114     description\r
115       "Pings the admin portal health check to determine if the admin portal is reachable.";\r
116     output {\r
117       leaf status { type string; }\r
118       leaf health { type string; }\r
119     }\r
120   }\r
121 \r
122   rpc site-health {\r
123     description\r
124       "Gathers health information on the ODL cluster, database, and admin portal\r
125       to determine if the entire site is in a healthy state.";\r
126     output {\r
127       leaf status { type string; }\r
128       list sites {\r
129         uses site;\r
130       }\r
131     }\r
132   }\r
133 \r
134   rpc site-identifier {\r
135     description\r
136       "Returns the unique site identifier.";\r
137     output {\r
138       leaf status { type string; }\r
139       leaf id { type string; mandatory true; }\r
140     }\r
141   }\r
142 \r
143   rpc halt-akka-traffic {\r
144     description\r
145       "Executes IP Tables commands to halt traffic to the akka port.";\r
146     input {\r
147       list node-info {\r
148         uses node;\r
149       }\r
150     }\r
151     output {\r
152       leaf status { type string; }\r
153     }\r
154   }\r
155 \r
156   rpc resume-akka-traffic {\r
157     description\r
158       "Executes IP Tables commands to resume traffic to the akka port.";\r
159     input {\r
160       list node-info {\r
161         uses node;\r
162       }\r
163     }\r
164     output {\r
165       leaf status { type string; }\r
166     }\r
167   }\r
168 \r
169   rpc failover {\r
170     description\r
171       "Performs a failover from primary site to standby site.";\r
172     input {\r
173       leaf backupData {\r
174         type string;\r
175         default "false";\r
176       }\r
177       leaf isolate {\r
178         type string;\r
179         default "false";\r
180       }\r
181       leaf downUnreachable {\r
182         type string;\r
183         default "false";\r
184       }\r
185     }\r
186     output {\r
187       leaf status { type string; }\r
188       leaf message { type string; }\r
189     }\r
190   }\r
191 }\r