blob: 9ac9b6cc4988585a1fae354c609c10de8b1f9d5e [file] [log] [blame]
Iftekharul Islam99d199f2017-03-24 15:28:25 -05001/**
2 * common Constant service
3 *
4 * @module app/common/services/constants
5 * @exports Constants
6 * @name Constants
7
Iftekharul Islam99d199f2017-03-24 15:28:25 -05008 */
9
Andrew Geisslerba5e3f32018-05-24 10:58:00 -070010window.angular && (function(angular) {
11 'use strict';
Iftekharul Islam99d199f2017-03-24 15:28:25 -050012
Andrew Geisslerd27bb132018-05-24 11:07:27 -070013 angular.module('app.common.services', []).service('Constants', function() {
14 return {
15 API_CREDENTIALS:
16 {host_storage_key: 'API_HOST_KEY', default_protocol: 'https'},
17 API_RESPONSE: {
18 ERROR_STATUS: 'error',
19 ERROR_MESSAGE: '401 Unauthorized',
20 SUCCESS_STATUS: 'ok',
21 SUCCESS_MESSAGE: '200 OK'
22 },
beccabroek309b5da2018-11-07 12:22:31 -060023 CERTIFICATE_TYPES: [
24 {
25 'Description': 'HTTPS Certificate',
26 'location':
miramurali235e8785d2019-06-10 15:09:27 -050027 '/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/'
beccabroek309b5da2018-11-07 12:22:31 -060028 },
29 {
30 'Description': 'LDAP Certificate',
miramurali235e8785d2019-06-10 15:09:27 -050031 'location': '/redfish/v1/AccountService/LDAP/Certificates/'
beccabroek309b5da2018-11-07 12:22:31 -060032 }
33 ],
Andrew Geisslerd27bb132018-05-24 11:07:27 -070034 HOST_STATE_TEXT: {
35 on: 'Running',
36 on_code: 'xyz.openbmc_project.State.Host.HostState.Running',
37 off: 'Off',
38 off_code: 'xyz.openbmc_project.State.Host.HostState.Off',
39 error: 'Quiesced',
40 error_code: 'xyz.openbmc_project.State.Host.HostState.Quiesced',
41 unreachable: 'Unreachable'
42 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -070043 LED_STATE: {on: true, off: false},
44 LED_STATE_TEXT: {on: 'on', off: 'off'},
Andrew Geisslerd27bb132018-05-24 11:07:27 -070045 SEVERITY_TO_PRIORITY_MAP: {
46 Emergency: 'High',
47 Alert: 'High',
48 Critical: 'High',
49 Error: 'High',
50 Warning: 'Medium',
51 Notice: 'Low',
52 Debug: 'Low',
53 Informational: 'Low'
54 },
55 PAGINATION: {LOG_ITEMS_PER_PAGE: 25},
56 HARDWARE: {
57 component_key_filter: '/xyz/openbmc_project/inventory/system',
58 parent_components: [
59 /xyz\/openbmc_project\/inventory\/system\/chassis\/motherboard\/cpu\d+\//
Andrew Geisslerba5e3f32018-05-24 10:58:00 -070060 ],
Andrew Geisslerd27bb132018-05-24 11:07:27 -070061 uppercase_titles: ['cpu', 'dimm']
62 },
63 SENSOR_UNIT_MAP: {
64 'xyz.openbmc_project.Sensor.Value.Unit.RPMS': 'rpms',
65 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC': 'C',
66 'xyz.openbmc_project.Sensor.Value.Unit.Volts': 'volts',
67 'xyz.openbmc_project.Sensor.Value.Unit.Meters': 'meters',
68 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'watts',
69 'xyz.openbmc_project.Sensor.Value.Unit.Amperes': 'amperes',
70 'xyz.openbmc_project.Sensor.Value.Unit.Joules': 'joules'
71 },
72 SERVER_HEALTH: {
73 critical: 'Critical',
74 warning: 'Warning',
75 good: 'Good',
76 unknown: 'Unknown'
77 },
78 SENSOR_SORT_ORDER: [
79 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC',
80 'xyz.openbmc_project.Sensor.Value.Unit.RPMS',
81 'xyz.openbmc_project.Sensor.Value.Unit.Meters',
82 'xyz.openbmc_project.Sensor.Value.Unit.Volts',
83 'xyz.openbmc_project.Sensor.Value.Unit.Amperes',
84 'xyz.openbmc_project.Sensor.Value.Unit.Joules',
85 'xyz.openbmc_project.Sensor.Value.Unit.Meters'
86 ],
87 SENSOR_SORT_ORDER_DEFAULT: 8,
88 FIRMWARE: {
89 ACTIVATE_FIRMWARE:
90 'xyz.openbmc_project.Software.Activation.RequestedActivations.Active',
91 FUNCTIONAL_OBJPATH: '/xyz/openbmc_project/software/functional'
92 },
93 POLL_INTERVALS: {
94 ACTIVATION: 5000,
95 DOWNLOAD_IMAGE: 5000,
96 POWER_OP: 5000,
97 },
98 TIMEOUT: {
Yoshie Muranakaafcfda72019-06-21 09:19:32 -050099 ACTIVATION: 1000 * 60 * 10, // 10 mins
100 DOWNLOAD_IMAGE: 1000 * 60 * 2, // 2 mins
Yoshie Muranakaafcfda72019-06-21 09:19:32 -0500101 HOST_ON: 1000 * 60 * 5, // 5 mins
102 HOST_OFF: 1000 * 60 * 5, // 5 mins
103 HOST_OFF_IMMEDIATE: 1000 * 60 * 2 // 2 mins
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700104 },
miramurali235e8785d2019-06-10 15:09:27 -0500105 CERTIFICATE: {
106 KEY_BIT_LENGTH: [2048],
107 KEY_PAIR_ALGORITHM: ['EC', 'RSA'],
108 KEY_CURVE_ID: ['prime256v1', 'secp521r1', 'secp384r1']
109 },
110 COUNTRIES: [
111 {Name: 'Afghanistan', code: 'AF'},
112 {Name: 'Albania', code: 'AL'},
113 {Name: 'Algeria', code: 'DZ'},
114 {Name: 'American Samoa', code: 'AS'},
115 {Name: 'Andorra', code: 'AD'},
116 {Name: 'Angola', code: 'AO'},
117 {Name: 'Anguilla', code: 'AI'},
118 {Name: 'Antarctica', code: 'AQ'},
119 {Name: 'Antigua and Barbuda', code: 'AG'},
120 {Name: 'Argentina', code: 'AR'},
121 {Name: 'Armenia', code: 'AM'},
122 {Name: 'Aruba', code: 'AW'},
123 {Name: 'Australia', code: 'AU'},
124 {Name: 'Austria', code: 'AT'},
125 {Name: 'Azerbaijan', code: 'AZ'},
126 {Name: 'Bahamas, The', code: 'BS'},
127 {Name: 'Bahrain', code: 'BH'},
128 {Name: 'Bangladesh', code: 'BD'},
129 {Name: 'Barbados', code: 'BB'},
130 {Name: 'Belarus', code: 'BY'},
131 {Name: 'Belgium', code: 'BE'},
132 {Name: 'Belize', code: 'BZ'},
133 {Name: 'Benin', code: 'BJ'},
134 {Name: 'Bermuda', code: 'BM'},
135 {Name: 'Bhutan', code: 'BT'},
136 {Name: 'Bolivia', code: 'BO'},
137 {Name: 'Bonaire, Sint Eustatius and Saba', code: 'BQ'},
138 {Name: 'Bosnia and Herzegovina ', code: 'BA'},
139 {Name: 'Bostwana', code: 'BW'},
140 {Name: 'Bouvet Island', code: 'BV'},
141 {Name: 'Brazil', code: 'BR'},
142 {Name: 'British Indian Ocean Territory', code: 'IO'},
143 {Name: 'Brunei Darussalam ', code: 'BN'},
144 {Name: 'Bulgaria', code: 'BG'},
145 {Name: 'Burkina Faso', code: 'BF'},
146 {Name: 'Burundi', code: 'BI'},
147 {Name: 'Cabo Verde', code: 'CV'},
148 {Name: 'Cambodia', code: 'KH'},
149 {Name: 'Cameroon', code: 'CM'},
150 {Name: 'Canada', code: 'CA'},
151 {Name: 'Cayman Islands', code: 'KY'},
152 {Name: 'Central African Republic', code: 'CF'},
153 {Name: 'Chad', code: 'TD'},
154 {Name: 'Chile', code: 'CL'},
155 {Name: 'China', code: 'CN'},
156 {Name: 'Christmas Island ', code: 'CX'},
157 {Name: 'Cocos(Keeling) Islands', code: 'CC'},
158 {Name: 'Columbia', code: 'CO'},
159 {Name: 'Comoros', code: 'KM'},
160 {Name: 'Congo, The Democratic Republic of the', code: 'CD'},
161 {Name: 'Congo', code: 'CG'},
162 {Name: 'Cook Islands', code: 'CK'},
163 {Name: 'Costa Rica', code: 'CR'},
164 {Name: 'Croatia', code: 'HR'},
165 {Name: 'Cuba', code: 'CU'},
166 {Name: 'Curaçao', code: 'CW'},
167 {Name: 'Cyprus', code: 'CY'},
168 {Name: 'Czechia', code: 'CZ'},
169 {Name: 'Côte d\'Ivoire', code: 'CI'},
170 {Name: 'Denmark', code: 'DK'},
171 {Name: 'Djibouti', code: 'DJ'},
172 {Name: 'Dominica', code: 'DM'},
173 {Name: 'Dominican Republic', code: 'DO'},
174 {Name: 'Ecuador', code: 'EC'},
175 {Name: 'Egypt', code: 'EG'},
176 {Name: 'El Salvador', code: 'SV'},
177 {Name: 'Equatorial Guinea ', code: 'GQ'},
178 {Name: 'Eritrea', code: 'ER'},
179 {Name: 'Estonia', code: 'EE'},
180 {Name: 'Eswatini', code: 'SZ'},
181 {Name: 'Ethiopia', code: 'ET'},
182 {Name: 'Falkland Islands (Malvinas)', code: 'FK'},
183 {Name: 'Faroe Islands', code: 'FO'},
184 {Name: 'Fiji', code: 'FJ'},
185 {Name: 'Finland', code: 'FI'},
186 {Name: 'France', code: 'FR'},
187 {Name: 'French Guiana', code: 'GF'},
188 {Name: 'French Polynesia', code: 'PF'},
189 {Name: 'French Southern Territories', code: 'TF'},
190 {Name: 'Gabon', code: 'GA'},
191 {Name: 'Gambia, The', code: 'GM'},
192 {Name: 'Georgia', code: 'GE'},
193 {Name: 'Germany', code: 'DE'},
194 {Name: 'Ghana', code: 'GH'},
195 {Name: 'Gibraltar', code: 'GI'},
196 {Name: 'Greece', code: 'GR'},
197 {Name: 'Greenland', code: 'GL'},
198 {Name: 'Grenada', code: 'GD'},
199 {Name: 'Guadeloupe', code: 'GP'},
200 {Name: 'Guam', code: 'GU'},
201 {Name: 'Guatemala', code: 'GT'},
202 {Name: 'Guernsey', code: 'GG'},
203 {Name: 'Guinea', code: 'GN'},
204 {Name: 'Guinea-Bissau', code: 'GW'},
205 {Name: 'Guyana', code: 'GY'},
206 {Name: 'Haiti', code: 'HT'},
207 {Name: 'Heard Island and McDonald Islands', code: 'HM'},
208 {Name: 'Holy See', code: 'VA'},
209 {Name: 'Honduras', code: 'HN'},
210 {Name: 'Hong Kong', code: 'HK'},
211 {Name: 'Hungary', code: 'HU'},
212 {Name: 'Iceland', code: 'IS'},
213 {Name: 'India', code: 'IN'},
214 {Name: 'Indonesia', code: 'ID'},
215 {Name: 'Iran, Islamic Republic of', code: 'IR'},
216 {Name: 'Iraq', code: 'IQ'},
217 {Name: 'Ireland', code: 'IE'},
218 {Name: 'Isle of Man', code: 'IM'},
219 {Name: 'Israel', code: 'IL'},
220 {Name: 'Italy', code: 'IT'},
221 {Name: 'Jamaica', code: 'JM'},
222 {Name: 'Japan', code: 'JP'},
223 {Name: 'Jersey', code: 'JE'},
224 {Name: 'Jordan', code: 'JO'},
225 {Name: 'Kazakhstan', code: 'KZ'},
226 {Name: 'Kenya', code: 'KE'},
227 {Name: 'Kiribati', code: 'KI'},
228 {Name: 'Korea, Republic of', code: 'KR'},
229 {Name: 'Korea, Democratic People\'s Republic of', code: 'KP'},
230 {Name: 'Kuwait', code: 'KW'},
231 {Name: 'Kyrgyzstan', code: 'KG'},
232 {Name: 'Lao People\'s Democratic Republic', code: 'LA'},
233 {Name: 'Latvia', code: 'LV'},
234 {Name: 'Lebanon', code: 'LB'},
235 {Name: 'Lesotho', code: 'LS'},
236 {Name: 'Liberia', code: 'LR'},
237 {Name: 'Libya', code: 'LY'},
238 {Name: 'Liechtenstein', code: 'LI'},
239 {Name: 'Lithuania', code: 'LT'},
240 {Name: 'Luxembourg', code: 'LU'},
241 {Name: 'Macao', code: 'MO'},
242 {Name: 'Macedonia, The Former Yugoslav Republic of', code: 'MK'},
243 {Name: 'Madagascar', code: 'MG'},
244 {Name: 'Malawi', code: 'MW'},
245 {Name: 'Malaysia', code: 'MY'},
246 {Name: 'Maldives', code: 'MV'},
247 {Name: 'Mali', code: 'ML'},
248 {Name: 'Malta', code: 'MT'},
249 {Name: 'Marshall Islands', code: 'MH'},
250 {Name: 'Martinique', code: 'MQ'},
251 {Name: 'Mauritania', code: 'MR'},
252 {Name: 'Mauritius', code: 'MU'},
253 {Name: 'Mayotte', code: 'YT'},
254 {Name: 'Mexico', code: 'MX'},
255 {Name: 'Micronesia, Federated States of', code: 'FM'},
256 {Name: 'Moldova, Republic of', code: 'MD'},
257 {Name: 'Monaco', code: 'MC'},
258 {Name: 'Mongolia', code: 'MN'},
259 {Name: 'Montenegro', code: 'ME'},
260 {Name: 'Montserrat', code: 'MS'},
261 {Name: 'Morocco', code: 'MA'},
262 {Name: 'Mozambique', code: 'MZ'},
263 {Name: 'Myanmar', code: 'MM'},
264 {Name: 'Namibia', code: 'NA'},
265 {Name: 'Nauru', code: 'NR'},
266 {Name: 'Nepal', code: 'NP'},
267 {Name: 'Netherlands', code: 'NL'},
268 {Name: 'New Caledonia', code: 'NC'},
269 {Name: 'New Zealand', code: 'NZ'},
270 {Name: 'Nicaragua', code: 'NI'},
271 {Name: 'Niger', code: 'NE'},
272 {Name: 'Nigeria', code: 'NG'},
273 {Name: 'Niue', code: 'NU'},
274 {Name: 'Norfolk Island', code: 'NF'},
275 {Name: 'Northern Mariana Islands', code: 'MP'},
276 {Name: 'Norway', code: 'NO'},
277 {Name: 'Oman', code: 'OM'},
278 {Name: 'Pakistan', code: 'PK'},
279 {Name: 'Palau', code: 'PW'},
280 {Name: 'Palestine', code: 'PS'},
281 {Name: 'Panama', code: 'PA'},
282 {Name: 'Papua New Guinea', code: 'PG'},
283 {Name: 'Paraguay', code: 'PY'},
284 {Name: 'Peru', code: 'PE'},
285 {Name: 'Philippines', code: 'PH'},
286 {Name: 'Pitcairn', code: 'PN'},
287 {Name: 'Poland', code: 'PL'},
288 {Name: 'Portugal', code: 'PT'},
289 {Name: 'Puerto Rico', code: 'PR'},
290 {Name: 'Qatar', code: 'QA'},
291 {Name: 'Romania', code: 'RO'},
292 {Name: 'Russian Federation', code: 'RU'},
293 {Name: 'Rwanda', code: 'RW'},
294 {Name: 'Réunion', code: 'RE'},
295 {Name: 'Saint Barthélemy', code: 'BL'},
296 {Name: 'Saint Helena, Ascension and Tristan da Cunha', code: 'SH'},
297 {Name: 'Saint Kitts and Nevis ', code: 'KN'},
298 {Name: 'Saint Lucia', code: 'LC'},
299 {Name: 'Saint Martin', code: 'MF'},
300 {Name: 'Saint Pierre and Miquelon', code: 'PM'},
301 {Name: 'Saint Vincent and the Grenadines', code: 'VC'},
302 {Name: 'Samoa', code: 'WS'},
303 {Name: 'San Marino ', code: 'SM'},
304 {Name: 'Sao Tome and Principe', code: 'ST'},
305 {Name: 'Saudi Arabia', code: 'SA'},
306 {Name: 'Senegal', code: 'SN'},
307 {Name: 'Serbia', code: 'RS'},
308 {Name: 'Seychelles', code: 'SC'},
309 {Name: 'Sierra Leone', code: 'SL'},
310 {Name: 'Singapore', code: 'SG'},
311 {Name: 'Sint Maarten', code: 'SX'},
312 {Name: 'Slovakia', code: 'SK'},
313 {Name: 'Slovenia', code: 'SI'},
314 {Name: 'Solomon Islands', code: 'SB'},
315 {Name: 'Somalia', code: 'SO'},
316 {Name: 'South Africa ', code: 'ZA'},
317 {Name: 'South Georgia and the South Sandwich Islands', code: 'GS'},
318 {Name: 'South Sudan', code: 'SS'},
319 {Name: 'Spain', code: 'ES'},
320 {Name: 'Sri Lanka', code: 'LK'},
321 {Name: 'Sudan', code: 'SD'},
322 {Name: 'Suriname', code: 'SR'},
323 {Name: 'Svalbard and Jan Mayen', code: 'SJ'},
324 {Name: 'Sweden', code: 'SE'},
325 {Name: 'Switzerland', code: 'CH'},
326 {Name: 'Syrian Arab Republic', code: 'SY'},
327 {Name: 'Taiwan', code: 'TW'},
328 {Name: 'Tajikistan', code: 'TJ'},
329 {Name: 'Tanzania, United Republic of', code: 'TZ'},
330 {Name: 'Thailand', code: 'TH'},
331 {Name: 'Timor-Leste', code: 'TL'},
332 {Name: 'Togo', code: 'TG'},
333 {Name: 'Tokelau', code: 'TK'},
334 {Name: 'Tonga', code: 'TO'},
335 {Name: 'Trinidad and Tobago', code: 'TT'},
336 {Name: 'Tunisia', code: 'TN'},
337 {Name: 'Turkey', code: 'TR'},
338 {Name: 'Turkmenistan', code: 'TM'},
339 {Name: 'Turks and Caicos Islands', code: 'TC'},
340 {Name: 'Tuvalu', code: 'TV'},
341 {Name: 'Uganda', code: 'UG'},
342 {Name: 'Ukraine', code: 'UA'},
343 {Name: 'United Arab Emirates', code: 'AE'},
344 {Name: 'United Kingdom', code: 'GB'},
345 {Name: 'United States Minor Outlying Islands', code: 'UM'},
346 {Name: 'United States of America', code: 'US'},
347 {Name: 'Uruguay', code: 'UY'},
348 {Name: 'Uzbekistan', code: 'UZ'},
349 {Name: 'Vanuatu', code: 'VU'},
350 {Name: 'Venezuela', code: 'VE'},
351 {Name: 'Viet Nam', code: 'VN'},
352 {Name: 'Virgin Islands, British', code: 'VG'},
353 {Name: 'Virgin Islands, U.S', code: 'VI'},
354 {Name: 'Wallis and Futuna', code: 'WF'},
355 {Name: 'Western Sahara', code: 'EH'},
356 {Name: 'Yemen', code: 'YE'},
357 {Name: 'Zambia', code: 'ZM'},
358 {Name: 'Zimbabwe', code: 'ZW'},
359 {Name: 'Åland Islands', code: 'AX'}
360 ],
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700361 MESSAGES: {
362 POLL: {
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700363 HOST_ON_TIMEOUT:
364 'Time out. System did not reach Running state in allotted time.',
365 HOST_OFF_TIMEOUT:
366 'Time out. System did not reach Off state in allotted time.',
367 HOST_QUIESCED: 'System is in Error state.',
368 DOWNLOAD_IMAGE_TIMEOUT:
369 'Time out. Did not download image in allotted time.',
Andrew Geisslerba5e3f32018-05-24 10:58:00 -0700370 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700371 POWER_OP: {
Dixsie Wolmerse3681082019-06-21 13:48:06 -0500372 POWER_ON_FAILED: 'Power on failed.',
373 WARM_REBOOT_FAILED: 'Warm reboot failed.',
374 COLD_REBOOT_FAILED: 'Cold reboot failed.',
375 ORDERLY_SHUTDOWN_FAILED: 'Orderly shutdown failed.',
376 IMMEDIATE_SHUTDOWN_FAILED: 'Immediate shutdown failed.',
Andrew Geisslerba5e3f32018-05-24 10:58:00 -0700377 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700378 SENSOR: {
379 NO_SENSOR_DATA: 'There are no sensors found.',
380 CRITICAL_NO_SENSOR_DATA: 'There are no sensors in Critical state.',
381 WARNING_NO_SENSOR_DATA: 'There are no sensors in Warning state.',
382 NORMAL_NO_SENSOR_DATA: 'There are no sensors in Normal state.'
Andrew Geisslerba5e3f32018-05-24 10:58:00 -0700383 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700384 ERROR_MESSAGE_DESC_TEMPLATE: '{{status}} - {{description}}',
385 },
386 POWER_CAP_TEXT: {unit: 'W', disabled: 'Not Enabled'},
387 POWER_CONSUMPTION_TEXT: {
388 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'W',
389 notavailable: 'Not Available'
390 },
391 };
392 });
Ed Tanousbbcf6702017-10-06 13:53:06 -0700393})(window.angular);