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