[CCSDK-1298] Add served-by field
[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 served-by { type string; }\r
97       leaf site1-health { type string; }\r
98       leaf site2-health { type string; }\r
99       list members {\r
100         uses member;\r
101       }\r
102     }\r
103   }\r
104 \r
105   rpc database-health {\r
106     description\r
107       "Uses DbLibService connection info to determine if the database is reachable.";\r
108     output {\r
109       leaf status { type string; }\r
110       leaf health { type string; }\r
111       leaf served-by { type string; }\r
112     }\r
113   }\r
114 \r
115   rpc admin-health {\r
116     description\r
117       "Pings the admin portal health check to determine if the admin portal is reachable.";\r
118     output {\r
119       leaf status { type string; }\r
120       leaf health { type string; }\r
121       leaf served-by { type string; }\r
122     }\r
123   }\r
124 \r
125   rpc site-health {\r
126     description\r
127       "Gathers health information on the ODL cluster, database, and admin portal\r
128       to determine if the entire site is in a healthy state.";\r
129     output {\r
130       leaf status { type string; }\r
131       leaf served-by { type string; }\r
132       list sites {\r
133         uses site;\r
134       }\r
135     }\r
136   }\r
137 \r
138   rpc site-identifier {\r
139     description\r
140       "Returns the unique site identifier.";\r
141     output {\r
142       leaf status { type string; }\r
143       leaf served-by { type string; }\r
144       leaf id { type string; mandatory true; }\r
145     }\r
146   }\r
147 \r
148   rpc halt-akka-traffic {\r
149     description\r
150       "Executes IP Tables commands to halt traffic to the akka port.";\r
151     input {\r
152       list node-info {\r
153         uses node;\r
154       }\r
155     }\r
156     output {\r
157       leaf status { type string; }\r
158       leaf served-by { type string; }\r
159     }\r
160   }\r
161 \r
162   rpc resume-akka-traffic {\r
163     description\r
164       "Executes IP Tables commands to resume traffic to the akka port.";\r
165     input {\r
166       list node-info {\r
167         uses node;\r
168       }\r
169     }\r
170     output {\r
171       leaf status { type string; }\r
172       leaf served-by { type string; }\r
173     }\r
174   }\r
175 \r
176   rpc failover {\r
177     description\r
178       "Performs a failover from primary site to standby site.";\r
179     input {\r
180       leaf backupData {\r
181         type string;\r
182         default "false";\r
183       }\r
184       leaf isolate {\r
185         type string;\r
186         default "false";\r
187       }\r
188       leaf downUnreachable {\r
189         type string;\r
190         default "false";\r
191       }\r
192     }\r
193     output {\r
194       leaf status { type string; }\r
195       leaf message { type string; }\r
196       leaf served-by { type string; }\r
197     }\r
198   }\r
199 }\r