Rohan Patel | e19624e | 2019-11-11 16:30:46 -0500 | [diff] [blame] | 1 | /* Copyright (c) 2019 AT&T Intellectual Property. #
|
| 2 | # #
|
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); #
|
| 4 | # you may not use this file except in compliance with the License. #
|
| 5 | # You may obtain a copy of the License at #
|
| 6 | # #
|
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 #
|
| 8 | # #
|
| 9 | # Unless required by applicable law or agreed to in writing, software #
|
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, #
|
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
| 12 | # See the License for the specific language governing permissions and #
|
| 13 | # limitations under the License. #
|
| 14 | ##############################################################################*/
|
| 15 |
|
Rohan Patel | 1d1c062 | 2019-10-31 16:19:21 -0400 | [diff] [blame] | 16 | const express = require('express')
|
| 17 | const app = express()
|
| 18 | const port = 3000
|
| 19 |
|
| 20 | app.get('/', (req, res) => res.send('Hello World!'))
|
| 21 |
|
| 22 | app.get('/appmgr/ric/v1/health/ready',function(req,res){
|
| 23 | res.sendStatus(200)
|
| 24 | })
|
| 25 |
|
| 26 | app.get('/appmgr/ric/v1/health/alive',function(req,res){
|
| 27 | res.sendStatus(200)
|
| 28 | })
|
| 29 |
|
| 30 | app.get('/appmgr/ric/v1/xapps',function(req,res){
|
| 31 | res.status(200)
|
| 32 | 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"]}]}])
|
| 33 | })
|
| 34 |
|
| 35 | app.post('/appmgr/ric/v1/xapps', function(req,res){
|
| 36 | res.statusMessage = 'Created'
|
| 37 | res.status(201)
|
| 38 | 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"]}]}})
|
| 39 | })
|
| 40 |
|
| 41 | app.delete('/appmgr/ric/v1/xapps/:name',function(req,res){
|
| 42 | res.sendStatus(204)
|
| 43 | })
|
| 44 |
|
| 45 | app.listen(port, () => console.log(`Example app listening on port ${port}!`))
|
| 46 |
|