Version 1.0.2, 9 May 2019
-------------------------
* Add E2 response message with timestamp and status code
+* Fetch xAPP instance status information from xAPP Manager and display in dashboard
Version 1.0.1, 6 May 2019
-------------------------
import { ControlService } from '../services/control/control.service';
import { Router } from '@angular/router';
+
@Component({
selector: 'app-control',
templateUrl: './control.component.html',
},
columns: {
- id: {
- title: 'ID',
- type: 'number',
- },
- xAppName: {
- title: 'xApp Name',
+ xapp: {
+ title:'xApp Name',
type: 'string',
},
- xAppType: {
- title: 'xApp Type',
+ name: {
+ title:'Instance Name',
type: 'string',
},
- podId: {
- title: 'Pod ID',
- type: 'number',
- },
- k8Status: {
- title: 'k8 Status',
+ status: {
+ title: 'Status',
type: 'string',
},
- age: {
- title: 'Age',
+ ip: {
+ title: 'IP',
type: 'string',
},
+ port: {
+ title: 'Port',
+ type: 'integer',
+ },
+ txMessages: {
+ title: 'txMessages',
+ type: 'array',
+ },
+ rxMessages: {
+ title: 'rxMessages',
+ type: 'array',
+ },
},
};
source: LocalDataSource = new LocalDataSource();
- constructor(private service: ControlService, private router: Router) {
- const data = this.service.getData();
- this.source.load(data);
+ constructor(private service: ControlService, private router: Router) {
+ this.service.getxAppInstances((instances) => { this.source.load(instances); } );
}
view(event): void {
const url = '/xapp';
- this.router.navigate([url, event]).then( (e) => {
- if (e) {
- console.log(event.data);
- console.log('Navigation is successful!');
- } else {
- console.log('Navigation has failed!');
- }
- });
+ this.router.navigate([url, event]);
}
* ========================LICENSE_END===================================
*/
import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
@Injectable()
export class ControlService {
-data = [{
- id: 1,
- xAppName: 'Pendulum Control',
- xAppType: 'Type1',
- podId: 'dc-ric-app-b8c6668d8-56bjb',
- k8Status: 'running',
- age: '25 mins',
- }, {
- id: 2,
- xAppName: 'Dual Connectivity',
- xAppType: 'Type2',
- podId: 'ac-ric-app-5ddbc59ffd-qc6rp',
- k8Status: 'failed',
- age: '5 mins',
+ constructor(private http: HttpClient) {
+ }
+
+ getxAppInstances(xAppInstances) {
+ return this.http.get('api/xappmgr/xapps').subscribe(
+ (val: any[]) => {
+ xAppInstances(this.fetchInstance(val));
+ }
+ );
+
+ }
+
+ fetchInstance(allxappdata) {
+ var xAppInstances = []
+ for (const xappindex in allxappdata) {
+ var instancelist = allxappdata[xappindex].instances;
+ for (const instanceindex in instancelist) {
+ var instance = instancelist[instanceindex];
+ instance.xapp = allxappdata[xappindex].name;
+ xAppInstances.push(instance);
+ }
+ }
+ return xAppInstances;
+ }
- }, {
- id: 3,
- xAppName: 'ANR',
- xAppType: 'Type1',
- podId: 'dc-ric-app-694c45b75f-nqdtt',
- k8Status: 'pending',
- age: '55 mins',
- }, {
- id: 4,
- xAppName: 'Admission Control',
- xAppType: 'Type2',
- podId: 'ac-ric-app-4ddfc59ffd-qc7tp',
- k8Status: 'unkown',
- age: '5 mins',
-
- }, {
- id: 5,
- xAppName: 'Admission Control',
- xAppType: 'Type2',
- podId: 'ac-ric-app-3ffgc59ffd-qc5rp',
- k8Status: 'crashLoopBackoff',
- age: '5 mins',
-
- }, {
- id: 6,
- xAppName: 'ANR',
- xAppType: 'Type1',
- podId: 'dc-ric-app-345f44r75f-nertt',
- k8Status: 'completed',
- age: '55 mins',
- }, {
- id: 7,
- xAppName: 'Admission Control',
- xAppType: 'Type2',
- podId: 'ac-ric-app-5ddbc67ffd-qc6rp',
- k8Status: 'completed',
- age: '5 mins',
-
- }, {
- id: 8,
- xAppName: 'ANR',
- xAppType: 'Type1',
- podId: 'dc-ric-app-694c23b75f-nqdtt',
- k8Status: 'completed',
- age: '55 mins',
-
- }];
-
- getData() {
- return this.data; // @TODO implement the service to fetch the backend data
- }
}