Feature-5950: Management of quotas in VIM Account
[osm/NG-UI.git] / src / models / VimAccountModel.ts
1 /*
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  */
18 /**
19  * @file  Model for VimAccount Details related information.
20  */
21 // tslint:disable: completed-docs
22 import { NSInstanceDetails } from 'NSInstanceModel';
23 /** Interface for VimAccountDetails */
24 export interface VimAccountDetails {
25     description: string;
26     'vim_tenant_name': string;
27     schema_version: string;
28     schema_type: string;
29     config: CONFIG;
30     _id: string;
31     vim_password: string;
32     _admin: ADMIN;
33     vim_url: string;
34     vim_user: string;
35     vim_type: string;
36     name: string;
37     resources?: RESOURCES;
38 }
39
40 /** Interface for _ADMIN */
41 interface ADMIN {
42     projects_write: string[];
43     deployed?: Deployed;
44     operationalState: string;
45     modified: string;
46     projects_read: string[];
47     'detailed-status': string;
48     created: string;
49 }
50
51 /** Interface for Deployed */
52 interface Deployed {
53     'RO-account': string;
54     RO: string;
55 }
56
57 /** Interface for Config */
58 export interface CONFIG {
59     sdn_controller?: string;
60     use_floating_ip?: string;
61     location?: string;
62     sdn_port_mapping?: string;
63     vim_network_name?: string;
64     security_groups?: string;
65     availability_zone?: string;
66     region_name?: string;
67     insecure?: string;
68     use_existing_flavors?: string;
69     use_internal_endpoint?: string;
70     additional_conf?: string;
71     APIversion?: string;
72     project_domain_id?: string;
73     project_domain_name?: string;
74     user_domain_id?: string;
75     user_domain_name?: string;
76     keypair?: string;
77     dataplane_physical_net?: string;
78     microversion?: string;
79     vpc_cidr_block?: string;
80     flavor_info?: string;
81     orgname?: string;
82     vcenter_ip?: string;
83     vcenter_port?: string;
84     admin_username?: string;
85     vcenter_user?: string;
86     admin_password?: string;
87     vcenter_password?: string;
88     nsx_manager?: string;
89     vrops_site?: string;
90     nsx_user?: string;
91     vrops_user?: string;
92     nsx_password?: string;
93     vrops_password?: string;
94     subscription_id?: string;
95     resource_group?: string;
96     vnet_name?: string;
97     flavors_pattern?: string;
98 }
99
100 /** Interface for VIMData */
101 export interface VIMData {
102     name?: string;
103     identifier: string;
104     'type': string;
105     operationalState: string;
106     description: string;
107     page?: string;
108     instancesData?: NSInstanceDetails[];
109     resources?: RESOURCES;
110 }
111 /** Interface for VIMLOCATION */
112 export interface VIMLOCATION {
113     features: FEATURES[];
114     'type': string;
115 }
116 /** Interface for FEATURES */
117 export interface FEATURES {
118     geometry: GEOMETRY;
119     'type': string;
120     properties: PROPERTIES;
121 }
122 /** Interface for GEOMETRY */
123 interface GEOMETRY {
124     coordinates: [];
125 }
126 /** Interface for PROPERTIES */
127 interface PROPERTIES {
128     extent: [];
129     country: string;
130     name: string;
131     state: string;
132 }
133 /** Interface for the RESOURCES */
134 export interface RESOURCES {
135     compute: object;
136     storage: object;
137     network: object;
138 }
139 /** Interface for the RESOURCESDATA */
140 export interface RESOURCESDATA {
141     heading: string;
142     length: number;
143     data: RESOURCESCHARTDATA[];
144 }
145 /** Interface for the RESOURCESCHARTDATA */
146 export interface RESOURCESCHARTDATA {
147     title: string;
148     values: CHARTVALUES;
149     data: number[];
150     colorValues: Color[];
151 }
152 /** Interface common use for the Chart */
153 export interface CHARTVALUES {
154     total: number;
155     used?: number;
156     remaining?: number;
157 }
158 /** Interface for the CHARTRANGE */
159 export interface CHARTRANGE {
160     percentage: number;
161     nearlyFull: number;
162     full: number;
163 }
164 /** Interface for the COLOR */
165 export interface Color {
166     backgroundColor?: string[] | string;
167     borderColor?: string[] | string;
168 }
169 /** Constant Values for the resources titles */
170 export enum CONFIGRESOURCESTITLE {
171     ram = 'RAM',
172     instances = 'Instances',
173     vcpus = 'VCPUs',
174     snapshots = 'Volume Snapshots',
175     storage = 'Volume Storage',
176     volumes = 'Volumes',
177     floating_ips = 'Floating IPs',
178     security_group = 'Security Group',
179     subnets = 'Subnets',
180     networks = 'Networks',
181     ports = 'Ports',
182     routers = 'Routers'
183 }
184
185 /** constant values for color */
186 export enum RANGECOLOR {
187     used = '#29c3be',
188     nearlyfull = '#f0ad4e',
189     full = '#d9534f'
190 }