blob: 7284bbce96cf062135faf255d57f3c44cd1bf6c9 [file] [log] [blame]
kumaran.m3b4814a2020-05-01 19:48:54 +05301/*
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 */
18import { HttpHeaders } from '@angular/common/http';
19
20/**
21 * @file Model for Commonly used information.
22 */
Barath Kumar R43dec152020-12-29 16:35:09 +053023// tslint:disable: completed-docs
kumaran.m3b4814a2020-05-01 19:48:54 +053024/**
25 * handle count @enum
26 */
27export 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 */
47export 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 */
71export interface POSTAPIRESOURCE {
72 apiURLHeader: APIURLHEADER;
73 payload?: object;
74}
75/** Interface for ApiURL Header */
76export interface APIURLHEADER {
77 url: string;
78 httpOptions?: APIHEADERS;
79}
80/** Interface for the Get Method with response type */
81export interface GETAPIURLHEADER {
82 headers: HttpHeaders;
83 responseType: string;
84}
85/** Interface for Httpoptions Header */
86interface APIHEADERS {
87 headers: HttpHeaders;
88}
89/** Interface for the Error */
90export interface ERRORDATA {
91 error: ERRORDETAILSDATA;
92}
93/** Interface for the Error Details */
94interface ERRORDETAILSDATA {
95 detail: string;
96 code?: string;
97 status?: number;
98 text?: Function;
99}
100/** Handle the URL params */
101export 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 */
113export interface DELETEPARAMS {
114 identifier: string;
115 name?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530116 projectName?: string;
117 userName?: string;
118 username?: string;
119 page?: string;
120 id?: string;
Barath Kumar R43dec152020-12-29 16:35:09 +0530121 productName?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530122}
123
124/** Interface for the Delete Details */
125export interface MODALCLOSERESPONSEDATA {
126 message: string;
127}
128
129/** Interface for the modal closer */
130export interface MODALCLOSERESPONSEWITHCP {
131 message: string;
132 connection_point?: string;
133}
134
135/** Interface for local storage settings */
136export 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 */
149export interface TARSETTINGS {
150 name?: string;
151 'type'?: string;
152 readAsString?: Function;
153 buffer: ArrayBuffer;
Barath Kumar Rd477b852020-07-07 15:24:05 +0530154 header_offset?: Number;
155 size?: number;
Barath Kumar Rdb1aeb02020-10-13 18:14:16 +0530156 linkname?: string;
157 uname?: string;
158 gname?: string;
159}
160/** Interface for File Settings */
161export interface FILESETTINGS {
162 'type'?: string;
163 linkname?: string;
164 owner?: string;
165 group?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530166}
167/** Interface for Package information */
168export interface PACKAGEINFO {
169 id?: string;
170 packageType?: string;
171 descriptor: string;
172}
173
174/** Interface For the Pagination pager in ng-smarttable */
175export interface PAGERSMARTTABLE {
176 display: boolean;
177 perPage: number;
178}
179/** Interface for breadcrumb item */
180export interface BREADCRUMBITEM {
181 title: string;
182 url: string;
183}
184/** Interface For the Pagination pager in ng-smarttable */
185export interface SMARTTABLECLASS {
186 // tslint:disable-next-line: no-reserved-keywords
187 class: string;
188}
189/** Constants of the VIM Types */
190export 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 */
199export 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 */
207export 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];
Barath Kumar R403234e2020-07-07 15:48:58 +0530216/** Constants of the OSM Repo Types */
217export const OSMREPO_TYPES: TYPESECTION[] = [
218 { value: 'osm', title: 'OSM' }
219];
kumaran.m3b4814a2020-05-01 19:48:54 +0530220/** Interface for List, Add WIM & SDN Types */
221export interface TYPESECTION {
222 value: string;
223 title: string;
224}
Barath Kumar R43dec152020-12-29 16:35:09 +0530225/** Interface for PRIMITIVETYPES */
226export interface PRIMITIVETYPES {
227 title: string;
228 value: string;
229}
230/** Interface for the PRIMITIVEDATA */
231export interface PRIMITIVEDATA {
232 parameter: {}[];
233}
Barath Kumar R76e55f42021-02-08 18:19:35 +0530234/** Constant for VIM type Openstack's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530235export 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};
Barath Kumar R76e55f42021-02-08 18:19:35 +0530257/** Constant for VIM type AWS's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530258export 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};
Barath Kumar R76e55f42021-02-08 18:19:35 +0530269/** Constant for VIM type VMWARE's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530270export 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};
Barath Kumar R76e55f42021-02-08 18:19:35 +0530289/** Constant for VIM type OPENVIMNEBULA's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530290export const TYPEOPENVIMNEBULA: {} = {
291 sdn_controller: '',
292 sdn_port_mapping: '',
293 vim_network_name: '',
294 additional_conf: ''
295};
Barath Kumar R76e55f42021-02-08 18:19:35 +0530296/** Constant for VIM type AZURE's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530297export const TYPEAZURE: {} = {
298 subscription_id: '',
299 region_name: '',
300 resource_group: '',
301 vnet_name: '',
302 flavors_pattern: ''
303};
Barath Kumar R76e55f42021-02-08 18:19:35 +0530304/** Constant for VIM other type Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530305export 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};
Barath Kumar R76e55f42021-02-08 18:19:35 +0530314/** Interface for Domains */
315export interface DOMAINS {
316 project_domain_name: string;
317 user_domain_name: string;
318}
319/** Interface for Login */
320export interface LOGINPARAMS {
321 username?: string;
322 password?: string;
323}