blob: 7b51e9e121e9968a84cd79959bb9acb3cffc7f0d [file] [log] [blame]
kumaran.m3b4814a2020-05-01 19:48:54 +05301/*
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 */
18import { HttpHeaders } from '@angular/common/http';
Barath Kumar R07698ab2021-03-30 11:50:42 +053019import { NSD } from 'NSInstanceModel';
Barath Kumar Rf2ae5462021-03-01 12:52:33 +053020import { EXECUTEDACTIONS } from 'OperationalModel';
Barath Kumar R07698ab2021-03-30 11:50:42 +053021import { VNFD } from 'VNFDModel';
kumaran.m3b4814a2020-05-01 19:48:54 +053022
23/**
24 * @file Model for Commonly used information.
25 */
Barath Kumar R063a3f12020-12-29 16:35:09 +053026// tslint:disable: completed-docs
kumaran.m3b4814a2020-05-01 19:48:54 +053027/**
28 * handle count @enum
29 */
30export 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 Rf2ae5462021-03-01 12:52:33 +053045 splitLatitude = 2,
46 timeOutDefaultSeconds = 5
kumaran.m3b4814a2020-05-01 19:48:54 +053047}
48/**
49 * handle count @enum
50 */
51export enum CONFIGCONSTANT {
52 operationalStateFirstStep = 'init',
53 operationalStateSecondStep = 'running',
54 operationalStateThirdStep = 'failed',
Barath Kumar R07698ab2021-03-30 11:50:42 +053055 operationalStateFourthStep = 'scaling',
kumaran.m3b4814a2020-05-01 19:48:54 +053056 configStateFirstStep = 'init',
57 configStateSecondStep = 'configured',
58 configStateThirdStep = 'failed',
59 historyStateFirstStep = 'PROCESSING',
60 historyStateSecondStep = 'COMPLETED',
61 historyStateThirdStep = 'FAILED',
62 wimOperationalStateFirstStep = 'PROCESSING',
63 wimOperationalStateStateSecondStep = 'ENABLED',
64 wimOperationalStateThirdStep = 'ERROR',
65 vimOperationalStateFirstStep = 'PROCESSING',
66 vimOperationalStateStateSecondStep = 'ENABLED',
67 vimOperationalStateThirdStep = 'ERROR',
68 sdnOperationalStateFirstStep = 'PROCESSING',
69 sdnOperationalStateStateSecondStep = 'ENABLED',
70 sdnOperationalStateThirdStep = 'ERROR',
71 k8OperationalStateFirstStep = 'PROCESSING',
72 k8OperationalStateStateSecondStep = 'ENABLED',
73 k8OperationalStateThirdStep = 'ERROR'
74}
75/** Interface for Post options */
76export interface POSTAPIRESOURCE {
77 apiURLHeader: APIURLHEADER;
78 payload?: object;
79}
80/** Interface for ApiURL Header */
81export interface APIURLHEADER {
82 url: string;
83 httpOptions?: APIHEADERS;
84}
85/** Interface for the Get Method with response type */
86export interface GETAPIURLHEADER {
87 headers: HttpHeaders;
88 responseType: string;
89}
90/** Interface for Httpoptions Header */
91interface APIHEADERS {
92 headers: HttpHeaders;
93}
94/** Interface for the Error */
95export interface ERRORDATA {
96 error: ERRORDETAILSDATA;
97}
98/** Interface for the Error Details */
99interface ERRORDETAILSDATA {
100 detail: string;
101 code?: string;
102 status?: number;
103 text?: Function;
104}
105/** Handle the URL params */
106export interface URLPARAMS {
107 page: string;
108 id: string;
109 titleName?: string;
110 forceDeleteType?: boolean;
111 name?: string;
112 memberIndex?: object;
113 nsConfig?: object;
114 projectID?: string;
115 username?: string;
Barath Kumar R07698ab2021-03-30 11:50:42 +0530116 vnfID?: [];
117 nsID?: string;
118 nsd?: NSD;
119 data?: VNFD[];
Barath Kumar Rf2ae5462021-03-01 12:52:33 +0530120 configs?: object;
121 actions?: object;
122 executedActions?: EXECUTEDACTIONS[];
kumaran.m3b4814a2020-05-01 19:48:54 +0530123}
124/** Handle the Delete params */
125export interface DELETEPARAMS {
126 identifier: string;
127 name?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530128 projectName?: string;
129 userName?: string;
130 username?: string;
131 page?: string;
132 id?: string;
Barath Kumar R063a3f12020-12-29 16:35:09 +0530133 productName?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530134}
135
136/** Interface for the Delete Details */
137export interface MODALCLOSERESPONSEDATA {
138 message: string;
139}
140
141/** Interface for the modal closer */
142export interface MODALCLOSERESPONSEWITHCP {
143 message: string;
144 connection_point?: string;
145}
146
147/** Interface for local storage settings */
148export interface LOCALSTORAGE {
149 id_token?: string;
150 project_id?: string;
151 expires?: string;
152 username?: string;
153 project?: string;
154 project_name?: string;
155 id?: string;
156 admin?: boolean;
157 isAdmin?: string;
158 token_state?: string;
159}
160/** Interface for Tar settings */
161export interface TARSETTINGS {
162 name?: string;
163 'type'?: string;
164 readAsString?: Function;
165 buffer: ArrayBuffer;
Barath Kumar Rd477b852020-07-07 15:24:05 +0530166 header_offset?: Number;
167 size?: number;
Barath Kumar Rdb1aeb02020-10-13 18:14:16 +0530168 linkname?: string;
169 uname?: string;
170 gname?: string;
171}
172/** Interface for File Settings */
173export interface FILESETTINGS {
174 'type'?: string;
175 linkname?: string;
176 owner?: string;
177 group?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530178}
179/** Interface for Package information */
180export interface PACKAGEINFO {
181 id?: string;
182 packageType?: string;
183 descriptor: string;
184}
185
186/** Interface For the Pagination pager in ng-smarttable */
187export interface PAGERSMARTTABLE {
188 display: boolean;
189 perPage: number;
190}
191/** Interface for breadcrumb item */
192export interface BREADCRUMBITEM {
193 title: string;
194 url: string;
195}
196/** Interface For the Pagination pager in ng-smarttable */
197export interface SMARTTABLECLASS {
198 // tslint:disable-next-line: no-reserved-keywords
199 class: string;
200}
201/** Constants of the VIM Types */
202export const VIM_TYPES: TYPESECTION[] = [
203 { value: 'openstack', title: 'Openstack' },
204 { value: 'aws', title: 'AWS' },
205 { value: 'vmware', title: 'VMware vCD' },
206 { value: 'openvim', title: 'OpenVIM' },
207 { value: 'opennebula', title: 'OpenNebula' },
208 { value: 'azure', title: 'Azure' }
209];
210/** Constants of the SDN Types */
211export const SDN_TYPES: TYPESECTION[] = [
212 { value: 'arista', title: 'Arista' },
213 { value: 'floodlightof', title: 'Floodlight openflow' },
214 { value: 'odlof', title: 'OpenDaylight openflow' },
215 { value: 'onosof', title: 'ONOS openflow' },
216 { value: 'onos_vpls', title: 'ONOS vpls' }
217];
218/** Constants of the WIM Types */
219export const WIM_TYPES: TYPESECTION[] = [
220 { value: 'arista', title: 'Arista' },
221 { value: 'dynpac', title: 'DynPac' },
222 { value: 'floodlightof', title: 'Floodlight openflow' },
223 { value: 'odlof', title: 'OpenDaylight openflow' },
224 { value: 'onosof', title: 'ONOS openflow' },
225 { value: 'onos_vpls', title: 'ONOS vpls' },
226 { value: 'tapi', title: 'TAPI' }
227];
Barath Kumar R403234e2020-07-07 15:48:58 +0530228/** Constants of the OSM Repo Types */
229export const OSMREPO_TYPES: TYPESECTION[] = [
230 { value: 'osm', title: 'OSM' }
231];
kumaran.m3b4814a2020-05-01 19:48:54 +0530232/** Interface for List, Add WIM & SDN Types */
233export interface TYPESECTION {
234 value: string;
235 title: string;
236}
Barath Kumar R063a3f12020-12-29 16:35:09 +0530237/** Interface for PRIMITIVETYPES */
238export interface PRIMITIVETYPES {
239 title: string;
240 value: string;
241}
242/** Interface for the PRIMITIVEDATA */
243export interface PRIMITIVEDATA {
244 parameter: {}[];
245}
Barath Kumar R16070582021-02-08 18:19:35 +0530246/** Constant for VIM type Openstack's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530247export const TYPEOPENSTACK: {} = {
248 sdn_controller: '',
249 APIversion: '',
250 sdn_port_mapping: '',
251 project_domain_id: '',
252 vim_network_name: '',
253 project_domain_name: '',
254 config_vim_ype: '',
255 user_domain_id: '',
256 security_groups: '',
257 user_domain_name: '',
Barath Kumar R1245fc82021-04-16 13:34:06 +0530258 availability_zone: '',
Barath Kumar Rd477b852020-07-07 15:24:05 +0530259 keypair: '',
260 region_name: '',
261 dataplane_physical_net: '',
262 insecure: '',
263 use_floating_ip: '',
264 use_internal_endpoint: '',
265 microversion: '',
266 additional_conf: '',
267 use_existing_flavors: ''
268};
Barath Kumar R16070582021-02-08 18:19:35 +0530269/** Constant for VIM type AWS's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530270export const TYPEAWS: {} = {
271 sdn_controller: '',
272 vpc_cidr_block: '',
273 sdn_port_mapping: '',
274 security_groups: '',
275 vim_network_name: '',
276 keypair: '',
277 region_name: '',
278 flavor_info: '',
279 additional_conf: ''
280};
Barath Kumar R16070582021-02-08 18:19:35 +0530281/** Constant for VIM type VMWARE's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530282export const TYPEVMWARE: {} = {
283 sdn_controller: '',
284 orgname: '',
285 sdn_port_mapping: '',
286 vcenter_ip: '',
287 vim_network_name: '',
288 admin_username: '',
289 admin_password: '',
290 vcenter_port: '',
291 vcenter_user: '',
292 vcenter_password: '',
293 nsx_manager: '',
294 nsx_user: '',
295 nsx_password: '',
296 vrops_site: '',
297 vrops_user: '',
298 vrops_password: '',
299 additional_conf: ''
300};
Barath Kumar R16070582021-02-08 18:19:35 +0530301/** Constant for VIM type OPENVIMNEBULA's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530302export const TYPEOPENVIMNEBULA: {} = {
303 sdn_controller: '',
304 sdn_port_mapping: '',
305 vim_network_name: '',
306 additional_conf: ''
307};
Barath Kumar R16070582021-02-08 18:19:35 +0530308/** Constant for VIM type AZURE's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530309export const TYPEAZURE: {} = {
310 subscription_id: '',
311 region_name: '',
312 resource_group: '',
313 vnet_name: '',
314 flavors_pattern: ''
315};
Barath Kumar R16070582021-02-08 18:19:35 +0530316/** Constant for VIM other type Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530317export const TYPEOTERS: {} = {
318 sdn_controller: '',
319 sdn_port_mapping: '',
320 vim_network_name: '',
321 use_floating_ip: '',
322 use_internal_endpoint: '',
323 additional_conf: '',
324 use_existing_flavors: ''
325};
Barath Kumar R16070582021-02-08 18:19:35 +0530326/** Interface for Domains */
327export interface DOMAINS {
328 project_domain_name: string;
329 user_domain_name: string;
330}
331/** Interface for Login */
332export interface LOGINPARAMS {
333 username?: string;
334 password?: string;
335}