a33e6f37c7bacc51c98b73b397dcab1c4dbbccce
[osm/NG-UI.git] / src / models / CommonModel.ts
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';
19 import { NSD } from 'NSInstanceModel';
20 import { EXECUTEDACTIONS } from 'OperationalModel';
21 import { VNFD } from 'VNFDModel';
22
23 /**
24  * @file  Model for Commonly used information.
25  */
26 // tslint:disable: completed-docs
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,
45     splitLatitude = 2,
46     timeOutDefaultSeconds = 5,
47     oneGB = 1024
48 }
49 /**
50  * handle count @enum
51  */
52 export enum CONFIGCONSTANT {
53     operationalStateFirstStep = 'init',
54     operationalStateSecondStep = 'running',
55     operationalStateThirdStep = 'failed',
56     operationalStateFourthStep = 'scaling',
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',
74     k8OperationalStateThirdStep = 'ERROR',
75     done = 'done',
76     close = 'close'
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;
119     vnfID?: [];
120     nsID?: string;
121     nsd?: NSD;
122     data?: VNFD[];
123     configs?: object;
124     actions?: object;
125     executedActions?: EXECUTEDACTIONS[];
126 }
127 /** Handle the Delete params */
128 export interface DELETEPARAMS {
129     identifier: string;
130     name?: string;
131     projectName?: string;
132     userName?: string;
133     username?: string;
134     page?: string;
135     id?: string;
136     productName?: string;
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;
169     header_offset?: Number;
170     size?: number;
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;
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 {
201     // tslint:disable-next-line: no-reserved-keywords
202     class: string;
203 }
204 /** Constants of the VIM Types */
205 export const VIM_TYPES: TYPESECTION[] = [
206     { value: 'openstack', title: 'Openstack' },
207     { value: 'aws', title: 'AWS' },
208     { value: 'vmware', title: 'VMware vCD' },
209     { value: 'openvim', title: 'OpenVIM' },
210     { value: 'opennebula', title: 'OpenNebula' },
211     { value: 'azure', title: 'Azure' },
212     { value: 'dummy', title: 'Dummy' }
213 ];
214 /** Constants of the SDN Types */
215 export const SDN_TYPES: TYPESECTION[] = [
216     { value: 'arista', title: 'Arista' },
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 ];
222 /** Constants of the WIM Types */
223 export const WIM_TYPES: TYPESECTION[] = [
224     { value: 'arista', title: 'Arista' },
225     { value: 'dynpac', title: 'DynPac' },
226     { value: 'floodlightof', title: 'Floodlight openflow' },
227     { value: 'odlof', title: 'OpenDaylight openflow' },
228     { value: 'onosof', title: 'ONOS openflow' },
229     { value: 'onos_vpls', title: 'ONOS vpls' },
230     { value: 'tapi', title: 'TAPI' }
231 ];
232 /** Constants of the OSM Repo Types */
233 export const OSMREPO_TYPES: TYPESECTION[] = [
234     { value: 'osm', title: 'OSM' }
235 ];
236 /** Interface for List, Add WIM & SDN Types */
237 export interface TYPESECTION {
238     value: string;
239     title: string;
240 }
241 /** Interface for PRIMITIVETYPES */
242 export interface PRIMITIVETYPES {
243     title: string;
244     value: string;
245 }
246 /** Interface for the PRIMITIVEDATA */
247 export interface PRIMITIVEDATA {
248     parameter: {}[];
249 }
250 /** Constant for VIM type Openstack's Config */
251 export const TYPEOPENSTACK: {} = {
252     sdn_controller: '',
253     APIversion: '',
254     sdn_port_mapping: '',
255     project_domain_id: '',
256     vim_network_name: '',
257     project_domain_name: '',
258     config_vim_ype: '',
259     user_domain_id: '',
260     security_groups: '',
261     user_domain_name: '',
262     availability_zone: '',
263     keypair: '',
264     region_name: '',
265     dataplane_physical_net: '',
266     insecure: '',
267     use_floating_ip: '',
268     use_internal_endpoint: '',
269     microversion: '',
270     additional_conf: '',
271     use_existing_flavors: ''
272 };
273 /** Constant for VIM type AWS's Config */
274 export const TYPEAWS: {} = {
275     sdn_controller: '',
276     vpc_cidr_block: '',
277     sdn_port_mapping: '',
278     security_groups: '',
279     vim_network_name: '',
280     keypair: '',
281     region_name: '',
282     flavor_info: '',
283     additional_conf: ''
284 };
285 /** Constant for VIM type VMWARE's Config */
286 export const TYPEVMWARE: {} = {
287     sdn_controller: '',
288     orgname: '',
289     sdn_port_mapping: '',
290     vcenter_ip: '',
291     vim_network_name: '',
292     admin_username: '',
293     admin_password: '',
294     vcenter_port: '',
295     vcenter_user: '',
296     vcenter_password: '',
297     nsx_manager: '',
298     nsx_user: '',
299     nsx_password: '',
300     vrops_site: '',
301     vrops_user: '',
302     vrops_password: '',
303     additional_conf: ''
304 };
305 /** Constant for VIM type OPENVIMNEBULA's Config */
306 export const TYPEOPENVIMNEBULA: {} = {
307     sdn_controller: '',
308     sdn_port_mapping: '',
309     vim_network_name: '',
310     additional_conf: ''
311 };
312 /** Constant for VIM type AZURE's Config */
313 export const TYPEAZURE: {} = {
314     subscription_id: '',
315     region_name: '',
316     resource_group: '',
317     vnet_name: '',
318     flavors_pattern: ''
319 };
320 /** Constant for VIM other type Config */
321 export const TYPEOTERS: {} = {
322     sdn_controller: '',
323     sdn_port_mapping: '',
324     vim_network_name: '',
325     use_floating_ip: '',
326     use_internal_endpoint: '',
327     additional_conf: '',
328     use_existing_flavors: ''
329 };
330 /** Interface for Domains */
331 export interface DOMAINS {
332     project_domain_name: string;
333     user_domain_name: string;
334 }
335 /** Interface for Login */
336 export interface LOGINPARAMS {
337     username?: string;
338     password?: string;
339     old_password?: string;
340 }
341 /** Interface for the LABELVALUE */
342 export interface LABELVALUE {
343     label: string;
344     value: string;
345 }