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