added oran ric test head
[it/otf.git] / oran-ric-test-head / mock_server / index.js
diff --git a/oran-ric-test-head/mock_server/index.js b/oran-ric-test-head/mock_server/index.js
new file mode 100644 (file)
index 0000000..255591a
--- /dev/null
@@ -0,0 +1,31 @@
+const express = require('express')\r
+const app = express()\r
+const port = 3000\r
+\r
+app.get('/', (req, res) => res.send('Hello World!'))\r
+\r
+app.get('/appmgr/ric/v1/health/ready',function(req,res){\r
+    res.sendStatus(200)\r
+})\r
+\r
+app.get('/appmgr/ric/v1/health/alive',function(req,res){\r
+    res.sendStatus(200)\r
+})\r
+\r
+app.get('/appmgr/ric/v1/xapps',function(req,res){\r
+    res.status(200)\r
+    res.send([{"name":"admin-xapp","status":"deployed","version":"1.0","instances":null},{"name":"mcxapp","status":"deployed","version":"1.0","instances":[{"name":"mcxapp-649d7494-h5tjb","status":"running","ip":"service-ricxapp-mcxapp-rmr.ricxapp","port":4560,"txMessages":null,"rxMessages":["RIC_SUB_RESP","RIC_SUB_FAILURE","RIC_SUB_DEL_RESP","RIC_SUB_DEL_FAILURE","RIC_INDICATION"]}]},{"name":"ueec","status":"deployed","version":"1.0","instances":[{"name":"ueec-6675694b75-jtnz6","status":"running","ip":"service-ricxapp-ueec-rmr.ricxapp","port":4560,"txMessages":["RIC_SUB_REQ","RIC_SUB_DEL_REQ"],"rxMessages":["RIC_SUB_RESP","RIC_SUB_FAILURE","RIC_SUB_DEL_RESP","RIC_SUB_DEL_FAILURE","RIC_INDICATION"]}]}])\r
+})\r
+\r
+app.post('/appmgr/ric/v1/xapps', function(req,res){\r
+    res.statusMessage = 'Created'\r
+    res.status(201)\r
+    res.send({"result_output":{"name":"anr","status":"deployed","version":"1.0","instances":[{"name":"anr-7d4c47b4bb-jlslm","status":"running","ip":"service-ricxapp-anr-rmr.ricxapp","port":4560,"txMessages":null,"rxMessages":["RIC_SGNB_ADDITION_REQ","RIC_RRC_TRANSFER"]}]}})\r
+})\r
+\r
+app.delete('/appmgr/ric/v1/xapps/:name',function(req,res){\r
+    res.sendStatus(204)\r
+})\r
+\r
+app.listen(port, () => console.log(`Example app listening on port ${port}!`))\r
+\r