2 Documentation Keywords for interacting with the XApp Manager, including listing, deploying, and undeploying XApps
4 Library RequestsLibrary
6 Resource ../global_properties.robot
8 Resource ../ric/ric_utils.robot
11 ${APPMGR_BASE_PATH} /ric/v1/xapps
12 ${APPMGR_ENDPOINT} ${GLOBAL_APPMGR_SERVER_PROTOCOL}://${GLOBAL_INJECTED_APPMGR_IP_ADDR}:${GLOBAL_APPMGR_SERVER_PORT}
15 Run AppMgr Health Check
16 [Documentation] Runs AppMgr Health check
17 Run Keyword Get Deployed XApps
20 [Documentation] Obtain the list of deployed XApps from the Appmgr
21 ${resp} = Run AppMgr GET Request
22 [Return] ${resp.json()}
25 [Documentation] Obtain the list of deployed XApps from the Appmgr
26 ${resp} = Run AppMgr GET Request /search/
27 Should Be True ${resp}
28 [Return] ${resp.json()}
31 [Documentation] Get installed XApp from Appmgr given name
32 [Arguments] ${xapp_name}
33 ${resp} = Run AppMgr GET Request /${xapp_name}
34 Should Be True ${resp}
35 [Return] ${resp.json()}
37 Get XApp By Name and ID
38 [Documentation] Get installed XApp from Appmgr by name and ID
39 [Arguments] ${xapp_name} ${xapp_id}
40 ${resp}= Run AppMgr GET Request /${xapp_name}/${xapp_id}/
41 Should Be True ${resp}
42 [Return] ${resp.json()}
45 [Documentation] Create Xapp
46 [Arguments] ${xapp_name}
47 &{dict} = Create Dictionary name=${xapp_name}
48 ${data} = Evaluate json.dumps(&{dict}) json
49 ${resp} = Run AppMgr POST Request ${EMPTY} ${data}
50 Should Be True ${resp}
54 [Documentation] Create one or more XApps
55 [Arguments] @{xapp_names}
56 FOR ${xapp} IN @{xapp_names}
61 [Documentation] Remove a deployed XApp
62 [Arguments] ${xapp_name}
63 ${resp} = Run AppMgr DELETE Request /${xapp_name}
64 Should Be True ${resp}
68 [Documentation] Remove one or more deployed XApps
69 [Arguments] @{xapp_names}
70 FOR ${xapp} IN @{xapp_names}
73 Deploy All Available XApps
74 [Documentation] Attempt to deploy any not-currently-deployed XApp
75 @{d} = Get Deployed XApps
76 @{deployed} = Pluck name ${d}
77 @{available} = Get Deployable XApps
78 @{toDeploy} = Subtract From List ${available} ${deployed}
79 Deploy XApps @{toDeploy}
81 Undeploy All Running XApps
82 [Documentation] Undeploy any deployed XApps
83 @{d} = Get Deployed XApps
84 @{deployed} = Pluck name ${d}
85 Run Keyword If ${deployed} Undeploy XApps @{deployed}
87 Run AppMgr GET Request
88 [Documentation] Make an HTTP GET request against the XApp manager
89 [Arguments] ${path}=${EMPTY}
90 ${session} = Create Session roboAppmgrGet ${APPMGR_ENDPOINT}
91 ${headers} = Create Dictionary Accept=application/json Content-Type=application/json
92 ${resp} = Get Request roboAppmgrGet ${APPMGR_BASE_PATH}${path} headers=${headers}
95 Run AppMgr POST Request
96 [Documentation] Make an HTTP POST request against the XApp manager
97 [Arguments] ${path}=${EMPTY} ${body}=${EMPTY}
98 ${session} = Create Session roboAppmgrPost ${APPMGR_ENDPOINT}
99 ${headers} = Create Dictionary Accept=application/json Content-Type=application/json
100 ${resp} = Post Request roboAppmgrPost ${APPMGR_BASE_PATH}${path} headers=${headers} data=${body}
103 Run AppMgr DELETE Request
104 [Documentation] Make an HTTP DELETE request against the XApp manager
106 ${session} = Create Session roboAppmgrDelete ${APPMGR_ENDPOINT}
107 ${headers} = Create Dictionary Accept=application/json Content-Type=application/json
108 ${resp} = Delete Request roboAppmgrDelete ${APPMGR_BASE_PATH}${path} headers=${headers}