| 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 { |
| 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 | c08e1ec | 2025-02-13 16:24:46 +0530 | [diff] [blame^] | 39 | node_count?: number; |
| 40 | node_size?: number; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 41 | } |
| 42 | /** Interface for K8SCLUSTERDATA */ |
| 43 | export 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.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 54 | interface Credentials { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 55 | 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 */ |
| 64 | interface Clusters { |
| 65 | cluster: Cluster; |
| 66 | name: string; |
| 67 | } |
| 68 | /** Interface for the Cluster */ |
| 69 | interface Cluster { |
| 70 | 'certificate-authority-data': string; |
| 71 | server: string; |
| 72 | } |
| 73 | /** Interface for the Contexts */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 74 | interface Contexts { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 75 | context: Context; |
| 76 | name: string; |
| 77 | } |
| 78 | /** Interface for the Contexts */ |
| 79 | interface Context { |
| 80 | cluster: string; |
| 81 | user: string; |
| 82 | } |
| 83 | /** Interface for the Users */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 84 | interface Users { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 85 | name: string; |
| 86 | user: User; |
| 87 | } |
| 88 | /** Interface for the Users */ |
| 89 | interface User { |
| 90 | 'client-certificate-data': string; |
| 91 | 'client-key-data': string; |
| 92 | } |
| 93 | /** Interface for the K8SCLUSTERDATA nets */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 94 | interface Nets { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 95 | net1: string; |
| 96 | } |
| 97 | /** Interface for the K8SCLUSTERDATA _admin */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 98 | export interface Admin { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 99 | created: string; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 100 | current_operation?: number; |
| 101 | 'helm-chart'?: HelmChart; |
| 102 | 'juju-bundle'?: JujuBundle; |
| 103 | operationalState?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 104 | modified: string; |
| 105 | } |
| 106 | /** Interface for the K8SCLUSTERDATA _admin Helm chart */ |
| 107 | interface HelmChart { |
| 108 | created: boolean; |
| 109 | id: string; |
| 110 | } |
| 111 | /** Interface for the K8SCLUSTERDATA _admin Juju Bundle */ |
| 112 | interface JujuBundle { |
| 113 | error_msg: string; |
| 114 | } |
| 115 | /** Interface for the K8SCLUSTERDATA Return to Display */ |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 116 | export interface K8SCLUSTERDATADISPLAY { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 117 | name: string; |
| 118 | identifier: string; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 119 | operationalState?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 120 | version: number; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 121 | created?: string; |
| 122 | modified?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 123 | pageType: string; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 124 | description?: string; |
| 125 | default?: boolean; |
| 126 | state?: string; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 127 | createdbyosm?: string; |
| 128 | bootstrap?: boolean; |
| 129 | key?: boolean; |
| 130 | clusterMode?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 131 | } |
| 132 | /** Interface for the K8SCLUSTERDATA Return to Display */ |
| 133 | export interface K8SREPODATADISPLAY { |
| 134 | name: string; |
| 135 | identifier: string; |
| 136 | url: string; |
| 137 | 'type': string; |
| 138 | created: string; |
| 139 | modified: string; |
| 140 | pageType: string; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 141 | description?: string; |
| 142 | default?: boolean; |
| 143 | state?: string; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 144 | createdbyosm?: boolean; |
| 145 | bootstrap?: boolean; |
| 146 | key?: boolean; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | /** Interface for the Create cluster */ |
| 150 | export 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 */ |
| 165 | export 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 */ |
| 176 | export 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.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 187 | createdbyosm?: boolean; |
| 188 | bootstrap?: boolean; |
| 189 | key?: boolean; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | /** Interface for the KSU */ |
| 193 | export interface KSU { |
| 194 | name?: string; |
| 195 | description?: string; |
| 196 | profile?: PROFILE; |
| 197 | oka?: OKA[]; |
| 198 | } |
| 199 | |
| 200 | /** Interface for Project */ |
| 201 | export interface PROFILE { |
| 202 | _id?: string; |
| 203 | sw_catalog_path?: string; |
| 204 | profile_type?: string; |
| 205 | name?: string; |
| 206 | } |
| 207 | |
| 208 | /** Interface for OKA */ |
| 209 | export interface OKA { |
| 210 | _id?: string; |
| 211 | sw_catalog_path?: string; |
| 212 | transformation?: {}; |
| 213 | } |
| 214 | |
| 215 | |
| 216 | /** Interface for the K8S payload */ |
| 217 | export 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.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame] | 227 | bootstrap?: boolean |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | /** Interface for Profile Mappings */ |
| 231 | export interface ProfileMappings { |
| 232 | _id?: string; |
| 233 | name?: string; |
| 234 | profile_name?: string; |
| 235 | } |
| 236 | |
| 237 | /** Interface for profile mappings */ |
| 238 | export interface ProfileMap { |
| 239 | add_profile?: ProjectRoleMappings[]; |
| 240 | remove_profile?: ProjectRoleMappings[]; |
| 241 | } |
| 242 | |
| 243 | /** Interface for ProfileMappings */ |
| 244 | export interface ProjectRoleMappings { |
| 245 | id?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 246 | } |