blob: 255591ab4aeeb3dc1a57978f82977285c6a61d22 [file] [log] [blame]
Rohan Patel1d1c0622019-10-31 16:19:21 -04001const express = require('express')
2const app = express()
3const port = 3000
4
5app.get('/', (req, res) => res.send('Hello World!'))
6
7app.get('/appmgr/ric/v1/health/ready',function(req,res){
8 res.sendStatus(200)
9})
10
11app.get('/appmgr/ric/v1/health/alive',function(req,res){
12 res.sendStatus(200)
13})
14
15app.get('/appmgr/ric/v1/xapps',function(req,res){
16 res.status(200)
17 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"]}]}])
18})
19
20app.post('/appmgr/ric/v1/xapps', function(req,res){
21 res.statusMessage = 'Created'
22 res.status(201)
23 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"]}]}})
24})
25
26app.delete('/appmgr/ric/v1/xapps/:name',function(req,res){
27 res.sendStatus(204)
28})
29
30app.listen(port, () => console.log(`Example app listening on port ${port}!`))
31