| 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 | 9914458 | 2022-04-27 17:22:35 +0530 | [diff] [blame] | 78 | done = 'done', |
| SANDHYA.JS | 1b17c43 | 2023-04-26 17:54:57 +0530 | [diff] [blame] | 79 | close = 'close', |
| 80 | userActive = 'active', |
| 81 | userLocked = 'locked', |
| 82 | userExpired = 'expired', |
| 83 | userAlwaysActive = 'always-active' |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 84 | } |
| 85 | /** Interface for Post options */ |
| 86 | export interface POSTAPIRESOURCE { |
| 87 | apiURLHeader: APIURLHEADER; |
| 88 | payload?: object; |
| 89 | } |
| 90 | /** Interface for ApiURL Header */ |
| 91 | export interface APIURLHEADER { |
| 92 | url: string; |
| 93 | httpOptions?: APIHEADERS; |
| 94 | } |
| 95 | /** Interface for the Get Method with response type */ |
| 96 | export interface GETAPIURLHEADER { |
| 97 | headers: HttpHeaders; |
| 98 | responseType: string; |
| 99 | } |
| 100 | /** Interface for Httpoptions Header */ |
| 101 | interface APIHEADERS { |
| 102 | headers: HttpHeaders; |
| 103 | } |
| 104 | /** Interface for the Error */ |
| 105 | export interface ERRORDATA { |
| 106 | error: ERRORDETAILSDATA; |
| 107 | } |
| 108 | /** Interface for the Error Details */ |
| 109 | interface ERRORDETAILSDATA { |
| 110 | detail: string; |
| 111 | code?: string; |
| 112 | status?: number; |
| 113 | text?: Function; |
| 114 | } |
| 115 | /** Handle the URL params */ |
| 116 | export interface URLPARAMS { |
| 117 | page: string; |
| 118 | id: string; |
| 119 | titleName?: string; |
| 120 | forceDeleteType?: boolean; |
| 121 | name?: string; |
| 122 | memberIndex?: object; |
| 123 | nsConfig?: object; |
| 124 | projectID?: string; |
| 125 | username?: string; |
| Barath Kumar R | 07698ab | 2021-03-30 11:50:42 +0530 | [diff] [blame] | 126 | vnfID?: []; |
| 127 | nsID?: string; |
| 128 | nsd?: NSD; |
| 129 | data?: VNFD[]; |
| Barath Kumar R | f2ae546 | 2021-03-01 12:52:33 +0530 | [diff] [blame] | 130 | configs?: object; |
| 131 | actions?: object; |
| 132 | executedActions?: EXECUTEDACTIONS[]; |
| SANDHYA.JS | 8ead52b | 2024-06-10 18:23:41 +0530 | [diff] [blame] | 133 | identifierList: []; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 134 | } |
| 135 | /** Handle the Delete params */ |
| 136 | export interface DELETEPARAMS { |
| 137 | identifier: string; |
| 138 | name?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 139 | projectName?: string; |
| 140 | userName?: string; |
| 141 | username?: string; |
| 142 | page?: string; |
| 143 | id?: string; |
| Barath Kumar R | 063a3f1 | 2020-12-29 16:35:09 +0530 | [diff] [blame] | 144 | productName?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | /** Interface for the Delete Details */ |
| 148 | export interface MODALCLOSERESPONSEDATA { |
| 149 | message: string; |
| 150 | } |
| 151 | |
| 152 | /** Interface for the modal closer */ |
| 153 | export interface MODALCLOSERESPONSEWITHCP { |
| 154 | message: string; |
| 155 | connection_point?: string; |
| 156 | } |
| 157 | |
| 158 | /** Interface for local storage settings */ |
| 159 | export interface LOCALSTORAGE { |
| 160 | id_token?: string; |
| 161 | project_id?: string; |
| 162 | expires?: string; |
| 163 | username?: string; |
| 164 | project?: string; |
| 165 | project_name?: string; |
| 166 | id?: string; |
| 167 | admin?: boolean; |
| 168 | isAdmin?: string; |
| 169 | token_state?: string; |
| 170 | } |
| 171 | /** Interface for Tar settings */ |
| 172 | export interface TARSETTINGS { |
| 173 | name?: string; |
| 174 | 'type'?: string; |
| 175 | readAsString?: Function; |
| 176 | buffer: ArrayBuffer; |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 177 | header_offset?: Number; |
| 178 | size?: number; |
| Barath Kumar R | db1aeb0 | 2020-10-13 18:14:16 +0530 | [diff] [blame] | 179 | linkname?: string; |
| 180 | uname?: string; |
| 181 | gname?: string; |
| 182 | } |
| 183 | /** Interface for File Settings */ |
| 184 | export interface FILESETTINGS { |
| 185 | 'type'?: string; |
| 186 | linkname?: string; |
| 187 | owner?: string; |
| 188 | group?: string; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 189 | } |
| 190 | /** Interface for Package information */ |
| 191 | export interface PACKAGEINFO { |
| 192 | id?: string; |
| 193 | packageType?: string; |
| 194 | descriptor: string; |
| 195 | } |
| 196 | |
| 197 | /** Interface For the Pagination pager in ng-smarttable */ |
| 198 | export interface PAGERSMARTTABLE { |
| 199 | display: boolean; |
| 200 | perPage: number; |
| 201 | } |
| 202 | /** Interface for breadcrumb item */ |
| 203 | export interface BREADCRUMBITEM { |
| 204 | title: string; |
| 205 | url: string; |
| 206 | } |
| 207 | /** Interface For the Pagination pager in ng-smarttable */ |
| 208 | export interface SMARTTABLECLASS { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 209 | class: string; |
| 210 | } |
| 211 | /** Constants of the VIM Types */ |
| 212 | export const VIM_TYPES: TYPESECTION[] = [ |
| 213 | { value: 'openstack', title: 'Openstack' }, |
| 214 | { value: 'aws', title: 'AWS' }, |
| 215 | { value: 'vmware', title: 'VMware vCD' }, |
| 216 | { value: 'openvim', title: 'OpenVIM' }, |
| 217 | { value: 'opennebula', title: 'OpenNebula' }, |
| SANDHYA.JS | 875b4a1 | 2022-04-26 13:05:18 +0530 | [diff] [blame] | 218 | { value: 'azure', title: 'Azure' }, |
| 219 | { value: 'dummy', title: 'Dummy' } |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 220 | ]; |
| 221 | /** Constants of the SDN Types */ |
| 222 | export const SDN_TYPES: TYPESECTION[] = [ |
| 223 | { value: 'arista', title: 'Arista' }, |
| 224 | { value: 'floodlightof', title: 'Floodlight openflow' }, |
| 225 | { value: 'odlof', title: 'OpenDaylight openflow' }, |
| 226 | { value: 'onosof', title: 'ONOS openflow' }, |
| 227 | { value: 'onos_vpls', title: 'ONOS vpls' } |
| 228 | ]; |
| 229 | /** Constants of the WIM Types */ |
| 230 | export const WIM_TYPES: TYPESECTION[] = [ |
| 231 | { value: 'arista', title: 'Arista' }, |
| 232 | { value: 'dynpac', title: 'DynPac' }, |
| 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 | { value: 'tapi', title: 'TAPI' } |
| 238 | ]; |
| Barath Kumar R | 403234e | 2020-07-07 15:48:58 +0530 | [diff] [blame] | 239 | /** Constants of the OSM Repo Types */ |
| 240 | export const OSMREPO_TYPES: TYPESECTION[] = [ |
| 241 | { value: 'osm', title: 'OSM' } |
| 242 | ]; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 243 | /** Interface for List, Add WIM & SDN Types */ |
| 244 | export interface TYPESECTION { |
| 245 | value: string; |
| 246 | title: string; |
| 247 | } |
| Barath Kumar R | 063a3f1 | 2020-12-29 16:35:09 +0530 | [diff] [blame] | 248 | /** Interface for PRIMITIVETYPES */ |
| 249 | export interface PRIMITIVETYPES { |
| 250 | title: string; |
| 251 | value: string; |
| 252 | } |
| 253 | /** Interface for the PRIMITIVEDATA */ |
| 254 | export interface PRIMITIVEDATA { |
| 255 | parameter: {}[]; |
| 256 | } |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 257 | /** Constant for VIM type Openstack's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 258 | export const TYPEOPENSTACK: {} = { |
| 259 | sdn_controller: '', |
| 260 | APIversion: '', |
| 261 | sdn_port_mapping: '', |
| 262 | project_domain_id: '', |
| 263 | vim_network_name: '', |
| 264 | project_domain_name: '', |
| 265 | config_vim_ype: '', |
| 266 | user_domain_id: '', |
| 267 | security_groups: '', |
| 268 | user_domain_name: '', |
| Barath Kumar R | 1245fc8 | 2021-04-16 13:34:06 +0530 | [diff] [blame] | 269 | availability_zone: '', |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 270 | keypair: '', |
| 271 | region_name: '', |
| 272 | dataplane_physical_net: '', |
| 273 | insecure: '', |
| 274 | use_floating_ip: '', |
| 275 | use_internal_endpoint: '', |
| 276 | microversion: '', |
| 277 | additional_conf: '', |
| 278 | use_existing_flavors: '' |
| 279 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 280 | /** Constant for VIM type AWS's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 281 | export const TYPEAWS: {} = { |
| 282 | sdn_controller: '', |
| 283 | vpc_cidr_block: '', |
| 284 | sdn_port_mapping: '', |
| 285 | security_groups: '', |
| 286 | vim_network_name: '', |
| 287 | keypair: '', |
| 288 | region_name: '', |
| 289 | flavor_info: '', |
| 290 | additional_conf: '' |
| 291 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 292 | /** Constant for VIM type VMWARE's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 293 | export const TYPEVMWARE: {} = { |
| 294 | sdn_controller: '', |
| 295 | orgname: '', |
| 296 | sdn_port_mapping: '', |
| 297 | vcenter_ip: '', |
| 298 | vim_network_name: '', |
| 299 | admin_username: '', |
| 300 | admin_password: '', |
| 301 | vcenter_port: '', |
| 302 | vcenter_user: '', |
| 303 | vcenter_password: '', |
| 304 | nsx_manager: '', |
| 305 | nsx_user: '', |
| 306 | nsx_password: '', |
| 307 | vrops_site: '', |
| 308 | vrops_user: '', |
| 309 | vrops_password: '', |
| 310 | additional_conf: '' |
| 311 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 312 | /** Constant for VIM type OPENVIMNEBULA's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 313 | export const TYPEOPENVIMNEBULA: {} = { |
| 314 | sdn_controller: '', |
| 315 | sdn_port_mapping: '', |
| 316 | vim_network_name: '', |
| 317 | additional_conf: '' |
| 318 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 319 | /** Constant for VIM type AZURE's Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 320 | export const TYPEAZURE: {} = { |
| 321 | subscription_id: '', |
| 322 | region_name: '', |
| 323 | resource_group: '', |
| 324 | vnet_name: '', |
| 325 | flavors_pattern: '' |
| 326 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 327 | /** Constant for VIM other type Config */ |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 328 | export const TYPEOTERS: {} = { |
| 329 | sdn_controller: '', |
| 330 | sdn_port_mapping: '', |
| 331 | vim_network_name: '', |
| 332 | use_floating_ip: '', |
| 333 | use_internal_endpoint: '', |
| 334 | additional_conf: '', |
| 335 | use_existing_flavors: '' |
| 336 | }; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 337 | /** Interface for Domains */ |
| 338 | export interface DOMAINS { |
| 339 | project_domain_name: string; |
| 340 | user_domain_name: string; |
| 341 | } |
| 342 | /** Interface for Login */ |
| 343 | export interface LOGINPARAMS { |
| 344 | username?: string; |
| 345 | password?: string; |
| SANDHYA.JS | a981655 | 2022-04-12 09:07:08 +0530 | [diff] [blame] | 346 | old_password?: string; |
| SANDHYA.JS | 6c68608 | 2024-06-10 21:39:41 +0530 | [diff] [blame] | 347 | email_id?: string; |
| Barath Kumar R | 1607058 | 2021-02-08 18:19:35 +0530 | [diff] [blame] | 348 | } |
| SANDHYA.JS | 4a7a542 | 2021-05-15 15:35:22 +0530 | [diff] [blame] | 349 | /** Interface for the LABELVALUE */ |
| 350 | export interface LABELVALUE { |
| 351 | label: string; |
| 352 | value: string; |
| 353 | } |
| SANDHYA.JS | 1b17c43 | 2023-04-26 17:54:57 +0530 | [diff] [blame] | 354 | /** Interface for Login */ |
| 355 | export interface UNLOCKPARAMS { |
| 356 | system_admin_id?: string; |
| 357 | unlock?: boolean; |
| 358 | renew?: boolean; |
| 359 | } |