d3022abb62c92ef3ce7292bf794a4406bc7fed30
[portal/ric-dashboard.git] / dashboard / webapp-frontend / src / app / interfaces / app-mgr.types.ts
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 AT&T Intellectual Property
6  * %%
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ========================LICENSE_END===================================
19  */
20
21 // Models of data used by the App Manager.
22 // TS interface names are Java class names plus XM prefix.
23
24 export interface XMConfigMetadata {
25   xappName: string;
26   namespace: string;
27 }
28
29 export interface XMXappConfig {
30   metadata: XMConfigMetadata;
31   config: Object;
32 }
33
34 export interface XMAllXappConfig {
35   [position: number]: XMXappConfig;
36 }
37
38 export interface XMConfigValidationError {
39   field: string;
40   error: string;
41 }
42
43 export interface XMConfigValidationErrors {
44   [position: number]: XMConfigValidationError;
45 }
46
47 export interface XMAppTransport {
48   name: string;
49   version: string;
50 }
51
52 export interface XMDashboardDeployableXapps {
53   [position: number]: XMAppTransport;
54 }
55
56 export interface XMXappInstance {
57   ip: string;
58   name: string;
59   port: number;
60   status: string;
61   rxMessages: Array<string>;
62   txMessages: Array<string>;
63   policies: Array<number>;
64 }
65
66 export interface XMXapp {
67   name: string;
68   status: string; // actually an enum
69   version: string;
70   instances: Array<XMXappInstance>;
71 }
72
73 export interface XMAllDeployedXapps {
74   [postion: number]: XMXapp;
75 }
76
77 /**
78  * xappName is the only required field
79  */
80 export interface XMXappDescriptor {
81   xappName: string;
82   helmVersion?: string;
83   releaseName?: string;
84   namespace?: string;
85   overrideFile?: object;
86 }
87
88 export interface XappControlRow {
89   xapp: string;
90   instance: XMXappInstance;
91 }