Feature-9904: Enhancing NG-UI to enable Juju operational view dashboard
* NG-UI able to show the Juju Operational view dashboard of launched NS.
Change-Id: I9c7feadce8dbfca00e4e9321dffed3818a2e4510
Signed-off-by: Barath Kumar R <barath.r@tataelxsi.co.in>
diff --git a/src/models/CommonModel.ts b/src/models/CommonModel.ts
index 7bd1cca..7b51e9e 100644
--- a/src/models/CommonModel.ts
+++ b/src/models/CommonModel.ts
@@ -17,6 +17,7 @@
*/
import { HttpHeaders } from '@angular/common/http';
import { NSD } from 'NSInstanceModel';
+import { EXECUTEDACTIONS } from 'OperationalModel';
import { VNFD } from 'VNFDModel';
/**
@@ -41,7 +42,8 @@
oneMB = 1048576,
paginationDefaultValue = 10,
splitLongitude = 1,
- splitLatitude = 2
+ splitLatitude = 2,
+ timeOutDefaultSeconds = 5
}
/**
* handle count @enum
@@ -115,6 +117,9 @@
nsID?: string;
nsd?: NSD;
data?: VNFD[];
+ configs?: object;
+ actions?: object;
+ executedActions?: EXECUTEDACTIONS[];
}
/** Handle the Delete params */
export interface DELETEPARAMS {
diff --git a/src/models/MenuModel.ts b/src/models/MenuModel.ts
index deb9654..d9d0620 100644
--- a/src/models/MenuModel.ts
+++ b/src/models/MenuModel.ts
@@ -134,6 +134,16 @@
icon: 'fas fa-layer-group',
menuName: 'PAGE.DASHBOARD.NETSLICEINSTANCE',
isChildExists: false
+ },
+ {
+ liClass: '',
+ anchorTagClass: 'link',
+ routerLink: '/instances/operational-view',
+ routerLinkActive: childActiveClass,
+ routerLinkActiveOptions: false,
+ icon: 'fas fa-tachometer-alt',
+ menuName: 'PAGE.OPERATIONALDASHBOARD.TITLE',
+ isChildExists: false
}
]
},
diff --git a/src/models/NSInstanceModel.ts b/src/models/NSInstanceModel.ts
index ce44122..62b9c5c 100644
--- a/src/models/NSInstanceModel.ts
+++ b/src/models/NSInstanceModel.ts
@@ -48,6 +48,7 @@
instantiate_params: InstantiateParam;
additionalParamsForNs: AdditionalParamForN;
_id?: string;
+ vcaStatus?: object;
}
/** Interface for Admin */
@@ -179,6 +180,7 @@
state?: string;
memberIndex?: DF[];
nsConfig?: object;
+ vcaStatus?: object;
adminDetails?: object;
vnfID?: string[];
nsd?: NSD;
diff --git a/src/models/OperationalModel.ts b/src/models/OperationalModel.ts
new file mode 100644
index 0000000..79f248e
--- /dev/null
+++ b/src/models/OperationalModel.ts
@@ -0,0 +1,147 @@
+/*
+ Copyright 2020 TATA ELXSI
+
+ Licensed under the Apache License, Version 2.0 (the 'License');
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ Author: BARATH KUMAR R (barath.r@tataelxsi.co.in)
+ */
+
+/**
+ * @file Model for Operational view JUJU information.
+ */
+
+// tslint:disable: completed-docs
+
+/** Interface for the VCASTATUS */
+export interface VCASTATUS {
+ vcaStatus: VCADETAILS;
+ name: string;
+ id: string;
+}
+/** Interface for the VCASTATUS */
+export interface VCADETAILS {
+ isLiveloading: boolean;
+ ns_id: string;
+ vcaStatusModels: SETMODELS[];
+ timeOutSeconds?: number;
+ vca_id: string;
+ vca_name: string;
+}
+/** Interface for the SETMODELS */
+export interface SETMODELS {
+ applications: VCAAPPLICATIONS[];
+ branches?: {};
+ controller_timestamp?: string;
+ executedActions?: EXECUTEDACTIONS;
+ machines: MACHINES[];
+ model: VCAMODEL;
+ offers?: {};
+ relations: RELATIONS[];
+ remote_applications?: {};
+ units: VCAUNITS[];
+ unknown_fields?: {};
+}
+/** Interface for the VCAAPPLICATIONS */
+export interface VCAAPPLICATIONS {
+ app_id: string;
+ charm: string;
+ store: string;
+ units: {};
+ status: STATUS;
+ scale: number;
+ public_address: string;
+ agent_status: AGENTSTATUS;
+ configs: object;
+ actions: object;
+}
+/** Interface for the VCAUNITS */
+export interface VCAUNITS {
+ address: string;
+ machine: string;
+ unit_id: string;
+ public_address: string;
+ status: string;
+ agent_status: AGENTSTATUS;
+}
+/** Interface for the EXECUTEDACTIONS */
+export interface EXECUTEDACTIONS {
+ id: string;
+ action: string;
+ status: string;
+ Code: string;
+ outout: string;
+ verified: string;
+}
+/** Interface for the VCAMODEL */
+export interface VCAMODEL {
+ available_version: string;
+ cloud_tag: string;
+ migration: string;
+ name: string;
+ region: string;
+ version: string;
+}
+/** Interface for the STATUS */
+export interface STATUS {
+ status: string;
+}
+/** Interface for the AGENTSTATUS */
+export interface AGENTSTATUS {
+ status: string;
+ info?: string;
+}
+/** Interface for the MACHINES */
+export interface MACHINES {
+ id_: string;
+ agent_status: AGENTSTATUS;
+ dns_name: string;
+ instance_id: string;
+ series: string;
+ instance_status: AGENTSTATUS;
+}
+/** Interface for the RELATIONS */
+export interface RELATIONS {
+ endpoints: ENDPOINTS[];
+ 'interface': string;
+ key: string;
+}
+/** Interface for the ENDPOINTS */
+export interface ENDPOINTS {
+ application: string;
+ name: string;
+ role: string;
+ subordinate: string;
+}
+/** Interface for the SETTIMER */
+export interface SETTIMER {
+ label: string;
+ value: number;
+}
+export const SET_TIMER: SETTIMER[] = [
+ {
+ label: '5s',
+ value: 5
+ },
+ {
+ label: '10s',
+ value: 10
+ },
+ {
+ label: '30s',
+ value: 30
+ },
+ {
+ label: '1m',
+ value: 60
+ }
+];