blob: 508a96a8e29841a160138f8d014824884d287d07 [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 */
23/**
24 * handle count @enum
25 */
26export 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 */
46export 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 */
70export interface POSTAPIRESOURCE {
71 apiURLHeader: APIURLHEADER;
72 payload?: object;
73}
74/** Interface for ApiURL Header */
75export interface APIURLHEADER {
76 url: string;
77 httpOptions?: APIHEADERS;
78}
79/** Interface for the Get Method with response type */
80export interface GETAPIURLHEADER {
81 headers: HttpHeaders;
82 responseType: string;
83}
84/** Interface for Httpoptions Header */
85interface APIHEADERS {
86 headers: HttpHeaders;
87}
88/** Interface for the Error */
89export interface ERRORDATA {
90 error: ERRORDETAILSDATA;
91}
92/** Interface for the Error Details */
93interface ERRORDETAILSDATA {
94 detail: string;
95 code?: string;
96 status?: number;
97 text?: Function;
98}
99/** Handle the URL params */
100export 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 */
112export 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 */
124export interface MODALCLOSERESPONSEDATA {
125 message: string;
126}
127
128/** Interface for the modal closer */
129export interface MODALCLOSERESPONSEWITHCP {
130 message: string;
131 connection_point?: string;
132}
133
134/** Interface for local storage settings */
135export 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 */
148export interface TARSETTINGS {
149 name?: string;
150 'type'?: string;
151 readAsString?: Function;
152 buffer: ArrayBuffer;
Barath Kumar Rd477b852020-07-07 15:24:05 +0530153 header_offset?: Number;
154 size?: number;
kumaran.m3b4814a2020-05-01 19:48:54 +0530155}
156/** Interface for Package information */
157export interface PACKAGEINFO {
158 id?: string;
159 packageType?: string;
160 descriptor: string;
161}
162
163/** Interface For the Pagination pager in ng-smarttable */
164export interface PAGERSMARTTABLE {
165 display: boolean;
166 perPage: number;
167}
168/** Interface for breadcrumb item */
169export interface BREADCRUMBITEM {
170 title: string;
171 url: string;
172}
173/** Interface For the Pagination pager in ng-smarttable */
174export interface SMARTTABLECLASS {
175 // tslint:disable-next-line: no-reserved-keywords
176 class: string;
177}
178/** Constants of the VIM Types */
179export const VIM_TYPES: TYPESECTION[] = [
180 { value: 'openstack', title: 'Openstack' },
181 { value: 'aws', title: 'AWS' },
182 { value: 'vmware', title: 'VMware vCD' },
183 { value: 'openvim', title: 'OpenVIM' },
184 { value: 'opennebula', title: 'OpenNebula' },
185 { value: 'azure', title: 'Azure' }
186];
187/** Constants of the SDN Types */
188export const SDN_TYPES: TYPESECTION[] = [
189 { value: 'arista', title: 'Arista' },
190 { value: 'floodlightof', title: 'Floodlight openflow' },
191 { value: 'odlof', title: 'OpenDaylight openflow' },
192 { value: 'onosof', title: 'ONOS openflow' },
193 { value: 'onos_vpls', title: 'ONOS vpls' }
194];
195/** Constants of the WIM Types */
196export const WIM_TYPES: TYPESECTION[] = [
197 { value: 'arista', title: 'Arista' },
198 { value: 'dynpac', title: 'DynPac' },
199 { value: 'floodlightof', title: 'Floodlight openflow' },
200 { value: 'odlof', title: 'OpenDaylight openflow' },
201 { value: 'onosof', title: 'ONOS openflow' },
202 { value: 'onos_vpls', title: 'ONOS vpls' },
203 { value: 'tapi', title: 'TAPI' }
204];
205/** Interface for List, Add WIM & SDN Types */
206export interface TYPESECTION {
207 value: string;
208 title: string;
209}
Barath Kumar Rd477b852020-07-07 15:24:05 +0530210/** Interface for VIM type Openstack's Config */
211export const TYPEOPENSTACK: {} = {
212 sdn_controller: '',
213 APIversion: '',
214 sdn_port_mapping: '',
215 project_domain_id: '',
216 vim_network_name: '',
217 project_domain_name: '',
218 config_vim_ype: '',
219 user_domain_id: '',
220 security_groups: '',
221 user_domain_name: '',
222 availabilityZone: '',
223 keypair: '',
224 region_name: '',
225 dataplane_physical_net: '',
226 insecure: '',
227 use_floating_ip: '',
228 use_internal_endpoint: '',
229 microversion: '',
230 additional_conf: '',
231 use_existing_flavors: ''
232};
233/** Interface for VIM type AWS's Config */
234export const TYPEAWS: {} = {
235 sdn_controller: '',
236 vpc_cidr_block: '',
237 sdn_port_mapping: '',
238 security_groups: '',
239 vim_network_name: '',
240 keypair: '',
241 region_name: '',
242 flavor_info: '',
243 additional_conf: ''
244};
245/** Interface for VIM type VMWARE's Config */
246export const TYPEVMWARE: {} = {
247 sdn_controller: '',
248 orgname: '',
249 sdn_port_mapping: '',
250 vcenter_ip: '',
251 vim_network_name: '',
252 admin_username: '',
253 admin_password: '',
254 vcenter_port: '',
255 vcenter_user: '',
256 vcenter_password: '',
257 nsx_manager: '',
258 nsx_user: '',
259 nsx_password: '',
260 vrops_site: '',
261 vrops_user: '',
262 vrops_password: '',
263 additional_conf: ''
264};
265/** Interface for VIM type OPENVIMNEBULA's Config */
266export const TYPEOPENVIMNEBULA: {} = {
267 sdn_controller: '',
268 sdn_port_mapping: '',
269 vim_network_name: '',
270 additional_conf: ''
271};
272/** Interface for VIM type AZURE's Config */
273export const TYPEAZURE: {} = {
274 subscription_id: '',
275 region_name: '',
276 resource_group: '',
277 vnet_name: '',
278 flavors_pattern: ''
279};
280/** Interface for VIM other type Config */
281export const TYPEOTERS: {} = {
282 sdn_controller: '',
283 sdn_port_mapping: '',
284 vim_network_name: '',
285 use_floating_ip: '',
286 use_internal_endpoint: '',
287 additional_conf: '',
288 use_existing_flavors: ''
289};