Feature-5950: Management of quotas in VIM Account
[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 }
76 /** Interface for Post options */
77 export interface POSTAPIRESOURCE {
78     apiURLHeader: APIURLHEADER;
79     payload?: object;
80 }
81 /** Interface for ApiURL Header */
82 export interface APIURLHEADER {
83     url: string;
84     httpOptions?: APIHEADERS;
85 }
86 /** Interface for the Get Method with response type */
87 export interface GETAPIURLHEADER {
88     headers: HttpHeaders;
89     responseType: string;
90 }
91 /** Interface for Httpoptions Header */
92 interface APIHEADERS {
93     headers: HttpHeaders;
94 }
95 /** Interface for the Error */
96 export interface ERRORDATA {
97     error: ERRORDETAILSDATA;
98 }
99 /** Interface for the Error Details */
100 interface ERRORDETAILSDATA {
101     detail: string;
102     code?: string;
103     status?: number;
104     text?: Function;
105 }
106 /** Handle the URL params */
107 export interface URLPARAMS {
108     page: string;
109     id: string;
110     titleName?: string;
111     forceDeleteType?: boolean;
112     name?: string;
113     memberIndex?: object;
114     nsConfig?: object;
115     projectID?: string;
116     username?: string;
117     vnfID?: [];
118     nsID?: string;
119     nsd?: NSD;
120     data?: VNFD[];
121     configs?: object;
122     actions?: object;
123     executedActions?: EXECUTEDACTIONS[];
124 }
125 /** Handle the Delete params */
126 export interface DELETEPARAMS {
127     identifier: string;
128     name?: string;
129     projectName?: string;
130     userName?: string;
131     username?: string;
132     page?: string;
133     id?: string;
134     productName?: string;
135 }
136
137 /** Interface for the Delete Details */
138 export interface MODALCLOSERESPONSEDATA {
139     message: string;
140 }
141
142 /** Interface for the modal closer */
143 export interface MODALCLOSERESPONSEWITHCP {
144     message: string;
145     connection_point?: string;
146 }
147
148 /** Interface for local storage settings */
149 export interface LOCALSTORAGE {
150     id_token?: string;
151     project_id?: string;
152     expires?: string;
153     username?: string;
154     project?: string;
155     project_name?: string;
156     id?: string;
157     admin?: boolean;
158     isAdmin?: string;
159     token_state?: string;
160 }
161 /** Interface for Tar settings */
162 export interface TARSETTINGS {
163     name?: string;
164     'type'?: string;
165     readAsString?: Function;
166     buffer: ArrayBuffer;
167     header_offset?: Number;
168     size?: number;
169     linkname?: string;
170     uname?: string;
171     gname?: string;
172 }
173 /** Interface for File Settings */
174 export interface FILESETTINGS {
175     'type'?: string;
176     linkname?: string;
177     owner?: string;
178     group?: string;
179 }
180 /** Interface for Package information */
181 export interface PACKAGEINFO {
182     id?: string;
183     packageType?: string;
184     descriptor: string;
185 }
186
187 /** Interface For the Pagination pager in ng-smarttable */
188 export interface PAGERSMARTTABLE {
189     display: boolean;
190     perPage: number;
191 }
192 /** Interface for breadcrumb item */
193 export interface BREADCRUMBITEM {
194     title: string;
195     url: string;
196 }
197 /** Interface For the Pagination pager in ng-smarttable */
198 export interface SMARTTABLECLASS {
199     // tslint:disable-next-line: no-reserved-keywords
200     class: string;
201 }
202 /** Constants of the VIM Types */
203 export const VIM_TYPES: TYPESECTION[] = [
204     { value: 'openstack', title: 'Openstack' },
205     { value: 'aws', title: 'AWS' },
206     { value: 'vmware', title: 'VMware vCD' },
207     { value: 'openvim', title: 'OpenVIM' },
208     { value: 'opennebula', title: 'OpenNebula' },
209     { value: 'azure', title: 'Azure' }
210 ];
211 /** Constants of the SDN Types */
212 export const SDN_TYPES: TYPESECTION[] = [
213     { value: 'arista', title: 'Arista' },
214     { value: 'floodlightof', title: 'Floodlight openflow' },
215     { value: 'odlof', title: 'OpenDaylight openflow' },
216     { value: 'onosof', title: 'ONOS openflow' },
217     { value: 'onos_vpls', title: 'ONOS vpls' }
218 ];
219 /** Constants of the WIM Types */
220 export const WIM_TYPES: TYPESECTION[] = [
221     { value: 'arista', title: 'Arista' },
222     { value: 'dynpac', title: 'DynPac' },
223     { value: 'floodlightof', title: 'Floodlight openflow' },
224     { value: 'odlof', title: 'OpenDaylight openflow' },
225     { value: 'onosof', title: 'ONOS openflow' },
226     { value: 'onos_vpls', title: 'ONOS vpls' },
227     { value: 'tapi', title: 'TAPI' }
228 ];
229 /** Constants of the OSM Repo Types */
230 export const OSMREPO_TYPES: TYPESECTION[] = [
231     { value: 'osm', title: 'OSM' }
232 ];
233 /** Interface for List, Add WIM & SDN Types */
234 export interface TYPESECTION {
235     value: string;
236     title: string;
237 }
238 /** Interface for PRIMITIVETYPES */
239 export interface PRIMITIVETYPES {
240     title: string;
241     value: string;
242 }
243 /** Interface for the PRIMITIVEDATA */
244 export interface PRIMITIVEDATA {
245     parameter: {}[];
246 }
247 /** Constant for VIM type Openstack's Config */
248 export const TYPEOPENSTACK: {} = {
249     sdn_controller: '',
250     APIversion: '',
251     sdn_port_mapping: '',
252     project_domain_id: '',
253     vim_network_name: '',
254     project_domain_name: '',
255     config_vim_ype: '',
256     user_domain_id: '',
257     security_groups: '',
258     user_domain_name: '',
259     availability_zone: '',
260     keypair: '',
261     region_name: '',
262     dataplane_physical_net: '',
263     insecure: '',
264     use_floating_ip: '',
265     use_internal_endpoint: '',
266     microversion: '',
267     additional_conf: '',
268     use_existing_flavors: ''
269 };
270 /** Constant for VIM type AWS's Config */
271 export const TYPEAWS: {} = {
272     sdn_controller: '',
273     vpc_cidr_block: '',
274     sdn_port_mapping: '',
275     security_groups: '',
276     vim_network_name: '',
277     keypair: '',
278     region_name: '',
279     flavor_info: '',
280     additional_conf: ''
281 };
282 /** Constant for VIM type VMWARE's Config */
283 export const TYPEVMWARE: {} = {
284     sdn_controller: '',
285     orgname: '',
286     sdn_port_mapping: '',
287     vcenter_ip: '',
288     vim_network_name: '',
289     admin_username: '',
290     admin_password: '',
291     vcenter_port: '',
292     vcenter_user: '',
293     vcenter_password: '',
294     nsx_manager: '',
295     nsx_user: '',
296     nsx_password: '',
297     vrops_site: '',
298     vrops_user: '',
299     vrops_password: '',
300     additional_conf: ''
301 };
302 /** Constant for VIM type OPENVIMNEBULA's Config */
303 export const TYPEOPENVIMNEBULA: {} = {
304     sdn_controller: '',
305     sdn_port_mapping: '',
306     vim_network_name: '',
307     additional_conf: ''
308 };
309 /** Constant for VIM type AZURE's Config */
310 export const TYPEAZURE: {} = {
311     subscription_id: '',
312     region_name: '',
313     resource_group: '',
314     vnet_name: '',
315     flavors_pattern: ''
316 };
317 /** Constant for VIM other type Config */
318 export const TYPEOTERS: {} = {
319     sdn_controller: '',
320     sdn_port_mapping: '',
321     vim_network_name: '',
322     use_floating_ip: '',
323     use_internal_endpoint: '',
324     additional_conf: '',
325     use_existing_flavors: ''
326 };
327 /** Interface for Domains */
328 export interface DOMAINS {
329     project_domain_name: string;
330     user_domain_name: string;
331 }
332 /** Interface for Login */
333 export interface LOGINPARAMS {
334     username?: string;
335     password?: string;
336 }
337 /** Interface for the LABELVALUE */
338 export interface LABELVALUE {
339     label: string;
340     value: string;
341 }