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