blob: 06a13b235ad6dcb1af65a1df3f0b91247ae1dfad [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 {
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;
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.JSc08e1ec2025-02-13 16:24:46 +053039 node_count?: number;
40 node_size?: number;
kumaran.m3b4814a2020-05-01 19:48:54 +053041}
42/** Interface for K8SCLUSTERDATA */
43export interface K8SREPODATA {
44 description: string;
45 name: string;
46 schema_version: string;
47 'type': string;
48 url: string;
49 vim_account: string;
50 _admin: Admin;
51 _id: string;
52}
53/** Interface for the Credentials */
SANDHYA.JS26570112024-07-05 21:35:46 +053054interface Credentials {
kumaran.m3b4814a2020-05-01 19:48:54 +053055 apiVersion: string;
56 clusters: Clusters[];
57 contexts: Contexts[];
58 'current-context': string;
59 kind: string;
60 preferences: {};
61 users: Users[];
62}
63/** Interface for the Clusters */
64interface Clusters {
65 cluster: Cluster;
66 name: string;
67}
68/** Interface for the Cluster */
69interface Cluster {
70 'certificate-authority-data': string;
71 server: string;
72}
73/** Interface for the Contexts */
SANDHYA.JS26570112024-07-05 21:35:46 +053074interface Contexts {
kumaran.m3b4814a2020-05-01 19:48:54 +053075 context: Context;
76 name: string;
77}
78/** Interface for the Contexts */
79interface Context {
80 cluster: string;
81 user: string;
82}
83/** Interface for the Users */
SANDHYA.JS26570112024-07-05 21:35:46 +053084interface Users {
kumaran.m3b4814a2020-05-01 19:48:54 +053085 name: string;
86 user: User;
87}
88/** Interface for the Users */
89interface User {
90 'client-certificate-data': string;
91 'client-key-data': string;
92}
93/** Interface for the K8SCLUSTERDATA nets */
SANDHYA.JS26570112024-07-05 21:35:46 +053094interface Nets {
kumaran.m3b4814a2020-05-01 19:48:54 +053095 net1: string;
96}
97/** Interface for the K8SCLUSTERDATA _admin */
SANDHYA.JS26570112024-07-05 21:35:46 +053098export interface Admin {
kumaran.m3b4814a2020-05-01 19:48:54 +053099 created: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530100 current_operation?: number;
101 'helm-chart'?: HelmChart;
102 'juju-bundle'?: JujuBundle;
103 operationalState?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530104 modified: string;
105}
106/** Interface for the K8SCLUSTERDATA _admin Helm chart */
107interface HelmChart {
108 created: boolean;
109 id: string;
110}
111/** Interface for the K8SCLUSTERDATA _admin Juju Bundle */
112interface JujuBundle {
113 error_msg: string;
114}
115/** Interface for the K8SCLUSTERDATA Return to Display */
SANDHYA.JS26570112024-07-05 21:35:46 +0530116export interface K8SCLUSTERDATADISPLAY {
kumaran.m3b4814a2020-05-01 19:48:54 +0530117 name: string;
118 identifier: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530119 operationalState?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530120 version: number;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530121 created?: string;
122 modified?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530123 pageType: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530124 description?: string;
125 default?: boolean;
126 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530127 createdbyosm?: string;
128 bootstrap?: boolean;
129 key?: boolean;
130 clusterMode?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530131}
132/** Interface for the K8SCLUSTERDATA Return to Display */
133export interface K8SREPODATADISPLAY {
134 name: string;
135 identifier: string;
136 url: string;
137 'type': string;
138 created: string;
139 modified: string;
140 pageType: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530141 description?: string;
142 default?: boolean;
143 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530144 createdbyosm?: boolean;
145 bootstrap?: boolean;
146 key?: boolean;
SANDHYA.JS26570112024-07-05 21:35:46 +0530147}
148
149/** Interface for the Create cluster */
150export interface K8SCreateCLUSTERDATA {
151 _id?: string,
152 description?: string,
153 k8s_version?: string,
154 location?: string,
155 name?: string,
156 node_count?: number,
157 'node_size/node_type'?: string,
158 vim_account?: string
159 _admin?: Admin;
160 infra_config_profiles?: ProfileMappings[];
161 default?: boolean;
162}
163
164/** Interface for the K8SCLUSTERDATA */
165export interface K8SCREATEDATADISPLAY {
166 name: string;
167 identifier: string;
168 version: string;
169 created: string;
170 modified: string;
171 default?: boolean;
172 description?: string;
173}
174
175/** Interface for the Profile payload */
176export interface INFRACONFIGPAYLOAD {
177 name?: string;
178 _id?: string,
179 description?: string;
180 identifier?: string;
181 pageType?: string
182 _admin?: Admin;
183 created?: string;
184 modified?: string;
185 ksus?: KSU[];
186 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530187 createdbyosm?: boolean;
188 bootstrap?: boolean;
189 key?: boolean;
SANDHYA.JS26570112024-07-05 21:35:46 +0530190}
191
192/** Interface for the KSU */
193export interface KSU {
194 name?: string;
195 description?: string;
196 profile?: PROFILE;
197 oka?: OKA[];
198}
199
200/** Interface for Project */
201export interface PROFILE {
202 _id?: string;
203 sw_catalog_path?: string;
204 profile_type?: string;
205 name?: string;
206}
207
208/** Interface for OKA */
209export interface OKA {
210 _id?: string;
211 sw_catalog_path?: string;
212 transformation?: {};
213}
214
215
216/** Interface for the K8S payload */
217export interface K8SPayload {
218 name?: string;
219 location?: string;
220 vim_account?: string;
221 description?: string;
222 k8s_version?: string;
223 node_count?: number;
224 region_name?: string;
225 resource_group?: string;
226 'node_size'?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530227 bootstrap?: boolean
SANDHYA.JS26570112024-07-05 21:35:46 +0530228}
229
230/** Interface for Profile Mappings */
231export interface ProfileMappings {
232 _id?: string;
233 name?: string;
234 profile_name?: string;
235}
236
237/** Interface for profile mappings */
238export interface ProfileMap {
239 add_profile?: ProjectRoleMappings[];
240 remove_profile?: ProjectRoleMappings[];
241}
242
243/** Interface for ProfileMappings */
244export interface ProjectRoleMappings {
245 id?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530246}