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