blob: a33e6f37c7bacc51c98b73b397dcab1c4dbbccce [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';
Barath Kumar Rf2ae5462021-03-01 12:52:33 +053020import { EXECUTEDACTIONS } from 'OperationalModel';
Barath Kumar R07698ab2021-03-30 11:50:42 +053021import { VNFD } from 'VNFDModel';
kumaran.m3b4814a2020-05-01 19:48:54 +053022
23/**
24 * @file Model for Commonly used information.
25 */
Barath Kumar R063a3f12020-12-29 16:35:09 +053026// tslint:disable: completed-docs
kumaran.m3b4814a2020-05-01 19:48:54 +053027/**
28 * handle count @enum
29 */
30export enum CONSTANTNUMBER {
31 randomNumber = 4,
32 osmapviewlong = 77.673,
33 osmapviewlat = 19.166,
34 chennailong = 80.2809,
35 chennailat = 13.0781,
36 bangalorelong = 77.5868,
37 bangalorelat = 12.9718,
38 mumbailong = 72.8342,
39 mumbailat = 18.9394,
40 tirvandrumlong = 76.9544,
41 tirvandrumlat = 8.5009,
42 oneMB = 1048576,
43 paginationDefaultValue = 10,
44 splitLongitude = 1,
Barath Kumar Rf2ae5462021-03-01 12:52:33 +053045 splitLatitude = 2,
SANDHYA.JS4a7a5422021-05-15 15:35:22 +053046 timeOutDefaultSeconds = 5,
47 oneGB = 1024
kumaran.m3b4814a2020-05-01 19:48:54 +053048}
49/**
50 * handle count @enum
51 */
52export enum CONFIGCONSTANT {
53 operationalStateFirstStep = 'init',
54 operationalStateSecondStep = 'running',
55 operationalStateThirdStep = 'failed',
Barath Kumar R07698ab2021-03-30 11:50:42 +053056 operationalStateFourthStep = 'scaling',
kumaran.m3b4814a2020-05-01 19:48:54 +053057 configStateFirstStep = 'init',
58 configStateSecondStep = 'configured',
59 configStateThirdStep = 'failed',
60 historyStateFirstStep = 'PROCESSING',
61 historyStateSecondStep = 'COMPLETED',
62 historyStateThirdStep = 'FAILED',
63 wimOperationalStateFirstStep = 'PROCESSING',
64 wimOperationalStateStateSecondStep = 'ENABLED',
65 wimOperationalStateThirdStep = 'ERROR',
66 vimOperationalStateFirstStep = 'PROCESSING',
67 vimOperationalStateStateSecondStep = 'ENABLED',
68 vimOperationalStateThirdStep = 'ERROR',
69 sdnOperationalStateFirstStep = 'PROCESSING',
70 sdnOperationalStateStateSecondStep = 'ENABLED',
71 sdnOperationalStateThirdStep = 'ERROR',
72 k8OperationalStateFirstStep = 'PROCESSING',
73 k8OperationalStateStateSecondStep = 'ENABLED',
SANDHYA.JS99144582022-04-27 17:22:35 +053074 k8OperationalStateThirdStep = 'ERROR',
75 done = 'done',
76 close = 'close'
kumaran.m3b4814a2020-05-01 19:48:54 +053077}
78/** Interface for Post options */
79export interface POSTAPIRESOURCE {
80 apiURLHeader: APIURLHEADER;
81 payload?: object;
82}
83/** Interface for ApiURL Header */
84export interface APIURLHEADER {
85 url: string;
86 httpOptions?: APIHEADERS;
87}
88/** Interface for the Get Method with response type */
89export interface GETAPIURLHEADER {
90 headers: HttpHeaders;
91 responseType: string;
92}
93/** Interface for Httpoptions Header */
94interface APIHEADERS {
95 headers: HttpHeaders;
96}
97/** Interface for the Error */
98export interface ERRORDATA {
99 error: ERRORDETAILSDATA;
100}
101/** Interface for the Error Details */
102interface ERRORDETAILSDATA {
103 detail: string;
104 code?: string;
105 status?: number;
106 text?: Function;
107}
108/** Handle the URL params */
109export interface URLPARAMS {
110 page: string;
111 id: string;
112 titleName?: string;
113 forceDeleteType?: boolean;
114 name?: string;
115 memberIndex?: object;
116 nsConfig?: object;
117 projectID?: string;
118 username?: string;
Barath Kumar R07698ab2021-03-30 11:50:42 +0530119 vnfID?: [];
120 nsID?: string;
121 nsd?: NSD;
122 data?: VNFD[];
Barath Kumar Rf2ae5462021-03-01 12:52:33 +0530123 configs?: object;
124 actions?: object;
125 executedActions?: EXECUTEDACTIONS[];
kumaran.m3b4814a2020-05-01 19:48:54 +0530126}
127/** Handle the Delete params */
128export interface DELETEPARAMS {
129 identifier: string;
130 name?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530131 projectName?: string;
132 userName?: string;
133 username?: string;
134 page?: string;
135 id?: string;
Barath Kumar R063a3f12020-12-29 16:35:09 +0530136 productName?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530137}
138
139/** Interface for the Delete Details */
140export interface MODALCLOSERESPONSEDATA {
141 message: string;
142}
143
144/** Interface for the modal closer */
145export interface MODALCLOSERESPONSEWITHCP {
146 message: string;
147 connection_point?: string;
148}
149
150/** Interface for local storage settings */
151export interface LOCALSTORAGE {
152 id_token?: string;
153 project_id?: string;
154 expires?: string;
155 username?: string;
156 project?: string;
157 project_name?: string;
158 id?: string;
159 admin?: boolean;
160 isAdmin?: string;
161 token_state?: string;
162}
163/** Interface for Tar settings */
164export interface TARSETTINGS {
165 name?: string;
166 'type'?: string;
167 readAsString?: Function;
168 buffer: ArrayBuffer;
Barath Kumar Rd477b852020-07-07 15:24:05 +0530169 header_offset?: Number;
170 size?: number;
Barath Kumar Rdb1aeb02020-10-13 18:14:16 +0530171 linkname?: string;
172 uname?: string;
173 gname?: string;
174}
175/** Interface for File Settings */
176export interface FILESETTINGS {
177 'type'?: string;
178 linkname?: string;
179 owner?: string;
180 group?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530181}
182/** Interface for Package information */
183export interface PACKAGEINFO {
184 id?: string;
185 packageType?: string;
186 descriptor: string;
187}
188
189/** Interface For the Pagination pager in ng-smarttable */
190export interface PAGERSMARTTABLE {
191 display: boolean;
192 perPage: number;
193}
194/** Interface for breadcrumb item */
195export interface BREADCRUMBITEM {
196 title: string;
197 url: string;
198}
199/** Interface For the Pagination pager in ng-smarttable */
200export interface SMARTTABLECLASS {
201 // tslint:disable-next-line: no-reserved-keywords
202 class: string;
203}
204/** Constants of the VIM Types */
205export const VIM_TYPES: TYPESECTION[] = [
206 { value: 'openstack', title: 'Openstack' },
207 { value: 'aws', title: 'AWS' },
208 { value: 'vmware', title: 'VMware vCD' },
209 { value: 'openvim', title: 'OpenVIM' },
210 { value: 'opennebula', title: 'OpenNebula' },
SANDHYA.JS875b4a12022-04-26 13:05:18 +0530211 { value: 'azure', title: 'Azure' },
212 { value: 'dummy', title: 'Dummy' }
kumaran.m3b4814a2020-05-01 19:48:54 +0530213];
214/** Constants of the SDN Types */
215export const SDN_TYPES: TYPESECTION[] = [
216 { value: 'arista', title: 'Arista' },
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];
222/** Constants of the WIM Types */
223export const WIM_TYPES: TYPESECTION[] = [
224 { value: 'arista', title: 'Arista' },
225 { value: 'dynpac', title: 'DynPac' },
226 { value: 'floodlightof', title: 'Floodlight openflow' },
227 { value: 'odlof', title: 'OpenDaylight openflow' },
228 { value: 'onosof', title: 'ONOS openflow' },
229 { value: 'onos_vpls', title: 'ONOS vpls' },
230 { value: 'tapi', title: 'TAPI' }
231];
Barath Kumar R403234e2020-07-07 15:48:58 +0530232/** Constants of the OSM Repo Types */
233export const OSMREPO_TYPES: TYPESECTION[] = [
234 { value: 'osm', title: 'OSM' }
235];
kumaran.m3b4814a2020-05-01 19:48:54 +0530236/** Interface for List, Add WIM & SDN Types */
237export interface TYPESECTION {
238 value: string;
239 title: string;
240}
Barath Kumar R063a3f12020-12-29 16:35:09 +0530241/** Interface for PRIMITIVETYPES */
242export interface PRIMITIVETYPES {
243 title: string;
244 value: string;
245}
246/** Interface for the PRIMITIVEDATA */
247export interface PRIMITIVEDATA {
248 parameter: {}[];
249}
Barath Kumar R16070582021-02-08 18:19:35 +0530250/** Constant for VIM type Openstack's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530251export const TYPEOPENSTACK: {} = {
252 sdn_controller: '',
253 APIversion: '',
254 sdn_port_mapping: '',
255 project_domain_id: '',
256 vim_network_name: '',
257 project_domain_name: '',
258 config_vim_ype: '',
259 user_domain_id: '',
260 security_groups: '',
261 user_domain_name: '',
Barath Kumar R1245fc82021-04-16 13:34:06 +0530262 availability_zone: '',
Barath Kumar Rd477b852020-07-07 15:24:05 +0530263 keypair: '',
264 region_name: '',
265 dataplane_physical_net: '',
266 insecure: '',
267 use_floating_ip: '',
268 use_internal_endpoint: '',
269 microversion: '',
270 additional_conf: '',
271 use_existing_flavors: ''
272};
Barath Kumar R16070582021-02-08 18:19:35 +0530273/** Constant for VIM type AWS's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530274export const TYPEAWS: {} = {
275 sdn_controller: '',
276 vpc_cidr_block: '',
277 sdn_port_mapping: '',
278 security_groups: '',
279 vim_network_name: '',
280 keypair: '',
281 region_name: '',
282 flavor_info: '',
283 additional_conf: ''
284};
Barath Kumar R16070582021-02-08 18:19:35 +0530285/** Constant for VIM type VMWARE's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530286export const TYPEVMWARE: {} = {
287 sdn_controller: '',
288 orgname: '',
289 sdn_port_mapping: '',
290 vcenter_ip: '',
291 vim_network_name: '',
292 admin_username: '',
293 admin_password: '',
294 vcenter_port: '',
295 vcenter_user: '',
296 vcenter_password: '',
297 nsx_manager: '',
298 nsx_user: '',
299 nsx_password: '',
300 vrops_site: '',
301 vrops_user: '',
302 vrops_password: '',
303 additional_conf: ''
304};
Barath Kumar R16070582021-02-08 18:19:35 +0530305/** Constant for VIM type OPENVIMNEBULA's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530306export const TYPEOPENVIMNEBULA: {} = {
307 sdn_controller: '',
308 sdn_port_mapping: '',
309 vim_network_name: '',
310 additional_conf: ''
311};
Barath Kumar R16070582021-02-08 18:19:35 +0530312/** Constant for VIM type AZURE's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530313export const TYPEAZURE: {} = {
314 subscription_id: '',
315 region_name: '',
316 resource_group: '',
317 vnet_name: '',
318 flavors_pattern: ''
319};
Barath Kumar R16070582021-02-08 18:19:35 +0530320/** Constant for VIM other type Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530321export const TYPEOTERS: {} = {
322 sdn_controller: '',
323 sdn_port_mapping: '',
324 vim_network_name: '',
325 use_floating_ip: '',
326 use_internal_endpoint: '',
327 additional_conf: '',
328 use_existing_flavors: ''
329};
Barath Kumar R16070582021-02-08 18:19:35 +0530330/** Interface for Domains */
331export interface DOMAINS {
332 project_domain_name: string;
333 user_domain_name: string;
334}
335/** Interface for Login */
336export interface LOGINPARAMS {
337 username?: string;
338 password?: string;
SANDHYA.JSa9816552022-04-12 09:07:08 +0530339 old_password?: string;
Barath Kumar R16070582021-02-08 18:19:35 +0530340}
SANDHYA.JS4a7a5422021-05-15 15:35:22 +0530341/** Interface for the LABELVALUE */
342export interface LABELVALUE {
343 label: string;
344 value: string;
345}