blob: 437899ad788f6fd5123deeb4ae1ddacd19c8bea5 [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',
74 k8OperationalStateThirdStep = 'ERROR'
75}
76/** Interface for Post options */
77export interface POSTAPIRESOURCE {
78 apiURLHeader: APIURLHEADER;
79 payload?: object;
80}
81/** Interface for ApiURL Header */
82export interface APIURLHEADER {
83 url: string;
84 httpOptions?: APIHEADERS;
85}
86/** Interface for the Get Method with response type */
87export interface GETAPIURLHEADER {
88 headers: HttpHeaders;
89 responseType: string;
90}
91/** Interface for Httpoptions Header */
92interface APIHEADERS {
93 headers: HttpHeaders;
94}
95/** Interface for the Error */
96export interface ERRORDATA {
97 error: ERRORDETAILSDATA;
98}
99/** Interface for the Error Details */
100interface ERRORDETAILSDATA {
101 detail: string;
102 code?: string;
103 status?: number;
104 text?: Function;
105}
106/** Handle the URL params */
107export interface URLPARAMS {
108 page: string;
109 id: string;
110 titleName?: string;
111 forceDeleteType?: boolean;
112 name?: string;
113 memberIndex?: object;
114 nsConfig?: object;
115 projectID?: string;
116 username?: string;
Barath Kumar R07698ab2021-03-30 11:50:42 +0530117 vnfID?: [];
118 nsID?: string;
119 nsd?: NSD;
120 data?: VNFD[];
Barath Kumar Rf2ae5462021-03-01 12:52:33 +0530121 configs?: object;
122 actions?: object;
123 executedActions?: EXECUTEDACTIONS[];
kumaran.m3b4814a2020-05-01 19:48:54 +0530124}
125/** Handle the Delete params */
126export interface DELETEPARAMS {
127 identifier: string;
128 name?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530129 projectName?: string;
130 userName?: string;
131 username?: string;
132 page?: string;
133 id?: string;
Barath Kumar R063a3f12020-12-29 16:35:09 +0530134 productName?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530135}
136
137/** Interface for the Delete Details */
138export interface MODALCLOSERESPONSEDATA {
139 message: string;
140}
141
142/** Interface for the modal closer */
143export interface MODALCLOSERESPONSEWITHCP {
144 message: string;
145 connection_point?: string;
146}
147
148/** Interface for local storage settings */
149export interface LOCALSTORAGE {
150 id_token?: string;
151 project_id?: string;
152 expires?: string;
153 username?: string;
154 project?: string;
155 project_name?: string;
156 id?: string;
157 admin?: boolean;
158 isAdmin?: string;
159 token_state?: string;
160}
161/** Interface for Tar settings */
162export interface TARSETTINGS {
163 name?: string;
164 'type'?: string;
165 readAsString?: Function;
166 buffer: ArrayBuffer;
Barath Kumar Rd477b852020-07-07 15:24:05 +0530167 header_offset?: Number;
168 size?: number;
Barath Kumar Rdb1aeb02020-10-13 18:14:16 +0530169 linkname?: string;
170 uname?: string;
171 gname?: string;
172}
173/** Interface for File Settings */
174export interface FILESETTINGS {
175 'type'?: string;
176 linkname?: string;
177 owner?: string;
178 group?: string;
kumaran.m3b4814a2020-05-01 19:48:54 +0530179}
180/** Interface for Package information */
181export interface PACKAGEINFO {
182 id?: string;
183 packageType?: string;
184 descriptor: string;
185}
186
187/** Interface For the Pagination pager in ng-smarttable */
188export interface PAGERSMARTTABLE {
189 display: boolean;
190 perPage: number;
191}
192/** Interface for breadcrumb item */
193export interface BREADCRUMBITEM {
194 title: string;
195 url: string;
196}
197/** Interface For the Pagination pager in ng-smarttable */
198export interface SMARTTABLECLASS {
199 // tslint:disable-next-line: no-reserved-keywords
200 class: string;
201}
202/** Constants of the VIM Types */
203export const VIM_TYPES: TYPESECTION[] = [
204 { value: 'openstack', title: 'Openstack' },
205 { value: 'aws', title: 'AWS' },
206 { value: 'vmware', title: 'VMware vCD' },
207 { value: 'openvim', title: 'OpenVIM' },
208 { value: 'opennebula', title: 'OpenNebula' },
SANDHYA.JS875b4a12022-04-26 13:05:18 +0530209 { value: 'azure', title: 'Azure' },
210 { value: 'dummy', title: 'Dummy' }
kumaran.m3b4814a2020-05-01 19:48:54 +0530211];
212/** Constants of the SDN Types */
213export const SDN_TYPES: TYPESECTION[] = [
214 { value: 'arista', title: 'Arista' },
215 { value: 'floodlightof', title: 'Floodlight openflow' },
216 { value: 'odlof', title: 'OpenDaylight openflow' },
217 { value: 'onosof', title: 'ONOS openflow' },
218 { value: 'onos_vpls', title: 'ONOS vpls' }
219];
220/** Constants of the WIM Types */
221export const WIM_TYPES: TYPESECTION[] = [
222 { value: 'arista', title: 'Arista' },
223 { value: 'dynpac', title: 'DynPac' },
224 { value: 'floodlightof', title: 'Floodlight openflow' },
225 { value: 'odlof', title: 'OpenDaylight openflow' },
226 { value: 'onosof', title: 'ONOS openflow' },
227 { value: 'onos_vpls', title: 'ONOS vpls' },
228 { value: 'tapi', title: 'TAPI' }
229];
Barath Kumar R403234e2020-07-07 15:48:58 +0530230/** Constants of the OSM Repo Types */
231export const OSMREPO_TYPES: TYPESECTION[] = [
232 { value: 'osm', title: 'OSM' }
233];
kumaran.m3b4814a2020-05-01 19:48:54 +0530234/** Interface for List, Add WIM & SDN Types */
235export interface TYPESECTION {
236 value: string;
237 title: string;
238}
Barath Kumar R063a3f12020-12-29 16:35:09 +0530239/** Interface for PRIMITIVETYPES */
240export interface PRIMITIVETYPES {
241 title: string;
242 value: string;
243}
244/** Interface for the PRIMITIVEDATA */
245export interface PRIMITIVEDATA {
246 parameter: {}[];
247}
Barath Kumar R16070582021-02-08 18:19:35 +0530248/** Constant for VIM type Openstack's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530249export const TYPEOPENSTACK: {} = {
250 sdn_controller: '',
251 APIversion: '',
252 sdn_port_mapping: '',
253 project_domain_id: '',
254 vim_network_name: '',
255 project_domain_name: '',
256 config_vim_ype: '',
257 user_domain_id: '',
258 security_groups: '',
259 user_domain_name: '',
Barath Kumar R1245fc82021-04-16 13:34:06 +0530260 availability_zone: '',
Barath Kumar Rd477b852020-07-07 15:24:05 +0530261 keypair: '',
262 region_name: '',
263 dataplane_physical_net: '',
264 insecure: '',
265 use_floating_ip: '',
266 use_internal_endpoint: '',
267 microversion: '',
268 additional_conf: '',
269 use_existing_flavors: ''
270};
Barath Kumar R16070582021-02-08 18:19:35 +0530271/** Constant for VIM type AWS's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530272export const TYPEAWS: {} = {
273 sdn_controller: '',
274 vpc_cidr_block: '',
275 sdn_port_mapping: '',
276 security_groups: '',
277 vim_network_name: '',
278 keypair: '',
279 region_name: '',
280 flavor_info: '',
281 additional_conf: ''
282};
Barath Kumar R16070582021-02-08 18:19:35 +0530283/** Constant for VIM type VMWARE's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530284export const TYPEVMWARE: {} = {
285 sdn_controller: '',
286 orgname: '',
287 sdn_port_mapping: '',
288 vcenter_ip: '',
289 vim_network_name: '',
290 admin_username: '',
291 admin_password: '',
292 vcenter_port: '',
293 vcenter_user: '',
294 vcenter_password: '',
295 nsx_manager: '',
296 nsx_user: '',
297 nsx_password: '',
298 vrops_site: '',
299 vrops_user: '',
300 vrops_password: '',
301 additional_conf: ''
302};
Barath Kumar R16070582021-02-08 18:19:35 +0530303/** Constant for VIM type OPENVIMNEBULA's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530304export const TYPEOPENVIMNEBULA: {} = {
305 sdn_controller: '',
306 sdn_port_mapping: '',
307 vim_network_name: '',
308 additional_conf: ''
309};
Barath Kumar R16070582021-02-08 18:19:35 +0530310/** Constant for VIM type AZURE's Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530311export const TYPEAZURE: {} = {
312 subscription_id: '',
313 region_name: '',
314 resource_group: '',
315 vnet_name: '',
316 flavors_pattern: ''
317};
Barath Kumar R16070582021-02-08 18:19:35 +0530318/** Constant for VIM other type Config */
Barath Kumar Rd477b852020-07-07 15:24:05 +0530319export const TYPEOTERS: {} = {
320 sdn_controller: '',
321 sdn_port_mapping: '',
322 vim_network_name: '',
323 use_floating_ip: '',
324 use_internal_endpoint: '',
325 additional_conf: '',
326 use_existing_flavors: ''
327};
Barath Kumar R16070582021-02-08 18:19:35 +0530328/** Interface for Domains */
329export interface DOMAINS {
330 project_domain_name: string;
331 user_domain_name: string;
332}
333/** Interface for Login */
334export interface LOGINPARAMS {
335 username?: string;
336 password?: string;
SANDHYA.JSa9816552022-04-12 09:07:08 +0530337 old_password?: string;
Barath Kumar R16070582021-02-08 18:19:35 +0530338}
SANDHYA.JS4a7a5422021-05-15 15:35:22 +0530339/** Interface for the LABELVALUE */
340export interface LABELVALUE {
341 label: string;
342 value: string;
343}