]>
Commit | Line | Data |
---|---|---|
ef43a632 CH |
1 | // SPDX-License-Identifier: ISC |
2 | // | |
3 | // mgmt.proto | |
4 | // | |
5 | // @copyright Copyright (C) 2021 Vmware, Inc. | |
6 | // | |
7 | // @author Pushpasis Sarkar <spushpasis@vmware.com> | |
8 | // | |
9 | ||
10 | syntax = "proto2"; | |
11 | ||
12 | // | |
13 | // Protobuf definitions pertaining to the MGMTD component. | |
14 | // | |
15 | ||
16 | package mgmtd; | |
17 | ||
18 | // | |
19 | // Common Sub-Messages | |
20 | // | |
21 | ||
22 | message YangDataXPath { | |
23 | required string xpath = 1; | |
24 | } | |
25 | ||
26 | message YangDataValue { | |
27 | oneof value { | |
28 | // | |
29 | // NOTE: For now let's use stringized value ONLY. | |
30 | // We will enhance it later to pass native-format | |
31 | // if needed. | |
32 | // | |
33 | // bool bool_val = 2; | |
34 | // double double_val = 3; | |
35 | // float float_val = 4; | |
36 | // string string_val = 5; | |
37 | // bytes bytes_val = 6; | |
38 | // int32 int32_val = 7; | |
39 | // int64 int64_val = 8; | |
40 | // uint32 uint32_val = 9; | |
41 | // uint64 uint64_val = 10; | |
42 | // int32 int8_val = 11; | |
43 | // uint32 uint8_val = 12; | |
44 | // int32 int16_val = 13; | |
45 | // uint32 uint16_val = 14; | |
46 | string encoded_str_val = 100; | |
47 | } | |
48 | } | |
49 | ||
50 | message YangData { | |
51 | required string xpath = 1; | |
52 | optional YangDataValue value = 2; | |
53 | } | |
54 | ||
55 | enum CfgDataReqType { | |
56 | REQ_TYPE_NONE = 0; | |
57 | SET_DATA = 1; | |
58 | DELETE_DATA = 2; | |
59 | } | |
60 | ||
61 | message YangCfgDataReq { | |
62 | required YangData data = 1; | |
63 | required CfgDataReqType req_type = 2; | |
64 | } | |
65 | ||
66 | message YangGetDataReq { | |
67 | required YangData data = 1; | |
68 | required int64 next_indx = 2; | |
69 | } | |
70 | ||
71 | // | |
72 | // Backend Interface Messages | |
73 | // | |
74 | message BeSubscribeReq { | |
75 | required string client_name = 1; | |
76 | required bool subscribe_xpaths = 2; | |
77 | repeated string xpath_reg = 3; | |
78 | } | |
79 | ||
80 | message BeSubscribeReply { | |
81 | required bool success = 1; | |
82 | } | |
83 | ||
84 | message BeTxnReq { | |
85 | required uint64 txn_id = 1; | |
86 | required bool create = 2; | |
87 | } | |
88 | ||
89 | message BeTxnReply { | |
90 | required uint64 txn_id = 1; | |
91 | required bool create = 2; | |
92 | required bool success = 3; | |
93 | } | |
94 | ||
95 | message BeCfgDataCreateReq { | |
96 | required uint64 txn_id = 1; | |
97 | required uint64 batch_id = 2; | |
98 | repeated YangCfgDataReq data_req = 3; | |
99 | required bool end_of_data = 4; | |
100 | } | |
101 | ||
102 | message BeCfgDataCreateReply { | |
103 | required uint64 txn_id = 1; | |
104 | required uint64 batch_id = 2; | |
105 | required bool success = 3; | |
106 | optional string error_if_any = 4; | |
107 | } | |
108 | ||
ef43a632 CH |
109 | message BeCfgDataApplyReq { |
110 | required uint64 txn_id = 1; | |
111 | } | |
112 | ||
113 | message BeCfgDataApplyReply { | |
114 | required uint64 txn_id = 1; | |
115 | repeated uint64 batch_ids = 2; | |
116 | required bool success = 3; | |
117 | optional string error_if_any = 4; | |
118 | } | |
119 | ||
120 | message BeOperDataGetReq { | |
121 | required uint64 txn_id = 1; | |
122 | required uint64 batch_id = 2; | |
123 | repeated YangGetDataReq data = 3; | |
124 | } | |
125 | ||
126 | message YangDataReply { | |
127 | repeated YangData data = 1; | |
128 | required int64 next_indx = 2; | |
129 | } | |
130 | ||
131 | message BeOperDataGetReply { | |
132 | required uint64 txn_id = 1; | |
133 | required uint64 batch_id = 2; | |
134 | required bool success = 3; | |
135 | optional string error = 4; | |
136 | optional YangDataReply data = 5; | |
137 | } | |
138 | ||
139 | message BeOperDataNotify { | |
140 | required YangDataReply data = 5; | |
141 | } | |
142 | ||
143 | message BeConfigCmdReq { | |
144 | required string cmd = 1; | |
145 | } | |
146 | ||
147 | message BeConfigCmdReply { | |
148 | required bool success = 1; | |
149 | required string error_if_any = 2; | |
150 | } | |
151 | ||
152 | message BeShowCmdReq { | |
153 | required string cmd = 1; | |
154 | } | |
155 | ||
156 | message BeShowCmdReply { | |
157 | required bool success = 1; | |
158 | required string cmd_ouput = 2; | |
159 | } | |
160 | ||
161 | // | |
162 | // Any message on the MGMTD Backend Interface. | |
163 | // | |
164 | message BeMessage { | |
165 | oneof message { | |
166 | BeSubscribeReq subscr_req = 2; | |
167 | BeSubscribeReply subscr_reply = 3; | |
168 | BeTxnReq txn_req = 4; | |
169 | BeTxnReply txn_reply = 5; | |
170 | BeCfgDataCreateReq cfg_data_req = 6; | |
171 | BeCfgDataCreateReply cfg_data_reply = 7; | |
7d65b7b7 CH |
172 | BeCfgDataApplyReq cfg_apply_req = 8; |
173 | BeCfgDataApplyReply cfg_apply_reply = 9; | |
174 | BeOperDataGetReq get_req = 10; | |
175 | BeOperDataGetReply get_reply = 11; | |
176 | BeOperDataNotify notify_data = 12; | |
177 | BeConfigCmdReq cfg_cmd_req = 13; | |
178 | BeConfigCmdReply cfg_cmd_reply = 14; | |
179 | BeShowCmdReq show_cmd_req = 15; | |
180 | BeShowCmdReply show_cmd_reply = 16; | |
ef43a632 CH |
181 | } |
182 | } | |
183 | ||
184 | ||
185 | // | |
186 | // Frontend Interface Messages | |
187 | // | |
188 | ||
189 | message FeRegisterReq { | |
190 | required string client_name = 1; | |
191 | } | |
192 | ||
193 | message FeSessionReq { | |
194 | required bool create = 1; | |
195 | oneof id { | |
196 | uint64 client_conn_id = 2; // Applicable for create request only | |
197 | uint64 session_id = 3; // Applicable for delete request only | |
198 | } | |
199 | } | |
200 | ||
201 | message FeSessionReply { | |
202 | required bool create = 1; | |
203 | required bool success = 2; | |
204 | optional uint64 client_conn_id = 3; // Applicable for create request only | |
205 | required uint64 session_id = 4; | |
206 | } | |
207 | ||
208 | enum DatastoreId { | |
209 | DS_NONE = 0; | |
210 | RUNNING_DS = 1; | |
211 | CANDIDATE_DS = 2; | |
212 | OPERATIONAL_DS = 3; | |
213 | STARTUP_DS = 4; | |
214 | } | |
215 | ||
216 | message FeLockDsReq { | |
217 | required uint64 session_id = 1; | |
218 | required uint64 req_id = 2; | |
219 | required DatastoreId ds_id = 3; | |
220 | required bool lock = 4; | |
221 | } | |
222 | ||
223 | message FeLockDsReply { | |
224 | required uint64 session_id = 1; | |
225 | required uint64 req_id = 2; | |
226 | required DatastoreId ds_id = 3; | |
227 | required bool lock = 4; | |
228 | required bool success = 5; | |
229 | optional string error_if_any = 6; | |
230 | } | |
231 | ||
232 | message FeSetConfigReq { | |
233 | required uint64 session_id = 1; | |
234 | required DatastoreId ds_id = 2; | |
235 | required uint64 req_id = 3; | |
236 | repeated YangCfgDataReq data = 4; | |
237 | required bool implicit_commit = 5; | |
238 | required DatastoreId commit_ds_id = 6; | |
239 | } | |
240 | ||
241 | message FeSetConfigReply { | |
242 | required uint64 session_id = 1; | |
243 | required DatastoreId ds_id = 2; | |
244 | required uint64 req_id = 3; | |
245 | required bool success = 4; | |
246 | optional string error_if_any = 5; | |
247 | } | |
248 | ||
249 | message FeCommitConfigReq { | |
250 | required uint64 session_id = 1; | |
251 | required DatastoreId src_ds_id = 2; | |
252 | required DatastoreId dst_ds_id = 3; | |
253 | required uint64 req_id = 4; | |
254 | required bool validate_only = 5; | |
255 | required bool abort = 6; | |
256 | } | |
257 | ||
258 | message FeCommitConfigReply { | |
259 | required uint64 session_id = 1; | |
260 | required DatastoreId src_ds_id = 2; | |
261 | required DatastoreId dst_ds_id = 3; | |
262 | required uint64 req_id = 4; | |
263 | required bool validate_only = 5; | |
264 | required bool success = 6; | |
265 | required bool abort = 7; | |
266 | optional string error_if_any = 8; | |
267 | } | |
268 | ||
269 | message FeGetConfigReq { | |
270 | required uint64 session_id = 1; | |
271 | required DatastoreId ds_id = 2; | |
272 | required uint64 req_id = 3; | |
273 | repeated YangGetDataReq data = 4; | |
274 | } | |
275 | ||
276 | message FeGetConfigReply { | |
277 | required uint64 session_id = 1; | |
278 | required DatastoreId ds_id = 2; | |
279 | required uint64 req_id = 3; | |
280 | required bool success = 4; | |
281 | optional string error_if_any = 5; | |
282 | optional YangDataReply data = 6; | |
283 | } | |
284 | ||
285 | message FeGetDataReq { | |
286 | required uint64 session_id = 1; | |
287 | required DatastoreId ds_id = 2; | |
288 | required uint64 req_id = 3; | |
289 | repeated YangGetDataReq data = 4; | |
290 | } | |
291 | ||
292 | message FeGetDataReply { | |
293 | required uint64 session_id = 1; | |
294 | required DatastoreId ds_id = 2; | |
295 | required uint64 req_id = 3; | |
296 | required bool success = 4; | |
297 | optional string error_if_any = 5; | |
298 | optional YangDataReply data = 6; | |
299 | } | |
300 | ||
301 | message FeNotifyDataReq { | |
302 | repeated YangData data = 1; | |
303 | } | |
304 | ||
305 | message FeRegisterNotifyReq { | |
306 | required uint64 session_id = 1; | |
307 | required DatastoreId ds_id = 2; | |
308 | required bool register_req = 3; | |
309 | required uint64 req_id = 4; | |
310 | repeated YangDataXPath data_xpath = 5; | |
311 | } | |
312 | ||
313 | message FeMessage { | |
314 | oneof message { | |
315 | FeRegisterReq register_req = 2; | |
316 | FeSessionReq session_req = 3; | |
317 | FeSessionReply session_reply = 4; | |
318 | FeLockDsReq lockds_req = 5; | |
319 | FeLockDsReply lockds_reply = 6; | |
320 | FeSetConfigReq setcfg_req = 7; | |
321 | FeSetConfigReply setcfg_reply = 8; | |
322 | FeCommitConfigReq commcfg_req = 9; | |
323 | FeCommitConfigReply commcfg_reply = 10; | |
324 | FeGetConfigReq getcfg_req = 11; | |
325 | FeGetConfigReply getcfg_reply = 12; | |
326 | FeGetDataReq getdata_req = 13; | |
327 | FeGetDataReply getdata_reply = 14; | |
328 | FeNotifyDataReq notify_data_req = 15; | |
329 | FeRegisterNotifyReq regnotify_req = 16; | |
330 | } | |
331 | } |