2 Documentation Keywords wrapping controller's cluster-admin yang model rpcs.
4 ... Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
6 ... This program and the accompanying materials are made available under the
7 ... terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ... and is available at http://www.eclipse.org/legal/epl-v10.html
10 Resource ${CURDIR}/ClusterManagement.robot
11 Resource ${CURDIR}/TemplatedRequests.robot
14 ${CLUSTERADMIN_RPC_DIR} ${CURDIR}/../variables/mdsal/clusteradmin
15 ${ADD_PREFIX_SHARD_REPLICA_DIR} ${CLUSTERADMIN_RPC_DIR}/add_prefix_shard_replica
16 ${ADD_SHARD_REPLICA_DIR} ${CLUSTERADMIN_RPC_DIR}/add_shard_replica
17 ${MAKE_LEADER_LOCAL_DIR} ${CLUSTERADMIN_RPC_DIR}/make_leader_local
18 ${REMOVE_PREFIX_SHARD_REPLICA_DIR} ${CLUSTERADMIN_RPC_DIR}/remove_prefix_shard_replica
19 ${REMOVE_SHARD_REPLICA_DIR} ${CLUSTERADMIN_RPC_DIR}/remove_shard_replica
20 ${GET_SHARD_ROLE_DIR} ${CLUSTERADMIN_RPC_DIR}/get_shard_role
21 ${GET_PREFIX_SHARD_ROLE_DIR} ${CLUSTERADMIN_RPC_DIR}/get_prefix_shard_role
25 [Arguments] ${member_index} ${shard_name} ${shard_type}
26 [Documentation] Makes the node to be a shard leader by invoking make-leader-local rpc.
27 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
28 &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name} SHARD_TYPE=${shard_type}
29 ${text} = TemplatedRequests.Post_As_Xml_Templated ${MAKE_LEADER_LOCAL_DIR} mapping=${mapping} session=${session}
31 Add_Prefix_Shard_Replica
32 [Arguments] ${member_index} ${shard_prefix} ${ds_type}
33 [Documentation] Add prefix shard replica to given member by invoking add-prefix-shard-replica rpc.
34 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
35 &{mapping} BuiltIn.Create_Dictionary SHARD_PREFIX=${shard_prefix} DATA_STORE_TYPE=${ds_type}
36 ${text} = TemplatedRequests.Post_As_Xml_Templated ${ADD_PREFIX_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
38 Remove_Prefix_Shard_Replica
39 [Arguments] ${member_index} ${shard_prefix} ${member_name} ${ds_type}
40 [Documentation] Remove prefix shard replica from the given member by invoking remove-prefix-shard-replica rpc.
41 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
42 &{mapping} BuiltIn.Create_Dictionary SHARD_PREFIX=${shard_prefix} MEMBER_NAME=${member_name} DATA_STORE_TYPE=${ds_type}
43 ${text} = TemplatedRequests.Post_As_Xml_Templated ${REMOVE_PREFIX_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
46 [Arguments] ${member_index} ${shard_name} ${ds_type}
47 [Documentation] Add shard replica to given member by invoking add-shard-replica rpc.
48 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
49 &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name} DATA_STORE_TYPE=${ds_type}
50 ${text} = TemplatedRequests.Post_As_Xml_Templated ${ADD_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
53 [Arguments] ${member_index} ${shard_name} ${member_name} ${ds_type}
54 [Documentation] Remove shard replica from the given member by invoking remove-shard-replica rpc.
55 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
56 &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name} MEMBER_NAME=${member_name} DATA_STORE_TYPE=${ds_type}
57 ${text} = TemplatedRequests.Post_As_Xml_Templated ${REMOVE_SHARD_REPLICA_DIR} mapping=${mapping} session=${session}
60 [Arguments] ${member_index} ${shard_name} ${ds_type}
61 [Documentation] Get shard member role.
62 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
63 &{mapping} BuiltIn.Create_Dictionary SHARD_NAME=${shard_name} DATA_STORE_TYPE=${ds_type}
64 ${text} = TemplatedRequests.Post_As_Xml_Templated ${GET_SHARD_ROLE_DIR} mapping=${mapping} session=${session}
65 ${xml} = XML.Parse_Xml ${text}
66 ${role} = XML.Get_Element_Text ${xml} xpath=role
67 BuiltIn.Return_From_Keyword ${role}
70 [Arguments] ${member_index} ${shard_prefix} ${ds_type}
71 [Documentation] Get prefix shard member role.
72 ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index}
73 &{mapping} BuiltIn.Create_Dictionary SHARD_PREFIX=${shard_prefix} DATA_STORE_TYPE=${ds_type}
74 ${text} = TemplatedRequests.Post_As_Xml_Templated ${GET_PREFIX_SHARD_ROLE_DIR} mapping=${mapping} session=${session}
75 ${xml} = XML.Parse_Xml ${text}
76 ${role} = XML.Get_Element_Text ${xml} xpath=role
77 BuiltIn.Return_From_Keyword ${role}