blob: 307cb34b2db5303c70c68bcc72a0a6cd9e2ace99 [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;
kumaran.m3b4814a2020-05-01 19:48:54 +053035}
36/** Interface for K8SCLUSTERDATA */
37export 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 */
SANDHYA.JS26570112024-07-05 21:35:46 +053048interface Credentials {
kumaran.m3b4814a2020-05-01 19:48:54 +053049 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 */
58interface Clusters {
59 cluster: Cluster;
60 name: string;
61}
62/** Interface for the Cluster */
63interface Cluster {
64 'certificate-authority-data': string;
65 server: string;
66}
67/** Interface for the Contexts */
SANDHYA.JS26570112024-07-05 21:35:46 +053068interface Contexts {
kumaran.m3b4814a2020-05-01 19:48:54 +053069 context: Context;
70 name: string;
71}
72/** Interface for the Contexts */
73interface Context {
74 cluster: string;
75 user: string;
76}
77/** Interface for the Users */
SANDHYA.JS26570112024-07-05 21:35:46 +053078interface Users {
kumaran.m3b4814a2020-05-01 19:48:54 +053079 name: string;
80 user: User;
81}
82/** Interface for the Users */
83interface User {
84 'client-certificate-data': string;
85 'client-key-data': string;
86}
87/** Interface for the K8SCLUSTERDATA nets */
SANDHYA.JS26570112024-07-05 21:35:46 +053088interface Nets {
kumaran.m3b4814a2020-05-01 19:48:54 +053089 net1: string;
90}
91/** Interface for the K8SCLUSTERDATA _admin */
SANDHYA.JS26570112024-07-05 21:35:46 +053092export interface Admin {
kumaran.m3b4814a2020-05-01 19:48:54 +053093 created: string;
SANDHYA.JS26570112024-07-05 21:35:46 +053094 current_operation?: number;
95 'helm-chart'?: HelmChart;
96 'juju-bundle'?: JujuBundle;
97 operationalState?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +053098 modified: string;
99}
100/** Interface for the K8SCLUSTERDATA _admin Helm chart */
101interface HelmChart {
102 created: boolean;
103 id: string;
104}
105/** Interface for the K8SCLUSTERDATA _admin Juju Bundle */
106interface JujuBundle {
107 error_msg: string;
108}
109/** Interface for the K8SCLUSTERDATA Return to Display */
SANDHYA.JS26570112024-07-05 21:35:46 +0530110export interface K8SCLUSTERDATADISPLAY {
kumaran.m3b4814a2020-05-01 19:48:54 +0530111 name: string;
112 identifier: string;
113 operationalState: string;
114 version: number;
115 created: string;
116 modified: string;
117 pageType: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530118 description?: string;
119 default?: boolean;
120 state?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530121}
122/** Interface for the K8SCLUSTERDATA Return to Display */
123export interface K8SREPODATADISPLAY {
124 name: string;
125 identifier: string;
126 url: string;
127 'type': string;
128 created: string;
129 modified: string;
130 pageType: string;
SANDHYA.JS26570112024-07-05 21:35:46 +0530131 description?: string;
132 default?: boolean;
133 state?: string;
134}
135
136/** Interface for the Create cluster */
137export 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 */
152export 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 */
163export 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 */
177export interface KSU {
178 name?: string;
179 description?: string;
180 profile?: PROFILE;
181 oka?: OKA[];
182}
183
184/** Interface for Project */
185export interface PROFILE {
186 _id?: string;
187 sw_catalog_path?: string;
188 profile_type?: string;
189 name?: string;
190}
191
192/** Interface for OKA */
193export interface OKA {
194 _id?: string;
195 sw_catalog_path?: string;
196 transformation?: {};
197}
198
199
200/** Interface for the K8S payload */
201export 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 */
214export interface ProfileMappings {
215 _id?: string;
216 name?: string;
217 profile_name?: string;
218}
219
220/** Interface for profile mappings */
221export interface ProfileMap {
222 add_profile?: ProjectRoleMappings[];
223 remove_profile?: ProjectRoleMappings[];
224}
225
226/** Interface for ProfileMappings */
227export interface ProjectRoleMappings {
228 id?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530229}