2 Documentation Keywords wrapping controller's odl-mdsal-lowlevel yang model rpcs.
4 ... This is just an initial skeleton implementation, calls are debugged. Multiple
5 ... changes will follow as suites will be implemented.
6 ... This suite should be preferably merged before any suite to avoid conflicting
7 ... situations while suites will be implementing.
9 ... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
11 ... This program and the accompanying materials are made available under the
12 ... terms of the Eclipse Public License v1.0 which accompanies this distribution,
13 ... and is available at http://www.eclipse.org/legal/epl-v10.html
15 Resource ${CURDIR}/ClusterManagement.robot
16 Resource ${CURDIR}/TemplatedRequests.robot
19 ${RPC_DIR} ${CURDIR}/../variables/mdsal/lowlevelrpc
20 ${ADD_SHARD_REPLICA_DIR} ${RPC_DIR}/add_shard_replica
21 ${BECOME_MODULE_LEADER_DIR} ${RPC_DIR}/become_module_leader
22 ${BECOME_PREFIX_LEADER_DIR} ${RPC_DIR}/become_prefix_leader
23 ${DECONFIGURE_ID_INTS_SHARD_DIR} ${RPC_DIR}/deconfigure_id_ints_shard
24 ${GET_CONSTANT_DIR} ${RPC_DIR}/get_constant
25 ${GET_CONTEXTED_CONSTANT_DIR} ${RPC_DIR}/get_contexted_constant
26 ${GET_SINGLETON_CONSTANT_DIR} ${RPC_DIR}/get_singleton_constant
27 ${IS_CLIENT_ABORTED_DIR} ${RPC_DIR}/is_client_aborted
28 ${PRODUCE_TRANSACTIONS_DIR} ${RPC_DIR}/produce_transactions
29 ${PUBLISH_NOTIFICATIONS_DIR} ${RPC_DIR}/publish_notifications
30 ${REGISTER_BOUND_CONSTANT_DIR} ${RPC_DIR}/register_bound_constant
31 ${REGISTER_CONSTANT_DIR} ${RPC_DIR}/register_constant
32 ${REGISTER_DEFAULT_CONSTANT_DIR} ${RPC_DIR}/register_default_constant
33 ${REGISTER_FLAPPING_SINGLETON_DIR} ${RPC_DIR}/register_flapping_singleton
34 ${REGISTER_SINGLETON_CONSTANT_DIR} ${RPC_DIR}/register_singleton_constant
35 ${REMOVE_SHARD_REPLICA_DIR} ${RPC_DIR}/remove_shard_replica
36 ${SUBSCRIBE_DDTL_DIR} ${RPC_DIR}/subscribe_ddtl
37 ${SUBSCRIBE_DTCL_DIR} ${RPC_DIR}/subscribe_dtcl
38 ${SUBSCRIBE_YNL_DIR} ${RPC_DIR}/subscribe_ynl
39 ${UNREGISTER_BOUND_CONSTANT_DIR} ${RPC_DIR}/unregister_bound_constant
40 ${UNREGISTER_CONSTANT_DIR} ${RPC_DIR}/unregister_constant
41 ${UNREGISTER_DEFAULT_CONSTANT_DIR} ${RPC_DIR}/unregister_default_constant
42 ${UNREGISTER_FLAPPING_SINGLETON_DIR} ${RPC_DIR}/unregister_flapping_singleton
43 ${UNREGISTER_SINGLETON_CONSTANT_DIR} ${RPC_DIR}/unregister_singleton_constant
44 ${UNSUBSCRIBE_DDTL_DIR} ${RPC_DIR}/unsubscribe_ddtl
45 ${UNSUBSCRIBE_DTCL_DIR} ${RPC_DIR}/unsubscribe_dtcl
46 ${UNSUBSCRIBE_YNL_DIR} ${RPC_DIR}/unsubscribe_ynl
47 ${WRITE_TRANSACTIONS_DIR} ${RPC_DIR}/write_transactions
51 [Arguments] ${member_index} ${explicit_status_codes}=${NO_STATUS_CODES}
52 [Documentation] Invoke get-constant rpc on the requested member and return the registered constant. The ${explicit_status_codes} is a list
53 ... of http status codes for which the rpc call is considered as passed and is used for calls with expected failures on odl's side, such as
54 ... calling the rpc on isolated node etc.
55 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
56 ${text} = TemplatedRequests.Post_As_Xml_Templated ${GET_CONSTANT_DIR} session=${session} explicit_status_codes=${explicit_status_codes}
57 ${xml} = XML.Parse_Xml ${text}
58 ${constant} = XML.Get_Element_Text ${xml} xpath=constant
59 BuiltIn.Return_From_Keyword ${constant}
61 Get_Contexted_Constant
62 [Arguments] ${member_index} ${context}
63 [Documentation] Invoke get-contexted-constant rpc on the requested member and return the registered constant. The argument ${context} is only the string part
64 ... of the whole instance identifier. The ${explicit_status_codes} is a list of http status codes for which the rpc call is considered as passed and is used for
65 ... calls with expected failures on odl's side, such as calling the rpc on isolated node etc.
66 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
67 &{mapping} BuiltIn.Create_Dictionary CONTEXT=${context}
68 ${text} = TemplatedRequests.Post_As_Xml_Templated ${GET_CONTEXTED_CONSTANT_DIR} mapping=${mapping} session=${session}
69 ${xml} = XML.Parse_Xml ${text}
70 ${constant} = XML.Get_Element_Text ${xml} xpath=constant
71 BuiltIn.Return_From_Keyword ${constant}
73 Get_Singleton_Constant
74 [Arguments] ${member_index}
75 [Documentation] TODO: more desctiptive comment than: Invoke get-singleton-constant rpc.
76 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
77 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${GET_SINGLETON_CONSTANT_DIR} base_name=location extension=uri
78 ${text} = TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
79 BuiltIn.Fail TODO: to format output data
80 BuiltIn.Return_From_Keyword ${formatted_output}
83 [Arguments] ${member_index} ${constant}
84 [Documentation] Register the get-constant rpc on the requested node with given constant.
85 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
86 &{mapping} BuiltIn.Create_Dictionary CONSTANT=${constant}
87 TemplatedRequests.Post_As_Xml_Templated ${REGISTER_CONSTANT_DIR} mapping=${mapping} session=${session}
90 [Arguments] ${member_index}
91 [Documentation] Unregister the get-constant rpc on the given node.
92 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
93 TemplatedRequests.Post_As_Xml_Templated ${UNREGISTER_CONSTANT_DIR} session=${session}
95 Register_Singleton_Constant
96 [Arguments] ${member_index} ${constant}
97 [Documentation] TODO: more desctiptive comment than: Invoke register-singleton-constant rpc.
98 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
99 &{mapping} BuiltIn.Create_Dictionary CONSTANT=${constant}
100 TemplatedRequests.Post_As_Xml_Templated ${REGISTER_SINGLETON_CONSTANT_DIR} mapping=${mapping} session=${session}
102 Unregister_Singleton_Constant
103 [Arguments] ${member_index}
104 [Documentation] TODO: more desctiptive comment than: Invoke unregister-singleton-constant rpc.
105 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
106 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${UNREGISTER_SINGLETON_CONSTANT_DIR} base_name=location extension=uri
107 ${text} = TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
109 Register_Flapping_Singleton
110 [Arguments] ${member_index}
111 [Documentation] TODO: more desctiptive comment than: Invoke register-flapping-singleton rpc.
112 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
113 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${REGISTER_FLAPPING_SINGLETON_DIR} base_name=location extension=uri
114 TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
116 Unregister_Flapping_Singleton
117 [Arguments] ${member_index}
118 [Documentation] TODO: more desctiptive comment than: Invoke unregister-flapping-singleton rpc.
119 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
120 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${UNREGISTER_FLAPPING_SINGLETON_DIR} base_name=location extension=uri
121 ${text} = TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
124 [Arguments] ${member_index} ${seconds} ${trans_per_sec} ${chained_trans}=${True}
125 [Documentation] TODO: more desctiptive comment than: Invoke write-transactions rpc.
126 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
127 &{mapping} BuiltIn.Create_Dictionary SECONDS=${seconds} TPS=${trans_per_sec} CHAINED_TRANSACTIONS=${chained_trans}
128 TemplatedRequests.Post_As_Xml_Templated ${WRITE_TRANSACTIONS_DIR} mapping=${mapping} session=${session}
131 [Arguments] ${member_index} ${seconds} ${trans_per_sec} ${isolated_trans}=${True}
132 [Documentation] TODO: more desctiptive comment than: Invoke produce-transactions rpc.
133 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
134 &{mapping} BuiltIn.Create_Dictionary SECONDS=${seconds} TPS=${trans_per_sec} ISOLATED_TRANSACTIONS=${chained_trans}
135 TemplatedRequests.Post_As_Xml_Templated ${PRODUCE_TRANSACTIONS_DIR} mapping=${mapping} session=${session}
138 [Arguments] ${member_index} ${shard_name}
139 [Documentation] TODO: more desctiptive comment than: Invoke become-prefix-leader rpc.
140 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
141 &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name}
142 ${text} = TemplatedRequests.Post_As_Xml_Templated ${BECOME_PREFIX_LEADER_DIR} mapping=${mapping} session=${session}
145 [Arguments] ${member_index} ${shard_name}
146 [Documentation] TODO: more desctiptive comment than: Invoke become-module-leader rpc.
147 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
148 &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name}
149 ${text} = TemplatedRequests.Post_As_Xml_Templated ${BECOME_MODULE_LEADER_DIR} mapping=${mapping} session=${session}
152 [Arguments] ${member_index} ${shard_name}
153 [Documentation] TODO: more desctiptive comment than: Invoke remove-shard-replica rpc.
154 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
155 &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name}
156 TemplatedRequests.Post_As_Xml_Templated ${REMOVE_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
159 [Arguments] ${member_index} ${shard_name}
160 [Documentation] TODO: more desctiptive comment than: Invoke add-shard-replica rpc.
161 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
162 &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name}
163 TemplatedRequests.Post_As_Xml_Templated ${ADD_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
165 Deconfigure_Id_Ints_Shard
166 [Arguments] ${member_index}
167 [Documentation] TODO: more desctiptive comment than: Invoke deconfigure-id-ints-shard rpc.
168 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
169 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${DECONFIGURE_ID_INTS_SHARD_DIR} base_name=location extension=uri
170 TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
173 [Arguments] ${member_index}
174 [Documentation] TODO: more desctiptive comment than: Invoke is-client-aborted rpc.
175 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
176 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${IS_CLIENT_ABORTED_SHARD_DIR} base_name=location extension=uri
177 ${text} = TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
180 [Arguments] ${member_index}
181 [Documentation] TODO: more desctiptive comment than: Invoke subscribe-dtcl rpc.
182 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
183 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${SUBSCRIBE_DTCL_DIR} base_name=location extension=uri
184 TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
187 [Arguments] ${member_index}
188 [Documentation] TODO: more desctiptive comment than: Invoke unsubscribe-dtcl rpc.
189 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
190 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${UNSUBSCRIBE_DTCL_DIR} base_name=location extension=uri
191 ${text} = TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
194 [Arguments] ${member_index}
195 [Documentation] TODO: more desctiptive comment than: Invoke subscribe-ddtl rpc.
196 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
197 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${SUBSCRIBE_DDTL_DIR} base_name=location extension=uri
198 TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
201 [Arguments] ${member_index}
202 [Documentation] TODO: more desctiptive comment than: Invoke unsubscribe-ddtl rpc.
203 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
204 ${uri} = TemplatedRequests.Resolve_Text_From_Template_Folder folder=${UNSUBSCRIBE_DDTL_DIR} base_name=location extension=uri
205 ${text} = TemplatedRequests.Post_To_Uri uri=${uri} data=${EMPTY} accept=${ACCEPT_JSON} content_type=${HEADERS_YANG_JSON} session=${session}
207 Publish_Notifications
208 [Arguments] ${member_index} ${seconds} ${notif_per_sec}
209 [Documentation] TODO: more desctiptive comment than: Invoke publish-notifications rpc.
210 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
211 &{mapping} BuiltIn.Create_Dictionary SECONDS=${seconds} NPS=${notif_per_sec}
212 TemplatedRequests.Post_As_Xml_Templated ${PUBLISH_NOTIFICATIONS_DIR} mapping=${mapping} session=${session}
215 [Arguments] ${member_index}
216 [Documentation] TODO: more desctiptive comment than: Invoke subscribe-ynl rpc.
217 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
218 &{mapping} BuiltIn.Create_Dictionary
219 TemplatedRequests.Post_As_Xml_Templated ${SUBSCRIBE_YNL_DIR} mapping=${mapping} session=${session}
222 [Arguments] ${member_index}
223 [Documentation] TODO: more desctiptive comment than: Invoke unsubscribe-ynl rpc.
224 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
225 &{mapping} BuiltIn.Create_Dictionary
226 ${text} = TemplatedRequests.Post_As_Xml_Templated ${UNSUBSCRIBE_YNL_DIR} mapping=${mapping} session=${session}
228 Register_Bound_Constant
229 [Arguments] ${member_index} ${context} ${constant}
230 [Documentation] Invoke register-bound-constant rpc and register get-contexted-constant rpc. The argument ${context} is only the string part
231 ... of the whole instance identifier.
232 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
233 &{mapping} BuiltIn.Create_Dictionary CONTEXT=${context} CONSTANT=${constant}
234 ${text} = TemplatedRequests.Post_As_Xml_Templated ${REGISTER_BOUND_CONSTANT_DIR} mapping=${mapping} session=${session}
236 Unregister_Bound_Constant
237 [Arguments] ${member_index} ${context}
238 [Documentation] Invoke unregister-bound-constant rpc and unregister get-contexted-constant rpc. The argument ${context} is only the string part
239 ... of the whole instance identifier.
240 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
241 &{mapping} BuiltIn.Create_Dictionary CONTEXT=${context}
242 TemplatedRequests.Post_As_Xml_Templated ${UNREGISTER_BOUND_CONSTANT_DIR} mapping=${mapping} session=${session}
244 Register_Default_Constant
245 [Arguments] ${member_index} ${constant}
246 [Documentation] TODO: more desctiptive comment than: Invoke register-default-constant rpc.
247 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
248 &{mapping} BuiltIn.Create_Dictionary CONSTANT=${constant}
249 TemplatedRequests.Post_As_Xml_Templated ${REGISTER_DEFAULT_CONSTANT_DIR} mapping=${mapping} session=${session}
251 Unregister_Default_Constant
252 [Arguments] ${member_index}
253 [Documentation] TODO: more desctiptive comment than: Invoke unregister-default-constant rpc.
254 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
255 TemplatedRequests.Post_As_Xml_Templated ${REGISTER_DEFAULT_CONSTANT_DIR} session=${session}