| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 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 { |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 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.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 34 | state?: string; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 35 | resourceState?: string; |
| 36 | created?: string; |
| 37 | bootstrap?: boolean; |
| 38 | key?: string; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 39 | cloud_type?: string; |
| 40 | cluster_mode?: string; |
| SANDHYA.JS | a3ff32a | 2025-02-13 16:24:46 +0530 | [diff] [blame] | 41 | node_count?: number; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 42 | 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 */ |
| 54 | export 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.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 65 | } |
| 66 | /** Interface for K8SCLUSTERDATA */ |
| 67 | export 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.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 78 | interface Credentials { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 79 | 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 */ |
| 88 | interface Clusters { |
| 89 | cluster: Cluster; |
| 90 | name: string; |
| 91 | } |
| 92 | /** Interface for the Cluster */ |
| 93 | interface Cluster { |
| 94 | 'certificate-authority-data': string; |
| 95 | server: string; |
| 96 | } |
| 97 | /** Interface for the Contexts */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 98 | interface Contexts { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 99 | context: Context; |
| 100 | name: string; |
| 101 | } |
| 102 | /** Interface for the Contexts */ |
| 103 | interface Context { |
| 104 | cluster: string; |
| 105 | user: string; |
| 106 | } |
| 107 | /** Interface for the Users */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 108 | interface Users { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 109 | name: string; |
| 110 | user: User; |
| 111 | } |
| 112 | /** Interface for the Users */ |
| 113 | interface User { |
| 114 | 'client-certificate-data': string; |
| 115 | 'client-key-data': string; |
| 116 | } |
| 117 | /** Interface for the K8SCLUSTERDATA nets */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 118 | interface Nets { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 119 | net1: string; |
| 120 | } |
| 121 | /** Interface for the K8SCLUSTERDATA _admin */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 122 | export interface Admin { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 123 | created: string; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 124 | current_operation?: number; |
| 125 | 'helm-chart'?: HelmChart; |
| 126 | 'juju-bundle'?: JujuBundle; |
| 127 | operationalState?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 128 | modified: string; |
| 129 | } |
| 130 | /** Interface for the K8SCLUSTERDATA _admin Helm chart */ |
| 131 | interface HelmChart { |
| 132 | created: boolean; |
| 133 | id: string; |
| 134 | } |
| 135 | /** Interface for the K8SCLUSTERDATA _admin Juju Bundle */ |
| 136 | interface JujuBundle { |
| 137 | error_msg: string; |
| 138 | } |
| 139 | /** Interface for the K8SCLUSTERDATA Return to Display */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 140 | export interface K8SCLUSTERDATADISPLAY { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 141 | name: string; |
| 142 | identifier: string; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 143 | operationalState?: string; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 144 | version?: number; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 145 | created?: string; |
| 146 | modified?: string; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 147 | pageType?: string; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 148 | description?: string; |
| 149 | default?: boolean; |
| 150 | state?: string; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 151 | createdbyosm?: string; |
| 152 | bootstrap?: boolean; |
| 153 | key?: boolean; |
| 154 | clusterMode?: string; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 155 | 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.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 163 | } |
| 164 | /** Interface for the K8SCLUSTERDATA Return to Display */ |
| 165 | export interface K8SREPODATADISPLAY { |
| 166 | name: string; |
| 167 | identifier: string; |
| 168 | url: string; |
| 169 | 'type': string; |
| 170 | created: string; |
| 171 | modified: string; |
| 172 | pageType: string; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 173 | description?: string; |
| 174 | default?: boolean; |
| 175 | state?: string; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 176 | createdbyosm?: boolean; |
| 177 | bootstrap?: boolean; |
| 178 | key?: boolean; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 179 | cloud_type?: string; |
| 180 | cluster_mode?: string; |
| 181 | cluster_id?: string; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | /** Interface for the Create cluster */ |
| 185 | export 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 */ |
| 200 | export 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 */ |
| 211 | export 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.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 222 | createdbyosm?: boolean; |
| 223 | bootstrap?: boolean; |
| 224 | key?: boolean; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 225 | cluster_mode?: string; |
| 226 | cluster_id?: string; |
| 227 | resourceState?: string; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | /** Interface for the KSU */ |
| 231 | export interface KSU { |
| 232 | name?: string; |
| 233 | description?: string; |
| 234 | profile?: PROFILE; |
| 235 | oka?: OKA[]; |
| 236 | } |
| 237 | |
| 238 | /** Interface for Project */ |
| 239 | export interface PROFILE { |
| 240 | _id?: string; |
| 241 | sw_catalog_path?: string; |
| 242 | profile_type?: string; |
| 243 | name?: string; |
| 244 | } |
| 245 | |
| 246 | /** Interface for OKA */ |
| 247 | export interface OKA { |
| 248 | _id?: string; |
| 249 | sw_catalog_path?: string; |
| 250 | transformation?: {}; |
| 251 | } |
| 252 | |
| 253 | |
| 254 | /** Interface for the K8S payload */ |
| 255 | export 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.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 265 | bootstrap?: boolean |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | /** Interface for Profile Mappings */ |
| 269 | export interface ProfileMappings { |
| 270 | _id?: string; |
| 271 | name?: string; |
| 272 | profile_name?: string; |
| 273 | } |
| 274 | |
| 275 | /** Interface for profile mappings */ |
| 276 | export interface ProfileMap { |
| 277 | add_profile?: ProjectRoleMappings[]; |
| 278 | remove_profile?: ProjectRoleMappings[]; |
| 279 | } |
| 280 | |
| 281 | /** Interface for ProfileMappings */ |
| 282 | export interface ProjectRoleMappings { |
| 283 | id?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 284 | } |