blob: 37dd29fd141367a0ff4281dcbb81981021bcbf69 [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':
27 '/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates'
28 },
29 {
30 'Description': 'LDAP Certificate',
31 'location': '/redfish/v1/AccountService/LDAP/Certificates'
32 }
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 },
105 MESSAGES: {
106 POLL: {
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700107 HOST_ON_TIMEOUT:
108 'Time out. System did not reach Running state in allotted time.',
109 HOST_OFF_TIMEOUT:
110 'Time out. System did not reach Off state in allotted time.',
111 HOST_QUIESCED: 'System is in Error state.',
112 DOWNLOAD_IMAGE_TIMEOUT:
113 'Time out. Did not download image in allotted time.',
Andrew Geisslerba5e3f32018-05-24 10:58:00 -0700114 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700115 POWER_OP: {
Dixsie Wolmerse3681082019-06-21 13:48:06 -0500116 POWER_ON_FAILED: 'Power on failed.',
117 WARM_REBOOT_FAILED: 'Warm reboot failed.',
118 COLD_REBOOT_FAILED: 'Cold reboot failed.',
119 ORDERLY_SHUTDOWN_FAILED: 'Orderly shutdown failed.',
120 IMMEDIATE_SHUTDOWN_FAILED: 'Immediate shutdown failed.',
Andrew Geisslerba5e3f32018-05-24 10:58:00 -0700121 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700122 SENSOR: {
123 NO_SENSOR_DATA: 'There are no sensors found.',
124 CRITICAL_NO_SENSOR_DATA: 'There are no sensors in Critical state.',
125 WARNING_NO_SENSOR_DATA: 'There are no sensors in Warning state.',
126 NORMAL_NO_SENSOR_DATA: 'There are no sensors in Normal state.'
Andrew Geisslerba5e3f32018-05-24 10:58:00 -0700127 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700128 ERROR_MESSAGE_DESC_TEMPLATE: '{{status}} - {{description}}',
129 },
130 POWER_CAP_TEXT: {unit: 'W', disabled: 'Not Enabled'},
131 POWER_CONSUMPTION_TEXT: {
132 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'W',
133 notavailable: 'Not Available'
134 },
135 };
136 });
Ed Tanousbbcf6702017-10-06 13:53:06 -0700137})(window.angular);