blob: 696317f962ff3fcf84a9706d1eca44636fa23216 [file] [log] [blame]
George Keishingfbeaecc2016-08-16 05:24:31 -05001import os
2
Sweta Potthuridaf91342017-09-07 12:05:56 -05003OPENBMC_BASE_URI = '/xyz/openbmc_project/'
4OPENBMC_BASE_DBUS = 'xyz.openbmc_project.'
George Keishingcf910442016-12-08 03:12:59 -06005
George Keishingcae6e902017-09-07 13:35:59 -05006# org open power base URI.
7OPENPOWER_BASE_URI = '/org/open_power/'
8OPENPOWER_CONTROL = OPENPOWER_BASE_URI + 'control/'
9
10# REST URI base endpoint paths.
George Keishingcf910442016-12-08 03:12:59 -060011CONTROL_URI = OPENBMC_BASE_URI + 'control/'
George Keishingcf910442016-12-08 03:12:59 -060012SETTINGS_URI = OPENBMC_BASE_URI + 'settings/'
13WATCHDOG_URI = OPENBMC_BASE_URI + 'watchdog/'
Sweta Potthuridaf91342017-09-07 12:05:56 -050014TIME_MANAGER_URI = OPENBMC_BASE_URI + 'time/'
15XYZ_NETWORK_MANAGER = OPENBMC_BASE_URI + 'network/'
George Keishingcf910442016-12-08 03:12:59 -060016
George Keishing06572472017-09-01 11:33:01 -050017# Sensors base variables.
Sweta Potthuridaf91342017-09-07 12:05:56 -050018SENSORS_URI = OPENBMC_BASE_URI + 'sensors/'
George Keishing06572472017-09-01 11:33:01 -050019
Sweta Potthuridaf91342017-09-07 12:05:56 -050020# State Manager base variables
Rahul Maheshwari2f8de6c2017-01-17 07:00:22 -060021BMC_REBOOT_TRANS = 'xyz.openbmc_project.State.BMC.Transition.Reboot'
22
George Keishingbec365b2017-01-19 01:28:41 -060023HOST_POWEROFF_TRANS = 'xyz.openbmc_project.State.Host.Transition.Off'
24HOST_POWERON_TRANS = 'xyz.openbmc_project.State.Host.Transition.On'
Rahul Maheshwarif7ead242017-02-14 01:59:42 -060025HOST_REBOOT_TRANS = 'xyz.openbmc_project.State.Host.Transition.Reboot'
George Keishingbec365b2017-01-19 01:28:41 -060026HOST_POWEROFF_STATE = 'xyz.openbmc_project.State.Host.HostState.Off'
27HOST_POWERON_STATE = 'xyz.openbmc_project.State.Host.HostState.Running'
28
29CHASSIS_POWEROFF_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.Off'
30CHASSIS_POWERON_TRANS = 'xyz.openbmc_project.State.Chassis.Transition.On'
31CHASSIS_POWEROFF_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.Off'
32CHASSIS_POWERON_STATE = 'xyz.openbmc_project.State.Chassis.PowerState.On'
33
34# State Manager URI variables.
Sweta Potthuridaf91342017-09-07 12:05:56 -050035SYSTEM_STATE_URI = OPENBMC_BASE_URI + 'state/'
36BMC_STATE_URI = OPENBMC_BASE_URI + 'state/bmc0/'
37HOST_STATE_URI = OPENBMC_BASE_URI + 'state/host0/'
38CHASSIS_STATE_URI = OPENBMC_BASE_URI + 'state/chassis0/'
39HOST_WATCHDOG_URI = OPENBMC_BASE_URI + 'watchdog/host0/'
George Keishingbec365b2017-01-19 01:28:41 -060040
George Keishing505d5b42017-02-21 11:01:54 -060041# Logging URI variables
Sweta Potthuridaf91342017-09-07 12:05:56 -050042BMC_LOGGING_URI = OPENBMC_BASE_URI + 'logging/'
George Keishinga71dd202017-02-24 00:49:40 -060043BMC_LOGGING_ENTRY = BMC_LOGGING_URI + 'entry/'
George Keishing505d5b42017-02-21 11:01:54 -060044
George Keishingab5157b2017-02-09 12:24:25 -060045# Software manager version
Sweta Potthuridaf91342017-09-07 12:05:56 -050046SOFTWARE_VERSION_URI = OPENBMC_BASE_URI + 'software/'
George Keishingab5157b2017-02-09 12:24:25 -060047ACTIVE = 'xyz.openbmc_project.Software.Activation.Activations.Active'
Saqib Khanbb8b63f2017-05-24 10:58:01 -050048READY = 'xyz.openbmc_project.Software.Activation.Activations.Ready'
49INVALID = 'xyz.openbmc_project.Software.Activation.Activations.Invalid'
50ACTIVATING = 'xyz.openbmc_project.Software.Activation.Activations.Activating'
51NOTREADY = 'xyz.openbmc_project.Software.Activation.Activations.NotReady'
52FAILED = 'xyz.openbmc_project.Software.Activation.Activations.Failed'
53
54SOFTWARE_ACTIVATION = 'xyz.openbmc_project.Software.Activation'
Saqib Khanbb8b63f2017-05-24 10:58:01 -050055REQUESTED_NONE = REQUESTED_ACTIVATION + '.None'
56
57SOFTWARE_PURPOSE = 'xyz.openbmc_project.Software.Version.VersionPurpose'
58VERSION_PURPOSE_HOST = SOFTWARE_PURPOSE + '.Host'
59VERSION_PURPOSE_BMC = SOFTWARE_PURPOSE + '.BMC'
60VERSION_PURPOSE_SYSTEM = SOFTWARE_PURPOSE + '.System'
George Keishingab5157b2017-02-09 12:24:25 -060061
Charles Paul Hofer9f74d3a2017-08-18 09:54:28 -050062# Image Upload Directory Path
63IMAGE_UPLOAD_DIR_PATH = '/tmp/images/'
64
George Keishingc8166ed2017-02-24 03:53:38 -060065# Inventory URI
Sweta Potthuridaf91342017-09-07 12:05:56 -050066HOST_INVENTORY_URI = OPENBMC_BASE_URI + 'inventory/'
George Keishingc8166ed2017-02-24 03:53:38 -060067
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060068# Led URI variable
Sweta Potthuridaf91342017-09-07 12:05:56 -050069LED_GROUPS_URI = OPENBMC_BASE_URI + 'led/groups/'
70LED_PHYSICAL_URI = OPENBMC_BASE_URI + 'led/physical/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060071
George Keishing1059b222017-07-21 13:24:43 -050072# Host control URI variables.
Sweta Potthuridaf91342017-09-07 12:05:56 -050073CONTROL_HOST_URI = OPENBMC_BASE_URI + 'control/host0/'
Rahul Maheshwari7258aec2017-02-02 04:46:38 -060074
George Keishing1c3a9662017-08-11 10:16:36 -050075# Power restore variables.
76POWER_RESTORE_URI = CONTROL_HOST_URI + 'power_restore_policy'
77CONTROL_DBUS_BASE = 'xyz.openbmc_project.Control.'
78
79RESTORE_LAST_STATE = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.Restore'
80ALWAYS_POWER_ON = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOn'
81ALWAYS_POWER_OFF = CONTROL_DBUS_BASE + 'Power.RestorePolicy.Policy.AlwaysOff'
82
Rahul Maheshwari23b18fb2017-08-01 00:30:26 -050083# Dump URI variable
Sweta Potthuridaf91342017-09-07 12:05:56 -050084DUMP_URI = OPENBMC_BASE_URI +'/dump/'
Rahul Maheshwari23b18fb2017-08-01 00:30:26 -050085DUMP_ENTRY_URI = DUMP_URI + 'entry/'
86
George Keishing2bd6fc02017-08-10 01:15:16 -050087# Boot progress variables.
88STATE_DBUS_BASE = 'xyz.openbmc_project.State.'
89OS_BOOT_START = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.OSStart'
90OS_BOOT_OFF = STATE_DBUS_BASE + 'Boot.Progress.ProgressStages.Unspecified'
91OS_BOOT_COMPLETE = STATE_DBUS_BASE + 'OperatingSystem.Status.OSStatus.BootComplete'
92
Rahul Maheshwari85c4d342017-08-09 21:59:30 -050093# Boot variables.
94BOOT_SOURCE_DEFAULT = 'xyz.openbmc_project.Control.Boot.Source.Sources.Default'
95BOOT_SOURCE_NETWORK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Network'
96BOOT_SOURCE_DISK = 'xyz.openbmc_project.Control.Boot.Source.Sources.Disk'
97BOOT_SOURCE_CDROM = 'xyz.openbmc_project.Control.Boot.Source.Sources.ExternalMedia'
98BOOT_MODE_SAFE = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Safe'
99BOOT_MODE_SETUP = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Setup'
100BOOT_MODE_REGULAR = 'xyz.openbmc_project.Control.Boot.Mode.Modes.Regular'
101
George Keishingfbeaecc2016-08-16 05:24:31 -0500102'''
103 QEMU HTTPS variable:
104
105 By default lib/resource.txt AUTH URI construct is as
106 ${AUTH_URI} https://${OPENBMC_HOST}${AUTH_SUFFIX}
107 ${AUTH_SUFFIX} is populated here by default EMPTY else
108 the port from the OS environment
109'''
George Keishingcf910442016-12-08 03:12:59 -0600110
111
George Keishingfbeaecc2016-08-16 05:24:31 -0500112def get_port_https():
113 # defaulted to empty string
114 l_suffix = ''
115 try:
116 l_https_port = os.getenv('HTTPS_PORT')
117 if l_https_port:
George Keishingcf910442016-12-08 03:12:59 -0600118 l_suffix = ':' + l_https_port
George Keishingfbeaecc2016-08-16 05:24:31 -0500119 except:
George Keishingcf910442016-12-08 03:12:59 -0600120 print "Environment variable HTTPS_PORT not set,\
121 using default HTTPS port"
George Keishingfbeaecc2016-08-16 05:24:31 -0500122 return l_suffix
123
George Keishingcf910442016-12-08 03:12:59 -0600124AUTH_SUFFIX = {
125 "https_port": [get_port_https()],
George Keishingfbeaecc2016-08-16 05:24:31 -0500126}
127
128# Update the ':Port number' to this variable
129AUTH_SUFFIX = AUTH_SUFFIX['https_port'][0]
Chris Austenb29d2e82016-06-07 12:25:35 -0500130
131# Here contains a list of valid Properties bases on fru_type after a boot.
George Keishingcf910442016-12-08 03:12:59 -0600132INVENTORY_ITEMS = {
Chris Austenb29d2e82016-06-07 12:25:35 -0500133 "CPU": [
134 "Custom Field 1",
135 "Custom Field 2",
136 "Custom Field 3",
137 "Custom Field 4",
138 "Custom Field 5",
139 "Custom Field 6",
140 "Custom Field 7",
141 "Custom Field 8",
142 "FRU File ID",
143 "Manufacturer",
144 "Name",
145 "Part Number",
146 "Serial Number",
147 "fault",
148 "fru_type",
149 "is_fru",
150 "present",
151 "version",
152 ],
153
154 "DIMM": [
155 "Asset Tag",
156 "Custom Field 1",
157 "Custom Field 2",
158 "Custom Field 3",
159 "Custom Field 4",
160 "Custom Field 5",
161 "Custom Field 6",
162 "Custom Field 7",
163 "Custom Field 8",
164 "FRU File ID",
165 "Manufacturer",
166 "Model Number",
167 "Name",
168 "Serial Number",
169 "Version",
170 "fault",
171 "fru_type",
172 "is_fru",
173 "present",
174 "version",
175 ],
176 "MEMORY_BUFFER": [
177 "Custom Field 1",
178 "Custom Field 2",
179 "Custom Field 3",
180 "Custom Field 4",
181 "Custom Field 5",
182 "Custom Field 6",
183 "Custom Field 7",
184 "Custom Field 8",
185 "FRU File ID",
186 "Manufacturer",
187 "Name",
188 "Part Number",
189 "Serial Number",
190 "fault",
191 "fru_type",
192 "is_fru",
193 "present",
194 "version",
195 ],
196 "FAN": [
197 "fault",
198 "fru_type",
199 "is_fru",
200 "present",
201 "version",
202 ],
203 "DAUGHTER_CARD": [
204 "Custom Field 1",
205 "Custom Field 2",
206 "Custom Field 3",
207 "Custom Field 4",
208 "Custom Field 5",
209 "Custom Field 6",
210 "Custom Field 7",
211 "Custom Field 8",
212 "FRU File ID",
213 "Manufacturer",
214 "Name",
215 "Part Number",
216 "Serial Number",
217 "fault",
218 "fru_type",
219 "is_fru",
220 "present",
221 "version",
222 ],
223 "BMC": [
224 "fault",
225 "fru_type",
226 "is_fru",
227 "manufacturer",
228 "present",
229 "version",
230 ],
231 "MAIN_PLANAR": [
232 "Custom Field 1",
233 "Custom Field 2",
234 "Custom Field 3",
235 "Custom Field 4",
236 "Custom Field 5",
237 "Custom Field 6",
238 "Custom Field 7",
239 "Custom Field 8",
240 "Part Number",
241 "Serial Number",
242 "Type",
243 "fault",
244 "fru_type",
245 "is_fru",
246 "present",
247 "version",
248 ],
249 "SYSTEM": [
250 "Custom Field 1",
251 "Custom Field 2",
252 "Custom Field 3",
253 "Custom Field 4",
254 "Custom Field 5",
255 "Custom Field 6",
256 "Custom Field 7",
257 "Custom Field 8",
258 "FRU File ID",
259 "Manufacturer",
260 "Model Number",
261 "Name",
262 "Serial Number",
263 "Version",
264 "fault",
265 "fru_type",
266 "is_fru",
267 "present",
268 "version",
269 ],
270 "CORE": [
271 "fault",
272 "fru_type",
273 "is_fru",
274 "present",
275 "version",
276 ],
277}