2 Documentation The main interface for interacting with RIC E2 Manager (E2Mgr).
3 ... It handles low level stuff like managing the http request library and
4 ... E2Mgr required fields
5 Library RequestsLibrary
8 Resource ../global_properties.robot
9 Resource ../json_templater.robot
12 ${E2MGR_BASE_PATH} v1/nodeb
13 ${E2MGR_ENDPOINT} ${GLOBAL_E2MGR_SERVER_PROTOCOL}://${GLOBAL_INJECTED_E2MGR_IP_ADDR}:${GLOBAL_E2MGR_SERVER_PORT}
14 ${E2MGR_SETUP_NODEB_TEMPLATE} robot/assets/templates/e2mgr_setup_nodeb.template
18 Run E2Mgr Health Check
19 [Documentation] Runs E2Mgr Health check
20 ${data_path} = Set Variable /v1/health
21 ${resp} = Run E2Mgr GET Request ${data_path}
24 [Documentation] Check NodeB Status
25 [Arguments] ${ran_name}
26 ${resp} = Run E2Mgr Get NodeB Request ${ran_name}
27 Should Be Equal As Strings ${resp.json()['connectionStatus']} CONNECTED
30 Run E2Mgr Get NodeB Request
31 [Documentation] Runs E2Mgr Get NodeB Request
32 [Arguments] ${ran_name}
33 ${data_path} = Set Variable ${E2MGR_BASE_PATH}/${ran_name}
34 ${resp} = Run E2Mgr GET Request ${data_path}
35 Should Be Equal As Strings ${resp.json()['ranName']} ${ran_name}
38 Run E2Mgr Get All NodeBs Request
39 [Documentation] Runs E2Mgr Get All NodeBs Request
40 ${data_path} = Set Variable ${E2MGR_BASE_PATH}/ids
41 ${resp} = Run E2Mgr GET Request ${data_path}
44 Run E2Mgr Setup NodeB X2
45 [documentation] Setup X2 NodeB via E2 Manager
46 [Arguments] ${ran_name} ${ran_ip} ${ran_port}
47 ${data_path} = Set Variable ${E2MGR_BASE_PATH}/x2-setup
48 ${dict} = Create Dictionary
49 ... ran_name=${ran_name}
51 ... ran_port=${ran_port}
52 ${data} = Fill JSON Template File ${E2MGR_SETUP_NODEB_TEMPLATE} ${dict}
53 ${resp} = Run E2Mgr POST Request ${data_path} ${data}
56 Run E2Mgr Setup NodeB Endc
57 [documentation] Setup Endc NodeB via E2 Manager
58 [Arguments] ${ran_name} ${ran_ip} ${ran_port}
59 ${data_path} = Set Variable ${E2MGR_BASE_PATH}/endc-setup
60 ${dict} = Create Dictionary ran_name=${ran_name} ran_ip=${ran_ip} ran_port=${ran_port}
61 ${data} = Fill JSON Template File ${E2MGR_SETUP_NODEB_TEMPLATE} ${dict}
62 ${resp} = Run E2Mgr POST Request ${data_path} ${data}
65 Run E2Mgr Delete NodeB
66 [documentation] Delete NodeB via E2 Manager
67 [Arguments] ${ran_name}
68 ${data_path} = Set Variable ${E2MGR_BASE_PATH}/${ran_name}
69 ${resp} = Run E2Mgr DELETE Request ${data_path}
73 [Documentation] Runs E2Mgr GET Request
74 [Arguments] ${data_path}
76 ... ${GLOBAL_INJECTED_E2MGR_USER}
77 ... ${GLOBAL_INJECTED_E2MGR_PASSWORD}
78 ${session} = Create Session e2mgr ${E2MGR_ENDPOINT} auth=${auth}
79 ${uuid} = Generate UUID
80 ${headers} = Create Dictionary
81 ... Accept=application/json
82 ... Content-Type=application/json
83 ${resp} = Get Request e2mgr ${data_path} headers=${headers}
84 Log Received response from E2Mgr ${resp.text}
85 Should Be True ${resp}
88 Run E2Mgr DELETE Request
89 [Documentation] Runs E2Mgr Delete Request
90 [Arguments] ${data_path}
92 ... ${GLOBAL_INJECTED_E2MGR_USER}
93 ... ${GLOBAL_INJECTED_E2MGR_PASSWORD}
94 ${session} = Create Session e2mgr ${E2MGR_ENDPOINT} auth=${auth}
95 ${uuid} = Generate UUID
96 ${headers} = Create Dictionary
97 ... Accept=application/json
98 ... Content-Type=application/json
99 ${resp} = Delete Request e2mgr ${data_path} headers=${headers}
100 Log Received response from E2Mgr ${resp.text}
101 Should Be True ${resp}
104 Run E2Mgr POST Request
105 [Documentation] Send an HTTP POST to the E2 Manager
106 [Arguments] ${data_path} ${data}
107 ${auth} = Create List
108 ... ${GLOBAL_INJECTED_E2MGR_USER}
109 ... ${GLOBAL_INJECTED_E2MGR_PASSWORD}
110 ${session} = Create Session e2mgr ${E2MGR_ENDPOINT} auth=${auth}
111 ${headers} = Create Dictionary
112 ... Accept=application/json
113 ... Content-Type=application/json
114 ${resp} = Post Request e2mgr
117 ... headers=${headers}
118 Log Received response from E2Mgr ${resp.text}
119 Should Be True ${resp}