blob: 58a96b12c305ae2d7d24b17777f967e5525ac2e9 [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;
kumaran.m3b4814a2020-05-01 19:48:54 +053039}
40/** Interface for K8SCLUSTERDATA */
41export interface K8SREPODATA {
42 description: string;
43 name: string;
44 schema_version: string;
45 'type': string;
46 url: string;
47 vim_account: string;
48 _admin: Admin;
49 _id: string;
50}
51/** Interface for the Credentials */
SANDHYA.JS26570112024-07-05 21:35:46 +053052interface Credentials {
kumaran.m3b4814a2020-05-01 19:48:54 +053053 apiVersion: string;
54 clusters: Clusters[];
55 contexts: Contexts[];
56 'current-context': string;
57 kind: string;
58 preferences: {};
59 users: Users[];
60}
61/** Interface for the Clusters */
62interface Clusters {
63 cluster: Cluster;
64 name: string;
65}
66/** Interface for the Cluster */
67interface Cluster {
68 'certificate-authority-data': string;
69 server: string;
70}
71/** Interface for the Contexts */
SANDHYA.JS26570112024-07-05 21:35:46 +053072interface Contexts {
kumaran.m3b4814a2020-05-01 19:48:54 +053073 context: Context;
74 name: string;
75}
76/** Interface for the Contexts */
77interface Context {
78 cluster: string;
79 user: string;
80}
81/** Interface for the Users */
SANDHYA.JS26570112024-07-05 21:35:46 +053082interface Users {
kumaran.m3b4814a2020-05-01 19:48:54 +053083 name: string;
84 user: User;
85}
86/** Interface for the Users */
87interface User {
88 'client-certificate-data': string;
89 'client-key-data': string;
90}
91/** Interface for the K8SCLUSTERDATA nets */
SANDHYA.JS26570112024-07-05 21:35:46 +053092interface Nets {
kumaran.m3b4814a2020-05-01 19:48:54 +053093 net1: string;
94}
95/** Interface for the K8SCLUSTERDATA _admin */
SANDHYA.JS26570112024-07-05 21:35:46 +053096export interface Admin {
kumaran.m3b4814a2020-05-01 19:48:54 +053097 created: string;
SANDHYA.JS26570112024-07-05 21:35:46 +053098 current_operation?: number;
99 'helm-chart'?: HelmChart;
100 'juju-bundle'?: JujuBundle;
101 operationalState?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530102 modified: string;
103}
104/** Interface for the K8SCLUSTERDATA _admin Helm chart */
105interface HelmChart {
106 created: boolean;
107 id: string;
108}
109/** Interface for the K8SCLUSTERDATA _admin Juju Bundle */
110interface JujuBundle {
111 error_msg: string;
112}
113/** Interface for the K8SCLUSTERDATA Return to Display */
SANDHYA.JS26570112024-07-05 21:35:46 +0530114export interface K8SCLUSTERDATADISPLAY {
kumaran.m3b4814a2020-05-01 19:48:54 +0530115 name: string;
116 identifier: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530117 operationalState?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530118 version: number;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530119 created?: string;
120 modified?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530121 pageType: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530122 description?: string;
123 default?: boolean;
124 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530125 createdbyosm?: string;
126 bootstrap?: boolean;
127 key?: boolean;
128 clusterMode?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530129}
130/** Interface for the K8SCLUSTERDATA Return to Display */
131export interface K8SREPODATADISPLAY {
132 name: string;
133 identifier: string;
134 url: string;
135 'type': string;
136 created: string;
137 modified: string;
138 pageType: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530139 description?: string;
140 default?: boolean;
141 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530142 createdbyosm?: boolean;
143 bootstrap?: boolean;
144 key?: boolean;
SANDHYA.JS26570112024-07-05 21:35:46 +0530145}
146
147/** Interface for the Create cluster */
148export interface K8SCreateCLUSTERDATA {
149 _id?: string,
150 description?: string,
151 k8s_version?: string,
152 location?: string,
153 name?: string,
154 node_count?: number,
155 'node_size/node_type'?: string,
156 vim_account?: string
157 _admin?: Admin;
158 infra_config_profiles?: ProfileMappings[];
159 default?: boolean;
160}
161
162/** Interface for the K8SCLUSTERDATA */
163export interface K8SCREATEDATADISPLAY {
164 name: string;
165 identifier: string;
166 version: string;
167 created: string;
168 modified: string;
169 default?: boolean;
170 description?: string;
171}
172
173/** Interface for the Profile payload */
174export interface INFRACONFIGPAYLOAD {
175 name?: string;
176 _id?: string,
177 description?: string;
178 identifier?: string;
179 pageType?: string
180 _admin?: Admin;
181 created?: string;
182 modified?: string;
183 ksus?: KSU[];
184 state?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530185 createdbyosm?: boolean;
186 bootstrap?: boolean;
187 key?: boolean;
SANDHYA.JS26570112024-07-05 21:35:46 +0530188}
189
190/** Interface for the KSU */
191export interface KSU {
192 name?: string;
193 description?: string;
194 profile?: PROFILE;
195 oka?: OKA[];
196}
197
198/** Interface for Project */
199export interface PROFILE {
200 _id?: string;
201 sw_catalog_path?: string;
202 profile_type?: string;
203 name?: string;
204}
205
206/** Interface for OKA */
207export interface OKA {
208 _id?: string;
209 sw_catalog_path?: string;
210 transformation?: {};
211}
212
213
214/** Interface for the K8S payload */
215export interface K8SPayload {
216 name?: string;
217 location?: string;
218 vim_account?: string;
219 description?: string;
220 k8s_version?: string;
221 node_count?: number;
222 region_name?: string;
223 resource_group?: string;
224 'node_size'?: string;
SANDHYA.JSb772de02024-12-10 15:21:03 +0530225 bootstrap?: boolean
SANDHYA.JS26570112024-07-05 21:35:46 +0530226}
227
228/** Interface for Profile Mappings */
229export interface ProfileMappings {
230 _id?: string;
231 name?: string;
232 profile_name?: string;
233}
234
235/** Interface for profile mappings */
236export interface ProfileMap {
237 add_profile?: ProjectRoleMappings[];
238 remove_profile?: ProjectRoleMappings[];
239}
240
241/** Interface for ProfileMappings */
242export interface ProjectRoleMappings {
243 id?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530244}