| 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 | import { HttpHeaders } from '@angular/common/http'; |
| Barath Kumar R | 07698ab | 2021-03-30 11:50:42 +0530 | [diff] [blame] | 19 | import { NSD } from 'NSInstanceModel'; |
| Barath Kumar R | f2ae546 | 2021-03-01 12:52:33 +0530 | [diff] [blame] | 20 | import { EXECUTEDACTIONS } from 'OperationalModel'; |
| Barath Kumar R | 07698ab | 2021-03-30 11:50:42 +0530 | [diff] [blame] | 21 | import { VNFD } from 'VNFDModel'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * @file Model for Commonly used information. |
| 25 | */ |
| SANDHYA.JS | 0a34dfa | 2023-04-25 23:59:41 +0530 | [diff] [blame] | 26 | /* eslint-disable */ |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 27 | /** |
| 28 | * handle count @enum |
| 29 | */ |
| 30 | export enum CONSTANTNUMBER { |
| 31 | randomNumber = 4, |
| 32 | osmapviewlong = 77.673, |
| 33 | osmapviewlat = 19.166, |
| 34 | chennailong = 80.2809, |
| 35 | chennailat = 13.0781, |
| 36 | bangalorelong = 77.5868, |
| 37 | bangalorelat = 12.9718, |
| 38 | mumbailong = 72.8342, |
| 39 | mumbailat = 18.9394, |
| 40 | tirvandrumlong = 76.9544, |
| 41 | tirvandrumlat = 8.5009, |
| 42 | oneMB = 1048576, |
| 43 | paginationDefaultValue = 10, |
| 44 | splitLongitude = 1, |
| Barath Kumar R | f2ae546 | 2021-03-01 12:52:33 +0530 | [diff] [blame] | 45 | splitLatitude = 2, |
| SANDHYA.JS | 4a7a542 | 2021-05-15 15:35:22 +0530 | [diff] [blame] | 46 | timeOutDefaultSeconds = 5, |
| 47 | oneGB = 1024 |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 48 | } |
| 49 | /** |
| 50 | * handle count @enum |
| 51 | */ |
| 52 | export enum CONFIGCONSTANT { |
| 53 | operationalStateFirstStep = 'init', |
| 54 | operationalStateSecondStep = 'running', |
| 55 | operationalStateThirdStep = 'failed', |
| Barath Kumar R | 07698ab | 2021-03-30 11:50:42 +0530 | [diff] [blame] | 56 | operationalStateFourthStep = 'scaling', |
| SANDHYA.JS | 219fe61 | 2024-01-23 15:52:43 +0530 | [diff] [blame] | 57 | operationalStateFifthStep = 'healing', |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 58 | configStateFirstStep = 'init', |
| 59 | configStateSecondStep = 'configured', |
| 60 | configStateThirdStep = 'failed', |
| 61 | historyStateFirstStep = 'PROCESSING', |
| 62 | historyStateSecondStep = 'COMPLETED', |
| 63 | historyStateThirdStep = 'FAILED', |
| 64 | wimOperationalStateFirstStep = 'PROCESSING', |
| 65 | wimOperationalStateStateSecondStep = 'ENABLED', |
| 66 | wimOperationalStateThirdStep = 'ERROR', |
| 67 | vimOperationalStateFirstStep = 'PROCESSING', |
| 68 | vimOperationalStateStateSecondStep = 'ENABLED', |
| 69 | vimOperationalStateThirdStep = 'ERROR', |
| 70 | sdnOperationalStateFirstStep = 'PROCESSING', |
| 71 | sdnOperationalStateStateSecondStep = 'ENABLED', |
| 72 | sdnOperationalStateThirdStep = 'ERROR', |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 73 | k8OperationalStateFirstStep = 'CREATED', |
| 74 | k8OperationalStateStateSecondStep = 'IN_CREATION', |
| 75 | k8OperationalStateThirdStep = 'IN_DELETION', |
| 76 | k8OperationalStateFourthStep = 'FAILED_DELETION', |
| 77 | k8OperationalStateFifthStep = 'FAILED_CREATION', |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 78 | k8OperationalStateSixthStep = 'N/A', |
| 79 | clusterModeFirstStep = 'MANAGED', |
| 80 | clusterModeSecondStep = 'REGISTERED', |
| SANDHYA.JS | 9914458 | 2022-04-27 17:22:35 +0530 | [diff] [blame] | 81 | done = 'done', |
| SANDHYA.JS | 1b17c43 | 2023-04-26 17:54:57 +0530 | [diff] [blame] | 82 | close = 'close', |
| 83 | userActive = 'active', |
| 84 | userLocked = 'locked', |
| 85 | userExpired = 'expired', |
| 86 | userAlwaysActive = 'always-active' |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 87 | } |
| 88 | /** Interface for Post options */ |
| 89 | export interface POSTAPIRESOURCE { |
| 90 | apiURLHeader: APIURLHEADER; |
| 91 | payload?: object; |
| 92 | } |
| 93 | /** Interface for ApiURL Header */ |
| 94 | export interface APIURLHEADER { |
| 95 | url: string; |
| 96 | httpOptions?: APIHEADERS; |
| 97 | } |
| 98 | /** Interface for the Get Method with response type */ |
| 99 | export interface GETAPIURLHEADER { |
| 100 | headers: HttpHeaders; |
| 101 | responseType: string; |
| 102 | } |
| 103 | /** Interface for Httpoptions Header */ |
| 104 | interface APIHEADERS { |
| 105 | headers: HttpHeaders; |
| 106 | } |
| 107 | /** Interface for the Error */ |
| 108 | export interface ERRORDATA { |
| 109 | error: ERRORDETAILSDATA; |
| 110 | } |
| 111 | /** Interface for the Error Details */ |
| 112 | interface ERRORDETAILSDATA { |
| 113 | detail: string; |
| 114 | code?: string; |
| 115 | status?: number; |
| 116 | text?: Function; |
| 117 | } |
| 118 | /** Handle the URL params */ |
| 119 | export interface URLPARAMS { |
| 120 | page: string; |
| 121 | id: string; |
| 122 | titleName?: string; |
| 123 | forceDeleteType?: boolean; |
| 124 | name?: string; |
| 125 | memberIndex?: object; |
| 126 | nsConfig?: object; |
| 127 | projectID?: string; |
| 128 | username?: string; |
| Barath Kumar R | 07698ab | 2021-03-30 11:50:42 +0530 | [diff] [blame] | 129 | vnfID?: []; |
| 130 | nsID?: string; |
| 131 | nsd?: NSD; |
| 132 | data?: VNFD[]; |
| Barath Kumar R | f2ae546 | 2021-03-01 12:52:33 +0530 | [diff] [blame] | 133 | configs?: object; |
| 134 | actions?: object; |
| 135 | executedActions?: EXECUTEDACTIONS[]; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 136 | identifierList: []; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 137 | createdbyosm?: string; |
| 138 | bootstrap?: boolean; |
| 139 | key?: boolean; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 140 | } |
| 141 | /** Handle the Delete params */ |
| 142 | export interface DELETEPARAMS { |
| 143 | identifier: string; |
| 144 | name?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 145 | projectName?: string; |
| 146 | userName?: string; |
| 147 | username?: string; |
| 148 | page?: string; |
| 149 | id?: string; |
| Barath Kumar R | 063a3f1 | 2020-12-29 16:35:09 +0530 | [diff] [blame] | 150 | productName?: string; |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 151 | createdbyosm?: string; |
| 152 | bootstrap?: boolean; |
| 153 | key?: boolean; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | /** Interface for the Delete Details */ |
| 157 | export interface MODALCLOSERESPONSEDATA { |
| 158 | message: string; |
| 159 | } |
| 160 | |
| 161 | /** Interface for the modal closer */ |
| 162 | export interface MODALCLOSERESPONSEWITHCP { |
| 163 | message: string; |
| 164 | connection_point?: string; |
| 165 | } |
| 166 | |
| 167 | /** Interface for local storage settings */ |
| 168 | export interface LOCALSTORAGE { |
| 169 | id_token?: string; |
| 170 | project_id?: string; |
| 171 | expires?: string; |
| 172 | username?: string; |
| 173 | project?: string; |
| 174 | project_name?: string; |
| 175 | id?: string; |
| 176 | admin?: boolean; |
| 177 | isAdmin?: string; |
| 178 | token_state?: string; |
| 179 | } |
| 180 | /** Interface for Tar settings */ |
| 181 | export interface TARSETTINGS { |
| 182 | name?: string; |
| 183 | 'type'?: string; |
| 184 | readAsString?: Function; |
| 185 | buffer: ArrayBuffer; |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 186 | header_offset?: Number; |
| 187 | size?: number; |
| Barath Kumar R | db1aeb0 | 2020-10-13 18:14:16 +0530 | [diff] [blame] | 188 | linkname?: string; |
| 189 | uname?: string; |
| 190 | gname?: string; |
| 191 | } |
| 192 | /** Interface for File Settings */ |
| 193 | export interface FILESETTINGS { |
| 194 | 'type'?: string; |
| 195 | linkname?: string; |
| 196 | owner?: string; |
| 197 | group?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 198 | } |
| 199 | /** Interface for Package information */ |
| 200 | export interface PACKAGEINFO { |
| 201 | id?: string; |
| 202 | packageType?: string; |
| 203 | descriptor: string; |
| 204 | } |
| 205 | |
| 206 | /** Interface For the Pagination pager in ng-smarttable */ |
| 207 | export interface PAGERSMARTTABLE { |
| 208 | display: boolean; |
| 209 | perPage: number; |
| 210 | } |
| 211 | /** Interface for breadcrumb item */ |
| 212 | export interface BREADCRUMBITEM { |
| 213 | title: string; |
| 214 | url: string; |
| 215 | } |
| 216 | /** Interface For the Pagination pager in ng-smarttable */ |
| 217 | export interface SMARTTABLECLASS { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 218 | class: string; |
| 219 | } |
| 220 | /** Constants of the VIM Types */ |
| 221 | export const VIM_TYPES: TYPESECTION[] = [ |
| 222 | { value: 'openstack', title: 'Openstack' }, |
| 223 | { value: 'aws', title: 'AWS' }, |
| 224 | { value: 'vmware', title: 'VMware vCD' }, |
| 225 | { value: 'openvim', title: 'OpenVIM' }, |
| 226 | { value: 'opennebula', title: 'OpenNebula' }, |
| SANDHYA.JS | 875b4a1 | 2022-04-26 13:05:18 +0530 | [diff] [blame] | 227 | { value: 'azure', title: 'Azure' }, |
| 228 | { value: 'dummy', title: 'Dummy' } |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 229 | ]; |
| 230 | /** Constants of the SDN Types */ |
| 231 | export const SDN_TYPES: TYPESECTION[] = [ |
| 232 | { value: 'arista', title: 'Arista' }, |
| 233 | { value: 'floodlightof', title: 'Floodlight openflow' }, |
| 234 | { value: 'odlof', title: 'OpenDaylight openflow' }, |
| 235 | { value: 'onosof', title: 'ONOS openflow' }, |
| 236 | { value: 'onos_vpls', title: 'ONOS vpls' } |
| 237 | ]; |
| 238 | /** Constants of the WIM Types */ |
| 239 | export const WIM_TYPES: TYPESECTION[] = [ |
| 240 | { value: 'arista', title: 'Arista' }, |
| 241 | { value: 'dynpac', title: 'DynPac' }, |
| 242 | { value: 'floodlightof', title: 'Floodlight openflow' }, |
| 243 | { value: 'odlof', title: 'OpenDaylight openflow' }, |
| 244 | { value: 'onosof', title: 'ONOS openflow' }, |
| 245 | { value: 'onos_vpls', title: 'ONOS vpls' }, |
| 246 | { value: 'tapi', title: 'TAPI' } |
| 247 | ]; |
| Barath Kumar R | 403234e | 2020-07-07 15:48:58 +0530 | [diff] [blame] | 248 | /** Constants of the OSM Repo Types */ |
| 249 | export const OSMREPO_TYPES: TYPESECTION[] = [ |
| 250 | { value: 'osm', title: 'OSM' } |
| 251 | ]; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 252 | /** Interface for List, Add WIM & SDN Types */ |
| 253 | export interface TYPESECTION { |
| 254 | value: string; |
| 255 | title: string; |
| 256 | } |
| Barath Kumar R | 063a3f1 | 2020-12-29 16:35:09 +0530 | [diff] [blame] | 257 | /** Interface for PRIMITIVETYPES */ |
| 258 | export interface PRIMITIVETYPES { |
| 259 | title: string; |
| 260 | value: string; |
| 261 | } |
| 262 | /** Interface for the PRIMITIVEDATA */ |
| 263 | export interface PRIMITIVEDATA { |
| 264 | parameter: {}[]; |
| 265 | } |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 266 | /** Constant for VIM type Openstack's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 267 | export const TYPEOPENSTACK: {} = { |
| 268 | sdn_controller: '', |
| 269 | APIversion: '', |
| 270 | sdn_port_mapping: '', |
| 271 | project_domain_id: '', |
| 272 | vim_network_name: '', |
| 273 | project_domain_name: '', |
| 274 | config_vim_ype: '', |
| 275 | user_domain_id: '', |
| 276 | security_groups: '', |
| 277 | user_domain_name: '', |
| Barath Kumar R | 1245fc8 | 2021-04-16 13:34:06 +0530 | [diff] [blame] | 278 | availability_zone: '', |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 279 | keypair: '', |
| 280 | region_name: '', |
| 281 | dataplane_physical_net: '', |
| 282 | insecure: '', |
| 283 | use_floating_ip: '', |
| 284 | use_internal_endpoint: '', |
| 285 | microversion: '', |
| 286 | additional_conf: '', |
| 287 | use_existing_flavors: '' |
| 288 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 289 | /** Constant for VIM type AWS's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 290 | export const TYPEAWS: {} = { |
| 291 | sdn_controller: '', |
| 292 | vpc_cidr_block: '', |
| 293 | sdn_port_mapping: '', |
| 294 | security_groups: '', |
| 295 | vim_network_name: '', |
| 296 | keypair: '', |
| 297 | region_name: '', |
| 298 | flavor_info: '', |
| 299 | additional_conf: '' |
| 300 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 301 | /** Constant for VIM type VMWARE's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 302 | export const TYPEVMWARE: {} = { |
| 303 | sdn_controller: '', |
| 304 | orgname: '', |
| 305 | sdn_port_mapping: '', |
| 306 | vcenter_ip: '', |
| 307 | vim_network_name: '', |
| 308 | admin_username: '', |
| 309 | admin_password: '', |
| 310 | vcenter_port: '', |
| 311 | vcenter_user: '', |
| 312 | vcenter_password: '', |
| 313 | nsx_manager: '', |
| 314 | nsx_user: '', |
| 315 | nsx_password: '', |
| 316 | vrops_site: '', |
| 317 | vrops_user: '', |
| 318 | vrops_password: '', |
| 319 | additional_conf: '' |
| 320 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 321 | /** Constant for VIM type OPENVIMNEBULA's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 322 | export const TYPEOPENVIMNEBULA: {} = { |
| 323 | sdn_controller: '', |
| 324 | sdn_port_mapping: '', |
| 325 | vim_network_name: '', |
| 326 | additional_conf: '' |
| 327 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 328 | /** Constant for VIM type AZURE's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 329 | export const TYPEAZURE: {} = { |
| 330 | subscription_id: '', |
| 331 | region_name: '', |
| 332 | resource_group: '', |
| 333 | vnet_name: '', |
| 334 | flavors_pattern: '' |
| 335 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 336 | /** Constant for VIM other type Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 337 | export const TYPEOTERS: {} = { |
| 338 | sdn_controller: '', |
| 339 | sdn_port_mapping: '', |
| 340 | vim_network_name: '', |
| 341 | use_floating_ip: '', |
| 342 | use_internal_endpoint: '', |
| 343 | additional_conf: '', |
| 344 | use_existing_flavors: '' |
| 345 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 346 | /** Interface for Domains */ |
| 347 | export interface DOMAINS { |
| 348 | project_domain_name: string; |
| 349 | user_domain_name: string; |
| 350 | } |
| 351 | /** Interface for Login */ |
| 352 | export interface LOGINPARAMS { |
| 353 | username?: string; |
| 354 | password?: string; |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 355 | old_password?: string; |
| SANDHYA.JS | 6c68608 | 2024-06-10 21:39:41 +0530 | [diff] [blame] | 356 | email_id?: string; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 357 | } |
| SANDHYA.JS | 4a7a542 | 2021-05-15 15:35:22 +0530 | [diff] [blame] | 358 | /** Interface for the LABELVALUE */ |
| 359 | export interface LABELVALUE { |
| 360 | label: string; |
| 361 | value: string; |
| 362 | } |
| SANDHYA.JS | 1b17c43 | 2023-04-26 17:54:57 +0530 | [diff] [blame] | 363 | /** Interface for Login */ |
| 364 | export interface UNLOCKPARAMS { |
| 365 | system_admin_id?: string; |
| 366 | unlock?: boolean; |
| 367 | renew?: boolean; |
| 368 | } |