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