Advanced Cluster Management - NGUI
[osm/NG-UI.git] / src / models / K8sModel.ts
1 /*
2  Copyright 2020 TATA ELXSI
3
4  Licensed under the Apache License, Version 2.0 (the 'License');
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15
16  Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
17  */
18 /**
19  * @file  Model for K8s related information.
20  */
21
22 /** Interface for K8SCLUSTERDATA */
23 export interface K8SCLUSTERDATA {
24     credentials: Credentials;
25     description: string;
26     k8s_version: number;
27     name: string;
28     namespace: string;
29     nets: Nets;
30     schema_version: string;
31     vim_account: string;
32     _admin: Admin;
33     _id: string;
34     state?: string;
35 }
36 /** Interface for K8SCLUSTERDATA */
37 export interface K8SREPODATA {
38     description: string;
39     name: string;
40     schema_version: string;
41     'type': string;
42     url: string;
43     vim_account: string;
44     _admin: Admin;
45     _id: string;
46 }
47 /** Interface for the Credentials */
48 interface Credentials {
49     apiVersion: string;
50     clusters: Clusters[];
51     contexts: Contexts[];
52     'current-context': string;
53     kind: string;
54     preferences: {};
55     users: Users[];
56 }
57 /** Interface for the Clusters */
58 interface Clusters {
59     cluster: Cluster;
60     name: string;
61 }
62 /** Interface for the Cluster */
63 interface Cluster {
64     'certificate-authority-data': string;
65     server: string;
66 }
67 /** Interface for the Contexts */
68 interface Contexts {
69     context: Context;
70     name: string;
71 }
72 /** Interface for the Contexts */
73 interface Context {
74     cluster: string;
75     user: string;
76 }
77 /** Interface for the Users */
78 interface Users {
79     name: string;
80     user: User;
81 }
82 /** Interface for the Users */
83 interface User {
84     'client-certificate-data': string;
85     'client-key-data': string;
86 }
87 /** Interface for the K8SCLUSTERDATA nets */
88 interface Nets {
89     net1: string;
90 }
91 /** Interface for the K8SCLUSTERDATA _admin */
92 export interface Admin {
93     created: string;
94     current_operation?: number;
95     'helm-chart'?: HelmChart;
96     'juju-bundle'?: JujuBundle;
97     operationalState?: string;
98     modified: string;
99 }
100 /** Interface for the K8SCLUSTERDATA _admin Helm chart */
101 interface HelmChart {
102     created: boolean;
103     id: string;
104 }
105 /** Interface for the K8SCLUSTERDATA _admin Juju Bundle */
106 interface JujuBundle {
107     error_msg: string;
108 }
109 /** Interface for the K8SCLUSTERDATA Return to Display */
110 export interface K8SCLUSTERDATADISPLAY {
111     name: string;
112     identifier: string;
113     operationalState: string;
114     version: number;
115     created: string;
116     modified: string;
117     pageType: string;
118     description?: string;
119     default?: boolean;
120     state?: string;
121 }
122 /** Interface for the K8SCLUSTERDATA Return to Display */
123 export interface K8SREPODATADISPLAY {
124     name: string;
125     identifier: string;
126     url: string;
127     'type': string;
128     created: string;
129     modified: string;
130     pageType: string;
131     description?: string;
132     default?: boolean;
133     state?: string;
134 }
135
136 /** Interface for the Create cluster */
137 export interface K8SCreateCLUSTERDATA {
138     _id?: string,
139     description?: string,
140     k8s_version?: string,
141     location?: string,
142     name?: string,
143     node_count?: number,
144     'node_size/node_type'?: string,
145     vim_account?: string
146     _admin?: Admin;
147     infra_config_profiles?: ProfileMappings[];
148     default?: boolean;
149 }
150
151 /** Interface for the K8SCLUSTERDATA */
152 export interface K8SCREATEDATADISPLAY {
153     name: string;
154     identifier: string;
155     version: string;
156     created: string;
157     modified: string;
158     default?: boolean;
159     description?: string;
160 }
161
162 /** Interface for the Profile payload */
163 export interface INFRACONFIGPAYLOAD {
164     name?: string;
165     _id?: string,
166     description?: string;
167     identifier?: string;
168     pageType?: string
169     _admin?: Admin;
170     created?: string;
171     modified?: string;
172     ksus?: KSU[];
173     state?: string;
174 }
175
176 /** Interface for the KSU */
177 export interface KSU {
178     name?: string;
179     description?: string;
180     profile?: PROFILE;
181     oka?: OKA[];
182 }
183
184 /** Interface for Project */
185 export interface PROFILE {
186     _id?: string;
187     sw_catalog_path?: string;
188     profile_type?: string;
189     name?: string;
190 }
191
192 /** Interface for OKA */
193 export interface OKA {
194     _id?: string;
195     sw_catalog_path?: string;
196     transformation?: {};
197 }
198
199
200 /** Interface for the K8S payload */
201 export interface K8SPayload {
202     name?: string;
203     location?: string;
204     vim_account?: string;
205     description?: string;
206     k8s_version?: string;
207     node_count?: number;
208     region_name?: string;
209     resource_group?: string;
210     'node_size'?: string;
211 }
212
213 /** Interface for Profile Mappings */
214 export interface ProfileMappings {
215     _id?: string;
216     name?: string;
217     profile_name?: string;
218 }
219
220 /** Interface for profile mappings */
221 export interface ProfileMap {
222     add_profile?: ProjectRoleMappings[];
223     remove_profile?: ProjectRoleMappings[];
224 }
225
226 /** Interface for ProfileMappings */
227 export interface ProjectRoleMappings {
228     id?: string;
229 }