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