blob: dd1012c55a0181e30426af23b41773cdd3121d3a [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 },
23 CHASSIS_POWER_STATE: {
24 on: 'On',
25 on_code: 'xyz.openbmc_project.State.Chassis.PowerState.On',
26 off: 'Off',
27 off_code: 'xyz.openbmc_project.State.Chassis.PowerState.Off'
28 },
29 HOST_STATE_TEXT: {
30 on: 'Running',
31 on_code: 'xyz.openbmc_project.State.Host.HostState.Running',
32 off: 'Off',
33 off_code: 'xyz.openbmc_project.State.Host.HostState.Off',
34 error: 'Quiesced',
35 error_code: 'xyz.openbmc_project.State.Host.HostState.Quiesced',
36 unreachable: 'Unreachable'
37 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -070038 LED_STATE: {on: true, off: false},
39 LED_STATE_TEXT: {on: 'on', off: 'off'},
Andrew Geisslerd27bb132018-05-24 11:07:27 -070040 SEVERITY_TO_PRIORITY_MAP: {
41 Emergency: 'High',
42 Alert: 'High',
43 Critical: 'High',
44 Error: 'High',
45 Warning: 'Medium',
46 Notice: 'Low',
47 Debug: 'Low',
48 Informational: 'Low'
49 },
50 PAGINATION: {LOG_ITEMS_PER_PAGE: 25},
51 HARDWARE: {
52 component_key_filter: '/xyz/openbmc_project/inventory/system',
53 parent_components: [
54 /xyz\/openbmc_project\/inventory\/system\/chassis\/motherboard\/cpu\d+\//
Andrew Geisslerba5e3f32018-05-24 10:58:00 -070055 ],
Andrew Geisslerd27bb132018-05-24 11:07:27 -070056 uppercase_titles: ['cpu', 'dimm']
57 },
58 SENSOR_UNIT_MAP: {
59 'xyz.openbmc_project.Sensor.Value.Unit.RPMS': 'rpms',
60 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC': 'C',
61 'xyz.openbmc_project.Sensor.Value.Unit.Volts': 'volts',
62 'xyz.openbmc_project.Sensor.Value.Unit.Meters': 'meters',
63 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'watts',
64 'xyz.openbmc_project.Sensor.Value.Unit.Amperes': 'amperes',
65 'xyz.openbmc_project.Sensor.Value.Unit.Joules': 'joules'
66 },
67 SERVER_HEALTH: {
68 critical: 'Critical',
69 warning: 'Warning',
70 good: 'Good',
71 unknown: 'Unknown'
72 },
73 SENSOR_SORT_ORDER: [
74 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC',
75 'xyz.openbmc_project.Sensor.Value.Unit.RPMS',
76 'xyz.openbmc_project.Sensor.Value.Unit.Meters',
77 'xyz.openbmc_project.Sensor.Value.Unit.Volts',
78 'xyz.openbmc_project.Sensor.Value.Unit.Amperes',
79 'xyz.openbmc_project.Sensor.Value.Unit.Joules',
80 'xyz.openbmc_project.Sensor.Value.Unit.Meters'
81 ],
82 SENSOR_SORT_ORDER_DEFAULT: 8,
83 FIRMWARE: {
84 ACTIVATE_FIRMWARE:
85 'xyz.openbmc_project.Software.Activation.RequestedActivations.Active',
86 FUNCTIONAL_OBJPATH: '/xyz/openbmc_project/software/functional'
87 },
88 POLL_INTERVALS: {
89 ACTIVATION: 5000,
90 DOWNLOAD_IMAGE: 5000,
91 POWER_OP: 5000,
92 },
93 TIMEOUT: {
Yoshie Muranakaafcfda72019-06-21 09:19:32 -050094 ACTIVATION: 1000 * 60 * 10, // 10 mins
95 DOWNLOAD_IMAGE: 1000 * 60 * 2, // 2 mins
96 CHASSIS_OFF: 1000 * 60 * 5, // 5 mins
97 HOST_ON: 1000 * 60 * 5, // 5 mins
98 HOST_OFF: 1000 * 60 * 5, // 5 mins
99 HOST_OFF_IMMEDIATE: 1000 * 60 * 2 // 2 mins
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700100 },
101 MESSAGES: {
102 POLL: {
103 CHASSIS_OFF_TIMEOUT:
104 'Time out. Chassis did not reach power off state in allotted time.',
105 HOST_ON_TIMEOUT:
106 'Time out. System did not reach Running state in allotted time.',
107 HOST_OFF_TIMEOUT:
108 'Time out. System did not reach Off state in allotted time.',
109 HOST_QUIESCED: 'System is in Error state.',
110 DOWNLOAD_IMAGE_TIMEOUT:
111 'Time out. Did not download image in allotted time.',
Andrew Geisslerba5e3f32018-05-24 10:58:00 -0700112 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700113 POWER_OP: {
114 POWER_ON_FAILED: 'Power On Failed',
115 WARM_REBOOT_FAILED: 'Warm Reboot Failed',
116 COLD_REBOOT_FAILED: 'Cold Reboot Failed',
117 ORDERLY_SHUTDOWN_FAILED: 'Orderly Shutdown Failed',
118 IMMEDIATE_SHUTDOWN_FAILED: 'Immediate Shutdown Failed',
Andrew Geisslerba5e3f32018-05-24 10:58:00 -0700119 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700120 SENSOR: {
121 NO_SENSOR_DATA: 'There are no sensors found.',
122 CRITICAL_NO_SENSOR_DATA: 'There are no sensors in Critical state.',
123 WARNING_NO_SENSOR_DATA: 'There are no sensors in Warning state.',
124 NORMAL_NO_SENSOR_DATA: 'There are no sensors in Normal state.'
Andrew Geisslerba5e3f32018-05-24 10:58:00 -0700125 },
Andrew Geisslerd27bb132018-05-24 11:07:27 -0700126 ERROR_MESSAGE_DESC_TEMPLATE: '{{status}} - {{description}}',
127 },
128 POWER_CAP_TEXT: {unit: 'W', disabled: 'Not Enabled'},
129 POWER_CONSUMPTION_TEXT: {
130 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'W',
131 notavailable: 'Not Available'
132 },
133 };
134 });
Ed Tanousbbcf6702017-10-06 13:53:06 -0700135})(window.angular);