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