2 Documentation The main interface for interacting with RIC Applications Manager (AppMgr) . It handles low level stuff like managing the http request library and AppMgr required fields
3 Library RequestsLibrary
6 Resource ../global_properties.robot
7 Resource ../json_templater.robot
10 ${APPMGR_BASE_PATH} /ric/v1/xapps/
11 ${APPMGR_ENDPOINT} ${GLOBAL_APPMGR_SERVER_PROTOCOL}://${GLOBAL_INJECTED_APPMGR_IP_ADDR}:${GLOBAL_APPMGR_SERVER_PORT}
12 ${APPMGR_CREATE_XAPP_TEMPLATE} robot/assets/templates/appmgr_create_xapp.template
16 Run AppMgr Health Check
17 [Documentation] Runs AppMgr Health check
18 Run Keyword Run AppMgr Get All Request
20 Run AppMgr Get All Request
21 [Documentation] Runs AppMgr Get List of Xapps Request
22 ${resp}= Run Keyword Run AppMgr Get Request ${APPMGR_BASE_PATH}
23 Should Be Equal As Strings ${resp.status_code} 200
25 Run AppMgr Get By XappName and XappId
26 [documentation] Get Xapp data by XappName and XappId
27 [Arguments] ${xapp_name} ${xapp_id}
28 ${data_path}= Set Variable ${APPMGR_BASE_PATH}${xapp_name}/${xapp_id}
29 ${resp}= Run Keyword Run AppMgr Get Request ${data_path}
30 Should Be Equal As Strings ${resp.status_code} 200
32 Run AppMgr Get By XappName
33 [documentation] Get List of Xapp data by XappName
34 [Arguments] ${xapp_name}
35 ${data_path}= Set Variable ${APPMGR_BASE_PATH}${xapp_name}
36 ${resp}= Run Keyword Run AppMgr Get Request ${data_path}
37 Should Be Equal As Strings ${resp.status_code} 200
40 [documentation] Create Xapp
41 [Arguments] ${xapp_name} ${xapp_id}
42 ${data_path}= Set Variable ${APPMGR_BASE_PATH}
43 ${dict}= Create Dictionary xapp_name=${xapp_name} xapp_id=${xapp_id}
44 ${data}= Fill JSON Template File ${APPMGR_CREATE_XAPP_TEMPLATE} ${dict}
45 ${auth}= Create List ${GLOBAL_INJECTED_APPMGR_USER} ${GLOBAL_INJECTED_APPMGR_PASSWORD}
46 ${session}= Create Session appmgr ${APPMGR_ENDPOINT} auth=${auth}
47 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
48 ${resp}= Post Request appmgr ${data_path} data=${data} headers=${headers}
49 Log Received response from AppMgr ${resp.text}
50 Should Be Equal As Strings ${resp.status_code} 200
54 Run AppMgr Get Request
55 [Documentation] Runs AppMgr Get request
56 [Arguments] ${data_path}
57 ${auth}= Create List ${GLOBAL_INJECTED_APPMGR_USER} ${GLOBAL_INJECTED_APPMGR_PASSWORD}
58 ${session}= Create Session appmgr ${APPMGR_ENDPOINT} auth=${auth}
59 ${uuid}= Generate UUID
60 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
61 ${resp}= Get Request appmgr ${data_path} headers=${headers}
62 Log Received response from AppMgr ${resp.text}
63 Should Be Equal As Strings ${resp.status_code} 200
66 Run AppMgr Delete Request
67 [documentation] Delete Xapp data by XappId
68 [Arguments] ${xapp_id}
69 ${data_path}= Set Variable ${APPMGR_BASE_PATH}/${xapp_id}
70 ${auth}= Create List ${GLOBAL_INJECTED_APPMGR_USER} ${GLOBAL_INJECTED_APPMGR_PASSWORD}
71 ${session}= Create Session appmgr ${APPMGR_ENDPOINT} auth=${auth}
72 ${uuid}= Generate UUID
73 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
74 ${resp}= Delete Request appmgr ${data_path} headers=${headers}
75 Log Received response from AppMgr ${resp.text}
76 Should Be Equal As Strings ${resp.status_code} 200