blob: 084303380a266c065b03debfb3f3dfd277a2c6cc [file] [log] [blame]
kumaran.m3b4814a2020-05-01 19:48:54 +05301/*
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 */
23export interface K8SCLUSTERDATA {
SANDHYA.JS92379ec2025-06-13 17:29:35 +053024 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;
SANDHYA.JS26570112024-07-05 21:35:46 +053034 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +053035 resourceState?: string;
36 created?: string;
37 bootstrap?: boolean;
38 key?: string;
SANDHYA.JS92379ec2025-06-13 17:29:35 +053039 cloud_type?: string;
40 cluster_mode?: string;
SANDHYA.JSa3ff32a2025-02-13 16:24:46 +053041 node_count?: number;
SANDHYA.JS92379ec2025-06-13 17:29:35 +053042 node_size?: string;
43 ksu_count?: number;
44 cluster_name?: string;
45 private_subnet?: string[];
46 public_subnet?: string[];
47 cluster_id?: string;
48 count?: number;
49 package_name?: string;
50 package_path?: string;
51 data?: K8SNODEDATA[];
52}
53/** Interface for K8SCLUSTERDATA */
54export interface K8SNODEDATA {
55 description: string;
56 name: string;
57 package_name?: string;
58 package_path?: string;
59 _admin: Admin;
60 _id: string;
61 state?: string;
62 resourceState?: string;
63 node_count?: number;
64 node_size?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +053065}
66/** Interface for K8SCLUSTERDATA */
67export interface K8SREPODATA {
68 description: string;
69 name: string;
70 schema_version: string;
71 'type': string;
72 url: string;
73 vim_account: string;
74 _admin: Admin;
75 _id: string;
76}
77/** Interface for the Credentials */
SANDHYA.JS26570112024-07-05 21:35:46 +053078interface Credentials {
kumaran.m3b4814a2020-05-01 19:48:54 +053079 apiVersion: string;
80 clusters: Clusters[];
81 contexts: Contexts[];
82 'current-context': string;
83 kind: string;
84 preferences: {};
85 users: Users[];
86}
87/** Interface for the Clusters */
88interface Clusters {
89 cluster: Cluster;
90 name: string;
91}
92/** Interface for the Cluster */
93interface Cluster {
94 'certificate-authority-data': string;
95 server: string;
96}
97/** Interface for the Contexts */
SANDHYA.JS26570112024-07-05 21:35:46 +053098interface Contexts {
kumaran.m3b4814a2020-05-01 19:48:54 +053099 context: Context;
100 name: string;
101}
102/** Interface for the Contexts */
103interface Context {
104 cluster: string;
105 user: string;
106}
107/** Interface for the Users */
SANDHYA.JS26570112024-07-05 21:35:46 +0530108interface Users {
kumaran.m3b4814a2020-05-01 19:48:54 +0530109 name: string;
110 user: User;
111}
112/** Interface for the Users */
113interface User {
114 'client-certificate-data': string;
115 'client-key-data': string;
116}
117/** Interface for the K8SCLUSTERDATA nets */
SANDHYA.JS26570112024-07-05 21:35:46 +0530118interface Nets {
kumaran.m3b4814a2020-05-01 19:48:54 +0530119 net1: string;
120}
121/** Interface for the K8SCLUSTERDATA _admin */
SANDHYA.JS26570112024-07-05 21:35:46 +0530122export interface Admin {
kumaran.m3b4814a2020-05-01 19:48:54 +0530123 created: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530124 current_operation?: number;
125 'helm-chart'?: HelmChart;
126 'juju-bundle'?: JujuBundle;
127 operationalState?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530128 modified: string;
129}
130/** Interface for the K8SCLUSTERDATA _admin Helm chart */
131interface HelmChart {
132 created: boolean;
133 id: string;
134}
135/** Interface for the K8SCLUSTERDATA _admin Juju Bundle */
136interface JujuBundle {
137 error_msg: string;
138}
139/** Interface for the K8SCLUSTERDATA Return to Display */
SANDHYA.JS26570112024-07-05 21:35:46 +0530140export interface K8SCLUSTERDATADISPLAY {
kumaran.m3b4814a2020-05-01 19:48:54 +0530141 name: string;
142 identifier: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530143 operationalState?: string;
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530144 version?: number;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530145 created?: string;
146 modified?: string;
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530147 pageType?: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530148 description?: string;
149 default?: boolean;
150 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530151 createdbyosm?: string;
152 bootstrap?: boolean;
153 key?: boolean;
154 clusterMode?: string;
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530155 nodeCount?: number;
156 nodeSize?: string;
157 cloud_type?: string;
158 cluster_mode?: string;
159 cluster_name?: string;
160 cluster_id?: string;
161 package_name?: string;
162 package_path?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530163}
164/** Interface for the K8SCLUSTERDATA Return to Display */
165export interface K8SREPODATADISPLAY {
166 name: string;
167 identifier: string;
168 url: string;
169 'type': string;
170 created: string;
171 modified: string;
172 pageType: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530173 description?: string;
174 default?: boolean;
175 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530176 createdbyosm?: boolean;
177 bootstrap?: boolean;
178 key?: boolean;
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530179 cloud_type?: string;
180 cluster_mode?: string;
181 cluster_id?: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530182}
183
184/** Interface for the Create cluster */
185export interface K8SCreateCLUSTERDATA {
186 _id?: string,
187 description?: string,
188 k8s_version?: string,
189 location?: string,
190 name?: string,
191 node_count?: number,
192 'node_size/node_type'?: string,
193 vim_account?: string
194 _admin?: Admin;
195 infra_config_profiles?: ProfileMappings[];
196 default?: boolean;
197}
198
199/** Interface for the K8SCLUSTERDATA */
200export interface K8SCREATEDATADISPLAY {
201 name: string;
202 identifier: string;
203 version: string;
204 created: string;
205 modified: string;
206 default?: boolean;
207 description?: string;
208}
209
210/** Interface for the Profile payload */
211export interface INFRACONFIGPAYLOAD {
212 name?: string;
213 _id?: string,
214 description?: string;
215 identifier?: string;
216 pageType?: string
217 _admin?: Admin;
218 created?: string;
219 modified?: string;
220 ksus?: KSU[];
221 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530222 createdbyosm?: boolean;
223 bootstrap?: boolean;
224 key?: boolean;
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530225 cluster_mode?: string;
226 cluster_id?: string;
227 resourceState?: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530228}
229
230/** Interface for the KSU */
231export interface KSU {
232 name?: string;
233 description?: string;
234 profile?: PROFILE;
235 oka?: OKA[];
236}
237
238/** Interface for Project */
239export interface PROFILE {
240 _id?: string;
241 sw_catalog_path?: string;
242 profile_type?: string;
243 name?: string;
244}
245
246/** Interface for OKA */
247export interface OKA {
248 _id?: string;
249 sw_catalog_path?: string;
250 transformation?: {};
251}
252
253
254/** Interface for the K8S payload */
255export interface K8SPayload {
256 name?: string;
257 location?: string;
258 vim_account?: string;
259 description?: string;
260 k8s_version?: string;
261 node_count?: number;
262 region_name?: string;
263 resource_group?: string;
264 'node_size'?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530265 bootstrap?: boolean
SANDHYA.JS26570112024-07-05 21:35:46 +0530266}
267
268/** Interface for Profile Mappings */
269export interface ProfileMappings {
270 _id?: string;
271 name?: string;
272 profile_name?: string;
273}
274
275/** Interface for profile mappings */
276export interface ProfileMap {
277 add_profile?: ProjectRoleMappings[];
278 remove_profile?: ProjectRoleMappings[];
279}
280
281/** Interface for ProfileMappings */
282export interface ProjectRoleMappings {
283 id?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530284}