Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 1 | /** |
| 2 | * common Constant service |
| 3 | * |
| 4 | * @module app/common/services/constants |
| 5 | * @exports Constants |
| 6 | * @name Constants |
| 7 | |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 8 | */ |
| 9 | |
Andrew Geissler | ba5e3f3 | 2018-05-24 10:58:00 -0700 | [diff] [blame] | 10 | window.angular && (function(angular) { |
| 11 | 'use strict'; |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 12 | |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 13 | 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 | }, |
beccabroek | 309b5da | 2018-11-07 12:22:31 -0600 | [diff] [blame^] | 23 | 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 Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 34 | CHASSIS_POWER_STATE: { |
| 35 | on: 'On', |
| 36 | on_code: 'xyz.openbmc_project.State.Chassis.PowerState.On', |
| 37 | off: 'Off', |
| 38 | off_code: 'xyz.openbmc_project.State.Chassis.PowerState.Off' |
| 39 | }, |
| 40 | HOST_STATE_TEXT: { |
| 41 | on: 'Running', |
| 42 | on_code: 'xyz.openbmc_project.State.Host.HostState.Running', |
| 43 | off: 'Off', |
| 44 | off_code: 'xyz.openbmc_project.State.Host.HostState.Off', |
| 45 | error: 'Quiesced', |
| 46 | error_code: 'xyz.openbmc_project.State.Host.HostState.Quiesced', |
| 47 | unreachable: 'Unreachable' |
| 48 | }, |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 49 | LED_STATE: {on: true, off: false}, |
| 50 | LED_STATE_TEXT: {on: 'on', off: 'off'}, |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 51 | SEVERITY_TO_PRIORITY_MAP: { |
| 52 | Emergency: 'High', |
| 53 | Alert: 'High', |
| 54 | Critical: 'High', |
| 55 | Error: 'High', |
| 56 | Warning: 'Medium', |
| 57 | Notice: 'Low', |
| 58 | Debug: 'Low', |
| 59 | Informational: 'Low' |
| 60 | }, |
| 61 | PAGINATION: {LOG_ITEMS_PER_PAGE: 25}, |
| 62 | HARDWARE: { |
| 63 | component_key_filter: '/xyz/openbmc_project/inventory/system', |
| 64 | parent_components: [ |
| 65 | /xyz\/openbmc_project\/inventory\/system\/chassis\/motherboard\/cpu\d+\// |
Andrew Geissler | ba5e3f3 | 2018-05-24 10:58:00 -0700 | [diff] [blame] | 66 | ], |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 67 | uppercase_titles: ['cpu', 'dimm'] |
| 68 | }, |
| 69 | SENSOR_UNIT_MAP: { |
| 70 | 'xyz.openbmc_project.Sensor.Value.Unit.RPMS': 'rpms', |
| 71 | 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC': 'C', |
| 72 | 'xyz.openbmc_project.Sensor.Value.Unit.Volts': 'volts', |
| 73 | 'xyz.openbmc_project.Sensor.Value.Unit.Meters': 'meters', |
| 74 | 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'watts', |
| 75 | 'xyz.openbmc_project.Sensor.Value.Unit.Amperes': 'amperes', |
| 76 | 'xyz.openbmc_project.Sensor.Value.Unit.Joules': 'joules' |
| 77 | }, |
| 78 | SERVER_HEALTH: { |
| 79 | critical: 'Critical', |
| 80 | warning: 'Warning', |
| 81 | good: 'Good', |
| 82 | unknown: 'Unknown' |
| 83 | }, |
| 84 | SENSOR_SORT_ORDER: [ |
| 85 | 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC', |
| 86 | 'xyz.openbmc_project.Sensor.Value.Unit.RPMS', |
| 87 | 'xyz.openbmc_project.Sensor.Value.Unit.Meters', |
| 88 | 'xyz.openbmc_project.Sensor.Value.Unit.Volts', |
| 89 | 'xyz.openbmc_project.Sensor.Value.Unit.Amperes', |
| 90 | 'xyz.openbmc_project.Sensor.Value.Unit.Joules', |
| 91 | 'xyz.openbmc_project.Sensor.Value.Unit.Meters' |
| 92 | ], |
| 93 | SENSOR_SORT_ORDER_DEFAULT: 8, |
| 94 | FIRMWARE: { |
| 95 | ACTIVATE_FIRMWARE: |
| 96 | 'xyz.openbmc_project.Software.Activation.RequestedActivations.Active', |
| 97 | FUNCTIONAL_OBJPATH: '/xyz/openbmc_project/software/functional' |
| 98 | }, |
| 99 | POLL_INTERVALS: { |
| 100 | ACTIVATION: 5000, |
| 101 | DOWNLOAD_IMAGE: 5000, |
| 102 | POWER_OP: 5000, |
| 103 | }, |
| 104 | TIMEOUT: { |
Yoshie Muranaka | afcfda7 | 2019-06-21 09:19:32 -0500 | [diff] [blame] | 105 | ACTIVATION: 1000 * 60 * 10, // 10 mins |
| 106 | DOWNLOAD_IMAGE: 1000 * 60 * 2, // 2 mins |
| 107 | CHASSIS_OFF: 1000 * 60 * 5, // 5 mins |
| 108 | HOST_ON: 1000 * 60 * 5, // 5 mins |
| 109 | HOST_OFF: 1000 * 60 * 5, // 5 mins |
| 110 | HOST_OFF_IMMEDIATE: 1000 * 60 * 2 // 2 mins |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 111 | }, |
| 112 | MESSAGES: { |
| 113 | POLL: { |
| 114 | CHASSIS_OFF_TIMEOUT: |
| 115 | 'Time out. Chassis did not reach power off state in allotted time.', |
| 116 | HOST_ON_TIMEOUT: |
| 117 | 'Time out. System did not reach Running state in allotted time.', |
| 118 | HOST_OFF_TIMEOUT: |
| 119 | 'Time out. System did not reach Off state in allotted time.', |
| 120 | HOST_QUIESCED: 'System is in Error state.', |
| 121 | DOWNLOAD_IMAGE_TIMEOUT: |
| 122 | 'Time out. Did not download image in allotted time.', |
Andrew Geissler | ba5e3f3 | 2018-05-24 10:58:00 -0700 | [diff] [blame] | 123 | }, |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 124 | POWER_OP: { |
| 125 | POWER_ON_FAILED: 'Power On Failed', |
| 126 | WARM_REBOOT_FAILED: 'Warm Reboot Failed', |
| 127 | COLD_REBOOT_FAILED: 'Cold Reboot Failed', |
| 128 | ORDERLY_SHUTDOWN_FAILED: 'Orderly Shutdown Failed', |
| 129 | IMMEDIATE_SHUTDOWN_FAILED: 'Immediate Shutdown Failed', |
Andrew Geissler | ba5e3f3 | 2018-05-24 10:58:00 -0700 | [diff] [blame] | 130 | }, |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 131 | SENSOR: { |
| 132 | NO_SENSOR_DATA: 'There are no sensors found.', |
| 133 | CRITICAL_NO_SENSOR_DATA: 'There are no sensors in Critical state.', |
| 134 | WARNING_NO_SENSOR_DATA: 'There are no sensors in Warning state.', |
| 135 | NORMAL_NO_SENSOR_DATA: 'There are no sensors in Normal state.' |
Andrew Geissler | ba5e3f3 | 2018-05-24 10:58:00 -0700 | [diff] [blame] | 136 | }, |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 137 | ERROR_MESSAGE_DESC_TEMPLATE: '{{status}} - {{description}}', |
| 138 | }, |
| 139 | POWER_CAP_TEXT: {unit: 'W', disabled: 'Not Enabled'}, |
| 140 | POWER_CONSUMPTION_TEXT: { |
| 141 | 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'W', |
| 142 | notavailable: 'Not Available' |
| 143 | }, |
| 144 | }; |
| 145 | }); |
Ed Tanous | bbcf670 | 2017-10-06 13:53:06 -0700 | [diff] [blame] | 146 | })(window.angular); |