blob: 627074bb2427b00323ac43751de567a1aaa27680 [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];
Barath Kumar R403234e2020-07-07 15:48:58 +0530205/** Constants of the OSM Repo Types */
206export const OSMREPO_TYPES: TYPESECTION[] = [
207 { value: 'osm', title: 'OSM' }
208];
kumaran.m3b4814a2020-05-01 19:48:54 +0530209/** Interface for List, Add WIM & SDN Types */
210export interface TYPESECTION {
211 value: string;
212 title: string;
213}
Barath Kumar Rd477b852020-07-07 15:24:05 +0530214/** Interface for VIM type Openstack's Config */
215export const TYPEOPENSTACK: {} = {
216 sdn_controller: '',
217 APIversion: '',
218 sdn_port_mapping: '',
219 project_domain_id: '',
220 vim_network_name: '',
221 project_domain_name: '',
222 config_vim_ype: '',
223 user_domain_id: '',
224 security_groups: '',
225 user_domain_name: '',
226 availabilityZone: '',
227 keypair: '',
228 region_name: '',
229 dataplane_physical_net: '',
230 insecure: '',
231 use_floating_ip: '',
232 use_internal_endpoint: '',
233 microversion: '',
234 additional_conf: '',
235 use_existing_flavors: ''
236};
237/** Interface for VIM type AWS's Config */
238export const TYPEAWS: {} = {
239 sdn_controller: '',
240 vpc_cidr_block: '',
241 sdn_port_mapping: '',
242 security_groups: '',
243 vim_network_name: '',
244 keypair: '',
245 region_name: '',
246 flavor_info: '',
247 additional_conf: ''
248};
249/** Interface for VIM type VMWARE's Config */
250export const TYPEVMWARE: {} = {
251 sdn_controller: '',
252 orgname: '',
253 sdn_port_mapping: '',
254 vcenter_ip: '',
255 vim_network_name: '',
256 admin_username: '',
257 admin_password: '',
258 vcenter_port: '',
259 vcenter_user: '',
260 vcenter_password: '',
261 nsx_manager: '',
262 nsx_user: '',
263 nsx_password: '',
264 vrops_site: '',
265 vrops_user: '',
266 vrops_password: '',
267 additional_conf: ''
268};
269/** Interface for VIM type OPENVIMNEBULA's Config */
270export const TYPEOPENVIMNEBULA: {} = {
271 sdn_controller: '',
272 sdn_port_mapping: '',
273 vim_network_name: '',
274 additional_conf: ''
275};
276/** Interface for VIM type AZURE's Config */
277export const TYPEAZURE: {} = {
278 subscription_id: '',
279 region_name: '',
280 resource_group: '',
281 vnet_name: '',
282 flavors_pattern: ''
283};
284/** Interface for VIM other type Config */
285export const TYPEOTERS: {} = {
286 sdn_controller: '',
287 sdn_port_mapping: '',
288 vim_network_name: '',
289 use_floating_ip: '',
290 use_internal_endpoint: '',
291 additional_conf: '',
292 use_existing_flavors: ''
293};