summaryrefslogtreecommitdiffstats
path: root/redfish-core/lib/sensors.hpp
Commit message (Collapse)AuthorAgeFilesLines
* Add Power Supply AttributesGunnar Mills2020-02-071-7/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Map DeratingFactor from PowerSupplyAttributes.interface.yaml to the Redfish property PowerSupply "EfficiencyPercent". Only do this call when the "Power" schema is called. Use the InventoryItem class introduced in adc4f0db57568c5e5d2a3398fce00dbb050a3b72 Tested: Power, Thermal, all look good. Passed the Redfish Validator. "PowerSupplies": [ { "@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerSupplies/0", "EfficiencyPercent": 90, "IndicatorLED": "Off", "Manufacturer": "", "MemberId": "powersupply0", "Model": "2B1D", "Name": "powersupply0", "PartNumber": "01KL471", "PowerInputWatts": 12.0, "SerialNumber": "71G370", "Status": { "Health": "OK", "State": "Enabled" } }, Change-Id: I344577a7a3d72cd37d5f6bab03edbdce13b9f764 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Redfish: Set the power capCarol Wang2019-11-191-67/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the PowerCap with redfish patch. Tested: Case 1: PowerCapEnable is false $ curl -k -H "X-Auth-Token: $token" -X PUT -d '{"data":false}' https://$bmc/xyz/openbmc_project/control/host0/power_cap/attr/PowerCapEnable $ curl -k -H "X-Auth-Token: $token"https://${bmc}/redfish/v1/Chassis/chassis/Power { "@odata.context": "/redfish/v1/$metadata#Power.Power", "@odata.id": "/redfish/v1/Chassis/chassis/Power", "@odata.type": "#Power.v1_5_2.Power", "Id": "Power", "Name": "Power", "PowerControl": [ { "@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerControl/0", "@odata.type": "#Power.v1_0_0.PowerControl", "MemberId": "0", "Name": "Chassis Power Control", "PowerLimit": { "LimitInWatts": null } } ], ... } $curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/Power -X PATCH -d '{"PowerControl":[{"PowerLimit":{"LimitInWatts":2004}}]}' { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "PowerCapEnable is false, can't set the PowerCap.", "MessageArgs": [], "MessageId": "Base.1.4.0.UnableToSetPowerCap", "Resolution": "Set PowerCapEnable to be true before setting PowerCap.", "Severity": "Warning" } ], "code": "Base.1.4.0.UnableToSetPowerCap", "message": "PowerCapEnable is false, can't set the PowerCap." } } Case 2: PowerCapEnable is true, PowerControl json only $ curl -k -H "X-Auth-Token: $token" -X PUT -d '{"data":true}' https://$bmc/xyz/openbmc_project/control/host0/power_cap/attr/PowerCapEnable $ curl -k -H "X-Auth-Token: $token"https://${bmc}/redfish/v1/Chassis/chassis/Power { "@odata.context": "/redfish/v1/$metadata#Power.Power", "@odata.id": "/redfish/v1/Chassis/chassis/Power", "@odata.type": "#Power.v1_5_2.Power", "Id": "Power", "Name": "Power", "PowerControl": [ { "@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerControl/0", "@odata.type": "#Power.v1_0_0.PowerControl", "MemberId": "0", "Name": "Chassis Power Control", "PowerLimit": { "LimitInWatts": 2001.0 } } ], ... } $ curl -k -H "X-Auth-Token: $token"https://${bmc}/redfish/v1/Chassis/chassis/Power -X PATCH -d '{"PowerControl":[{"PowerLimit":{"LimitInWatts":2004}}]}' -v ... < HTTP/1.1 204 No Content ... $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/Power { "@odata.context": "/redfish/v1/$metadata#Power.Power", "@odata.id": "/redfish/v1/Chassis/chassis/Power", "@odata.type": "#Power.v1_5_2.Power", "Id": "Power", "Name": "Power", "PowerControl": [ { "@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerControl/0", "@odata.type": "#Power.v1_0_0.PowerControl", "MemberId": "0", "Name": "Chassis Power Control", "PowerLimit": { "LimitInWatts": 2004.0 } } ], ... } Case 3: PowerCapEnable is true, PowerControl and Voltages json $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/Power -X PATCH -d '{"PowerControl":[{"PowerLimit"{"LimitInWatts":2001}}], "Voltages": [{"MemberId" : "p0_vcs_voltage", "ReadingVolts":8}]}' -v ... < HTTP/1.1 204 No Content ... Case 4: Wrong chassis path $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassi/Power -X PATCH -d '{"PowerControl":[{"PowerLimit":{"LimitInWatts":2001}}]}' { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The requested resource of type Chassis named chassi was not found.", "MessageArgs": [ "Chassis", "chassi" ], "MessageId": "Base.1.4.0.ResourceNotFound", "Resolution": "Provide a valid resource identifier and resubmit the request.", "Severity": "Critical" } ], "code": "Base.1.4.0.ResourceNotFound", "message": "The requested resource of type Chassis named chassi was not found." } } Signed-off-by: Carol Wang <wangkair@cn.ibm.com> Change-Id: Ifabdf053005b31cf3e3539009a1ec20ce4d46d5b
* bmcweb: Add IndicatorLED property to sensorsAnthony Wilson2019-11-181-6/+321
| | | | | | | | | | | Added support for the IndicatorLED property for physical leds associated with Thermal and Power sensors. Testing: Verified output on a witherspoon. No new errors in redfish validation. Change-Id: I4e49b3c1769742e49f57c6c1b77a82511cdc8b99 Signed-off-by: Anthony Wilson <wilsonan@us.ibm.com>
* Move to more modern headersEd Tanous2019-10-281-2/+1
| | | | | | | | | We had a couple places where the c style headers got checked in for Tested: Code builds. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iebfbd846033618ff972825a0a9f89e8d05395ce8
* Minor fix: Typo correctionAppaRao Puli2019-10-221-1/+1
| | | | | | | | | | Typo correction: 'refish' to "redfish" Tested: Checked chassis URI and observed correct spelling. Change-Id: Ic09ab11acd47fdf45fadc485df9c1fd03c0ee4fb Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
* Fix a bunch of warningsEd Tanous2019-10-101-24/+24
| | | | | | | | | | | | | | | using the list of warnings from here: https://github.com/lefticus/cppbestpractices/blob/e73393f25a85f83fed7399d8b65cb117d00b2231/02-Use_the_Tools_Available.md#L100 Seems like a good place to start, and would improve things a bit type-wise. This patchset attempts to correct all the issues in one shot. Tested: It builds. Will test various subsystems that have been touched Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I588c26440e5a97f718a0f0ea74cc84107d53aa1e
* bmcweb: Add Threshold properties to SensorsAnthony Wilson2019-09-261-25/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the Sensor Threshold properties: UpperCritical LowerCritical UpperCaution LowerCaution Sample Output: curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/p1_vdd_current { "@odata.context": "/redfish/v1/$metadata#Sensor.Sensor", "@odata.id": "/redfish/v1/Chassis/chassis/Sensors/p1_vdd_current", "@odata.type": "#Sensor.v1_0_0.Sensor", "Id": "p1_vdd_current", "Name": "p1 vdd current", "Reading": 0.0, "ReadingRangeMax": 0.0, "ReadingRangeMin": 0.0, "ReadingUnits": "Amperes", "Status": { "Health": "Critical", "State": "Enabled" }, "Thresholds": { "LowerCaution": { "Reading": 0.0 }, "LowerCritical": { "Reading": 0.0 }, "UpperCaution": { "Reading": 320.0 }, "UpperCritical": { "Reading": 360.0 } } } Change-Id: Ia76ff1308653ece90830a06333611960da43cb57 Signed-off-by: Anthony Wilson <wilsonan@us.ibm.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* bmcweb: Implement SensorCollectionAnthony Wilson2019-09-241-108/+355
| | | | | | | | | | | Add collection of all power and current sensors. Testing: Verified SensorCollection and Sensor output on a Witherspoon system. Verified no errors from RedfishServiceValidator. Change-Id: Icfdc14d738bf037d5d599a3c6fc0be5ea0919929 Signed-off-by: Anthony Wilson <wilsonan@us.ibm.com>
* Redfish: Move power supplies to Power schemaShawn McCarney2019-08-151-236/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made the following enhancements related to power supplies in Redfish: * Moved power supplies from Chassis schema to Power schema * Added support for multiple power supplies within one chassis * Added support for multiple sensors associated with one power supply * Set power supply Name and MemberId to inventory item name (like powersupply0) rather than sensor name (like ps0_input_power). * Set power supply VPD fields like Manufacturer and SerialNumber Also improved support for power sensors that are not related to power supplies, such as VRM sensors. These sensors are no longer treated as power supplies, and they will not be included in the Power schema output. They should instead be included in the SensorCollection output when that support is completed. Uses an ObjectMapper association named "inventory" to find the power supply inventory item associated with a power sensor. For example: /xyz/openbmc_project/sensors/power/ps0_input_power/inventory -> /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 See https://github.com/openbmc/docs/blob/master/sensor-architecture.md for more information on associations between sensors and low-level hardware items. Test Plan: https://gist.github.com/smccarney/43b2fae304575302af61332a71280d74 Tested: Verified Power and Thermal output on a Witherspoon system. Tested with power sensors that were/were not associated with power supplies. Verified power supply properties in Power output. Verified that power supplies are no longer returned in Chassis collection output. Ran Redfish Service Validator. Change-Id: I50db389b5df011bfb561d31aafb33cc4bf7fcde6 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
* Move PowerLimit to correct locationGunnar Mills2019-07-081-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See the following Redfish Validator errors and warning: /redfish/v1/Chassis/chassis/Power ERROR - PowerLimit not defined in schema Power.v1_5_2 (check version, spelling and casing) /redfish/v1/Chassis/chassis/Power#/PowerControl/ ERROR - Decoded object no longer a dictionary /redfish/v1/Chassis/chassis/Power ERROR - @odata.id of ReferenceableMember does not properly resolve: /redfish/v1/Chassis/chassis/Power#/PowerControl/ WARNING - No @odata.type present, assuming highest type Power.v1_0_0.PowerControl Power.v1_4_0.PowerControl If you look at the specification/mockups, PowerLimit is under PowerControl. From the https://redfish.dmtf.org/redfish/mockups/v1/893 mockup: PowerControl": [ { "@odata.id": "/redfish/v1/Chassis/1U/Power#/PowerControl/0", "MemberId": "0", ... "PowerAvailableWatts": 0, "PowerCapacityWatts": 800, ... "PowerLimit": { "LimitInWatts": 500, "LimitException": "LogEventOnly", "CorrectionInMs": 50 } , ... } ], Added an odata.type and fixed the odata.id for PowerControl. Put all power control sensors under the same PowerControl like we do for PowerSupplies. Tested: No longer see the errors. If no total_power (happens when a Open Power system is off): curl -k https://${bmc}/redfish/v1/Chassis/chassis/Power ... "PowerControl": [ { "@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerControl/0", "@odata.type": "#Power.v1_0_0.PowerControl", "MemberId": "0", "Name": "Chassis Power Control", "PowerLimit": { "LimitInWatts": null } } ], "Redundancy": [], ... curl -k https://${bmc}/redfish/v1/Chassis/chassis/Power/ { "PowerControl": [ { "@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerControl/0", "@odata.type": "#Power.v1_0_0.PowerControl", "MemberId": "0", "Name": "Chassis Power Control", "PowerConsumedWatts": 232.0, "PowerLimit": { "LimitInWatts": null }, "Status": { "Health": "OK", "State": "Enabled" Change-Id: I8ca47bd6c7dedf5d0685886e2e45e6f964f69060 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Fix initialier_list issuesEd Tanous2019-06-271-2/+2
| | | | | | | | | | | This is a warning that the clang analyser seems to pop up with. For whatever reason, GCC is just fine with it. Tested: Not yet tested. Change-Id: I5d665e23011806f51d1ef4c5b1e8b887bdb456eb Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Fix redudancy for association changeJames Feist2019-06-261-1/+1
| | | | | | | | | | | s/inventory/chassis according to https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/22976 Tested: Redundancy still worked with according change in sensor repo Change-Id: Id0e517e09908a44fa983a6934b8c4c39d5db4dd6 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Redfish: Check inventory item for sensor statusShawn McCarney2019-06-261-34/+501
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support to find the inventory item (if any) associated with a sensor. Checks whether the inventory item is not present or not functional. If so, updates the sensor status. Uses the standard D-Bus Inventory.Item and OperationalStatus interfaces to obtain the Present and Functional properties for the inventory item. These checks are in addition to the sensor threshold checks. The two approaches are complementary. Some functional problems and missing hardware are not detectable via thresholds depending on how the system is implemented. Uses an ObjectMapper association named "inventory" to find the inventory item associated with a sensor. For example: /xyz/openbmc_project/sensors/power/ps0_input_power/inventory -> /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0 This support could be used in the future to obtain VPD data such as Model and PartNumber for PowerSupply sensors. VPD data is associated with the inventory item on D-Bus. Also changed the association name used to find all sensors in a chassis from "sensors" to "all_sensors". Test Plan: https://gist.github.com/smccarney/accc500b58fed80b711c65520cc7aafc Tested: Verified Power and Thermal output on a Witherspoon system. Tested where inventory item associated with sensor was present/not present and function/not functional. Ran Redfish Service Validator. Change-Id: Ibcdc515eb6b52ef43f05f98f36b8f0849fe1f25b Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
* Add sensor health supportJames Feist2019-06-191-1/+81
| | | | | | | | | | | Read through the thresolds and determine if any are crossed. If so, change the status of the sensor. Tested: Used sensor override to modify a sensor value, asserting the threshold. Change-Id: Id56e036449ca019a5e9563df68af0f590c693045 Signed-off-by: James Feist <james.feist@linux.intel.com>
* bmcweb: Fix sensor name identification methodRichard Marian Thomaiyar2019-06-061-7/+5
| | | | | | | | | | | | | Sensor name was calculated based on 5th elemennt is not applicable any more. Get the last token in the path, which is the sensor name, which is used as member_id. Tested: 1. Verified the PATCH method for thermal & power overriding, temperatures, fans & voltages. Overriding works as expected. Change-Id: I08291171496a979f120a57ac0802733007e11871 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Add basic PowerControl and PowerLimit propertiesEddie James2019-06-051-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code in the power-specific response handler to fetch the Power Limit value for the chassis that implements the Chassis inventory item. Add a special case to the generic sensor handling code to place the total_power value into the PowerControl PowerConsumedWatts field. curl -k https://${bmc}/redfish/v1/Chassis/chassis/Power { "@odata.context": "/redfish/v1/$metadata#Power.Power", "@odata.id": "/redfish/v1/Chassis/chassis/Power", "@odata.type": "#Power.v1_5_2.Power", "Id": "Power", "Name": "Power", "PowerControl": [ { "@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerControl/", "MemberId": "total_power", "Name": "total power", "PowerConsumedWatts": 269.0, "Status": { "Health": "OK", "State": "Enabled" } } ], "PowerLimit": [ { "LimitInWatts": null } ], Signed-off-by: Eddie James <eajames@linux.ibm.com> Change-Id: I447de59fb44a4ecbe7b47610d915ac22aef90250
* [Redfish] Add OCP required properties for ChassisJennifer Lee2019-05-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Thermal - Redundancy - Fans Tested: GET /redfish/v1/Chassis/<chassis id>/Thermal HTTP/1.1 Response: { "@odata.context": "/redfish/v1/$metadata#Thermal.Thermal", "@odata.id": "/redfish/v1/Chassis/<chassis id>/Thermal", "@odata.type": "#Thermal.v1_4_0.Thermal", "Fans": [], "Id": "Thermal", "Name": "Thermal", "Redundancy": [], "Temperatures": [ { "@odata.id": "/redfish/v1/Chassis/<chassis id>/Thermal#/Temperatures/0", "@odata.type": "#Thermal.v1_3_0.Temperature", "LowerThresholdCritical": 0, "LowerThresholdNonCritical": 5, "MaxReadingRangeTemp": 127, "MemberId": "BMC_Temp", "MinReadingRangeTemp": -128, "Name": "BMC_Temp", "ReadingCelsius": 34.6870002746582, "Status": { "Health": "OK", "State": "Enabled" }, "UpperThresholdCritical": 115, "UpperThresholdNonCritical": 110 }, ... } Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Change-Id: I8fe41e698ef55b02779b04468dee51ebe5561762
* Redfish: Make sensor names more friendlyEd Tanous2019-05-091-1/+2
| | | | | | | | | | | | | | | The primary goal of this patchset is to make sensor names more approachable, in the same way that IPMI does. This replaces the underscores from the sensor path name with spaces. Tested: GET /redfish/v1/Chassis/Solum_1300W_PSU_1/Power Observed sensor "Name" property changed from PSU1_Input_Power to PSU1 Input Power Service validator shows no issues on Thermal or Power Nodes. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I0862f180700502d401cf5a0746a639db5133e631
* Redfish: Remove BMCWEB_ENABLE_REDFISH_ONE_CHASSISShawn McCarney2019-05-091-67/+1
| | | | | | | | | | | | | | | Removed the BMCWEB_ENABLE_REDFISH_ONE_CHASSIS #define. The new support for finding chassis sensors via associations is now used on all systems. Test Plan: https://gist.github.com/smccarney/f5b4783d8cf41a486ceff9b941b1ba9a Tested: Verified the Chassis, Power, and Thermal output was valid on a Witherspoon system. Verified sensor associations on Witherspoon work with bmcweb implementation. Ran Redfish Service Validator. Change-Id: I975f79da2c9de63e4ddd155d39ea872ca9fbffa9 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
* Acquire chassis sensors using the sensor association DBus itemJohnathan Mantey2019-05-091-150/+293
| | | | | | | | | | | | | | | | | | | | | | Each entry in the Chassis Collection has, or will have, a sensors DBus item that lists the sensors that Chassis node contains. This change queries that DBus entry, and uses the information to collect the Thermal or Power sensor information. Tested: GET https://10.243.48.59/redfish/v1/Chassis/WP_Baseboard GET https://10.243.48.59/redfish/v1/Chassis/WP_Baseboard/Power GET https://10.243.48.59/redfish/v1/Chassis/WP_Baseboard/Thermal On 2 representative systems, one with a chassis, and one without. Observed correct behavior for both. Ran Redfish service validator. Observed no errors in Chassis, Thermal, Power, or ChassisCollection schemas. Change-Id: I01fcb3707396e2e33345bf125d8ae95170088a2a Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* update ASIO interfacesEd Tanous2019-03-291-1/+8
| | | | | | | | | | | | This commit does 2 things. 1. Upgrades and prepares bmcweb for boost 1.70. 2. Allows us to compile with BOOST_AIO_NO_DEPRECATED Tested: Compiled against 1.69 and 1.70. All changes should be no-op. Change-Id: I557ecd840fe2b88c0fa01978a1b666b40ccccca4 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Revert "bmcweb: Fix a bunch of warnings"Ed Tanous2019-03-251-8/+8
| | | | | | | | This reverts commit 6ea007a2faec52ad62680015d2a3f00371a1e351. Reason for revert: Reports of bmcweb seg faults. Change-Id: I408f1bb29c2f8e427a6621cdaac8c31b847ebf06
* bmcweb: Fix a bunch of warningsEd Tanous2019-03-221-8/+8
| | | | | | | | | | | | bmcweb classically has not taken a strong opinion on warnings. With this commit, that policy is changing, and bmcweb will invoke the best warnings we are able to enable, and turn on -Werror for all builds. This is intended to reduce the likelihood of hard-to-debug situations that the compiler coulve caught early on. Change-Id: I57474410821e82666b3a108cfd0db7d070e8900a Signed-off-by: Ed Tanous <ed@tanous.net>
* Add Redundancy to Thermal SchemaJames Feist2019-03-201-0/+201
| | | | | | | | | | | | | This looks for the FanRedundancy Interface https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Control/FanRedundancy.interface.yaml and an association to type inventory. Using these it adds Redundancy to the thermal schema. Tested: Passes Redfish schema validator Change-Id: Iffa32e445bd57234afeb5c682c9502c5daa227c1 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Redfish: Enhance and fix power/thermal sensorsShawn McCarney2019-03-201-141/+348
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made the following enhancements for Redfish power/thermal sensors: * Now dynamically obtains the DBus object path to pass to GetManagedObjects() when getting sensor values. Was previously hard-coded to "/" which didn't work on some systems. * Added "fan_tach" to list of DBus sensor types returned when thermal sensors are requested. * Added support for one-chassis systems. Made the following fixes: * Fixed @odata.id value when power sensors are requested. Previously returned "/redfish/v1/Chassis/chassis/Thermal". * Renamed "PowerSupply" to "PowerSupplies" to conform to schema. * Removed 6 properties that were being returned for PowerSupplies that were not in the schema. * Added check to make sure no sensors of the wrong type were being returned. Previously if the same connection (service) provided both power and thermal sensors, both types of sensors were always returned. Test Plan: https://gist.github.com/smccarney/79186e8510ba5479e846f2592d44d059 Tested: Verified the URLs /redfish/v1/Chassis/<chassis>/Power and /redfish/v1/Chassis/<chassis>/Thermal return the correct sensor names and values on a Witherspoon system. Verified fixes listed above worked. Ran Redfish Service Validator. Change-Id: I4bae615cb61fc436b3c0a9a5c4d6b4566a3ddaa6 Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
* Support for overriding multiple sensorRichard Marian Thomaiyar2019-03-121-61/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support added for overriding multiple sensor, in single patch method. Can accept Thermal (Temperatures/Fans) and Power (Voltages) collections. Unit-Test: 1. Verified sensor values are getting updated by doing PATCH method to a known sensor. Verified the value got updated using ipmitool sensor list. 2. Verified negative cases of making PATCH call on invalid chasisId, Invalid MemberId etc. Testedeby: Used Postman tool to issue the PATCH call to the 1. https://xx.xx.xx.xx/redfish/v1/Chassis/XXYYZZ/Thermal with content { "Temperatures": [ { "MemberId" : "SensorNameXX", "ReadingCelsius" : valueXX } ] "Fans": [ { "MemberId" : "SensorNameYY", "Reading" : valueYY } ] } 2. https://xx.xx.xx.xx/redfish/v1/Chassis/XXYYZZ/Power with content { "Voltages": [ { "MemberId" : "SensorNameXX", "ReadingVolts" : valueXX }, { "MemberId" : "SensorNameYY", "ReadingVolts" : valueYY } ] } Change-Id: Ie30a7dff421f1a459dfe7bac262ae29e98754810 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Patch support for sensor overrrideRichard Marian Thomaiyar2019-03-111-13/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support added for overriding sensor, which can be used for validation / ad-hoc debugging. This provides option to make PATCH call to redfish/v1/<chassisId>/Thermal or power id. Based on schema, will accept Temperatures / Voltages collection with properties MemberId and ReadingCelsius / ReadingVolts. TODO: 1. Need to make a dynamic way of enabling / disbaling this command. Unit-Test: 1. Verified sensor values are getting updated by doing PATCH method to a known sensor. Verified the value got updated using ipmitool sensor list. 2. Verified negative cases of making PATCH call on invalid chasisId, Invalid MemberId etc. Testedeby: Used Postman tool to issue the PATCH call to the 1. https://xx.xx.xx.xx/redfish/v1/Chassis/XXYYZZ/Thermal with content { "Temperatures": [ { "MemberId" : "SensorNameXX", "ReadingCelsius" : valueXX } ] } 2. https://xx.xx.xx.xx/redfish/v1/Chassis/XXYYZZ/Power with content { "Voltages": [ { "MemberId" : "SensorNameXX", "ReadingVolts" : valueXX } ] } Change-Id: Idf2d891ac0d10b5d20f78c386232cae8a6896f1a Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* bmcweb: fix compiler warningsEd Tanous2019-02-211-2/+2
| | | | | | | | | | | | This patchset attempts to fix all compiler warnings in bmcweb owned files. There are 2 warnings left, both in sdbusplus, which will be resolved in a patchset there. Tested By: Recompiled, observed warning count went from 30, to zero. Change-Id: Ife90207aa5773bc28faa8b04c732cafa5a56e4e4 Signed-off-by: Ed Tanous <ed@tanous.net>
* bmcweb: move variant usage to std namespaceEd Tanous2019-02-091-9/+5
| | | | | Change-Id: I9d7069668f91f2ac72d2f4a440f63e0e85dd5269 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Remove custom version of getPtrEd Tanous2018-12-101-3/+5
| | | | | | | | Now that sdbusplus variant supports std::get_if, we can remove our custom, mapbox namespaced implementation that does the same thing. Change-Id: I854c473003e28e41dd45dba08ca683433f1c1774 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Make chassis errors return the appropriate messageEd Tanous2018-11-301-8/+3
| | | | | | | | | Previously, chassis errors would only return 500, and a blank body. This change causes chassis errors to return the appropriate internalError implementation. Change-Id: I75454c334a0bd4870725bc9381a68af08e3eab80 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Chassis: Power: Support get PowerSupply and VoltagesEd Tanous2018-10-291-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sensors information. cherry-picked from: https://github.com/ampere-openbmc/bmcweb/commit/a20f8b17c1efb92b9a8e95e8867d945bc6177804 Sensor module adds sensorType:"power" to retrieve power supply sensor information. This applicable to Power schema version 1.2.1 Limit: - Not retrieve PowerControl information yet. - Need to get UpperThresholdFatal and LowerThresholdFatal value. Tested: Browser and redfishtool Command test: redfishtool -A Basic -S Always --rhost=$bmc_ip -u $bmc_user -p $bmc_password Chassis -I 1 Power Redmine ID: #2145. Change-Id: Ifd4a7495c216f894f46610c02d3e8a8e3988dfaa Signed-off-by: Tung Vu <tung.vu@amperecomputing.com> Chassis: Thermal and Power: Correct @odata.id information cherry-picked from: https://github.com/ampere-openbmc/bmcweb/commit/ae95b0db60e5e680819c9f9b0c6d61caf66b14cf Allocate @odata.id of schema in correct way. Sensor module is general interface not used for specific schema. Tested: Browser and redfishtool Command test: - redfishtool -A Basic -S Always --rhost=$bmc_ip -u $bmc_user -p $bmc_password Chassis -I 1 Power - redfishtool -A Basic -S Always --rhost=$bmc_ip -u $bmc_user -p $bmc_password Chassis -I 1 Thermal Redmine ID: #2145 & #2146 Change-Id: I265bbb366c323f39fb6d4ac4f7cccfed4382e98d Signed-off-by: Tung Vu <tung.vu@amperecomputing.com> Chassis: Correct @odata.id for specific Chassis sub-node. cherry-picked from: https://github.com/ampere-openbmc/bmcweb/commit/3eaa53a395ad9275042893413cbefc78f52310e5 Currently there are Thermal and Power sub-nodes of Chassis node, correct @odata.id information for each sub-node in JSON payload. Tested: Browser and redfishtool Command test: - redfishtool -A Basic -S Always --rhost=$bmc_ip -u $bmc_user -p $bmc_password Chassis Thermal -I 1 - redfishtool -A Basic -S Always --rhost=$bmc_ip -u $bmc_user -p $bmc_password Chassis Power -I 1 Change-Id: I2f831ed40926e85c0b6d1cfa7d759eb0b9321daa Signed-off-by: Tung Vu <tung.vu@amperecomputing.com> Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com>
* Improve the Redfish error reporting interfaceJason M. Bills2018-10-221-1/+2
| | | | | | | | | | | Makes the Redfish error reporting interface automatically handle setting the http status and JSON content in the response object. When using an AsyncResp object, this allows for simply calling the Redfish error and returning. Change-Id: Icfdce2de763225f070e8dd61e591f296703f46bb Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Implement fan PWM reading through redfishEd Tanous2018-10-161-35/+33
| | | | | | | | | This patchset implements the ability to be able to read the PWM output values from redfish under the Thermal schema. to be able to map fan outputs to redfish. Change-Id: I858d81ef61183722390a073fa925416d17da5fec Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Move to clang-format-6.0Ed Tanous2018-09-051-346/+442
| | | | | | | | This commit moves the codebase to the lastest clang-format file from upstream, as well as clang-format-6.0. Change-Id: Ice8313468097c0c42317fbb9e10ddf036e8cff4c Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Last round of variable renamesEd Tanous2018-08-151-1/+1
| | | | | | | | A few patches were in flight when we did the great variable renaming. This catches all the patches that have been merged since Change-Id: Ie9642a4812b2a679ffa01ce540f5c4515a4c710b Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Move over to upstream c++ styleEd Tanous2018-07-261-82/+80
| | | | | | | | | | | | | | | | | | This patchset moves bmcweb over to the upstream style naming conventions for variables, classes, and functions, as well as imposes the latest clang-format file. This changeset was mostly built automatically by the included .clang-tidy file, which has the ability to autoformat and auto rename variables. At some point in the future I would like to see this in greater use, but for now, we will impose it on bmcweb, and see how it goes. Tested: Code still compiles, and appears to run, although other issues are possible and likely. Change-Id: If422a2e36df924e897736b3feffa89f411d9dac1 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Move Sensors path to sensorsJames Feist2018-07-201-4/+4
| | | | | | | Upstream uses lowercase paths, fix it. Change-Id: Ia8dc522fdd59cbbde015049ca772347fb9d2c991 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Update sensors to reflect changes after switching to sdbusplusLewanczyk, Dawid2018-06-291-15/+32
| | | | | | | | - GetManagedObjects should be call only on service root path - additional fixes for RSV Change-Id: I4e345e57b081d7683fd8f3f4efa23fe4091ce41e Signed-off-by: Lewanczyk, Dawid <dawid.lewanczyk@intel.com>
* Implemented PATCH for EthernetInterface VLAN and HostName fieldsKowalski, Kamil2018-06-291-100/+109
| | | | | | | | | | | | Implemented PATCH request handling in EthernetInterface schema. Currently only VLAN and HostName patching is implemented - IP changes will be introduced in further patchsets. This code does not change existing functionality - only expands it. Tested on real hardware and x86 VM. Works fine, passes RedfishSchemaValidator. Change-Id: I8de4ee5e859218823b07cc11845f7ef6782d7171 Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com>
* Boost beastEd Tanous2018-06-291-89/+81
| | | | | | | | This commit is the beginings of attempting to transition away from crow, and toward boost::beast. Unit tests are passing, and implementation appears to be slightly faster than crow. Change-Id: Ic8d946dc7a04f514c67b1098f181eee1ced69171
* Move thermal interfaces to new schemaEd Tanous2018-06-291-22/+30
| | | | | | | | With the change to entity manager, move the thermal componets to the proper inventory manager interfaces Change-Id: I520e65b1df53ca8d3fbc12253882ae69b708bbbf Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Move bmcweb over to sdbusplusEd Tanous2018-06-291-28/+27
| | | | | | | | | | | | | | | | | | | | | | | | This patchset moves bmcweb from using boost-dbus over entirely to sdbusplus. This has some nice improvements in performance (about 30% of CPU cycles saved in dbus transactions), as well as makes this project manuver closer to the upstream way of thinking. Changes to bmcweb are largely ceremonial, and fall into a few categories: 1. Moves async_method_call instances to the new format, and deletes any use of the "endpoint" object in leiu of the sdbusplus style interface 2. sdbus object_path object doesn't allow access to the string directly, so code that uses it moves to explicit casts. 3. The mapbox variant, while attempting to recreate boost::variant, misses a T* get<T*>() method implementation, which allows using variant without exceptions. Currently, there is an overload for mapbox::get_ptr implementation which replecates the functionality. Tested by: Booting the bmcweb on a target, iterating through redfish basic phosphor-webui usage, and websockets usage Change-Id: I2d95882908d6eb6dba00b9219a221dd96449ca7b Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Spelling fixes in redfish-coreGunnar Mills2018-06-131-2/+2
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: Iaac459596247a9063350a129d0458ebe0c0e39ce Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Introduce Thermal schemaLewanczyk, Dawid2018-05-181-0/+424
Changes: -redfish.hpp add thermal node installation -thermal.hpp add thermal schema for chassis -sensor.hpp add support for retrieving: temperature, and fan Verification: -web server: no regression -RSV: pass -build on x86 and ASPEED This patchset builds on Dawids original. Change-Id: Ia8e40edff3c722fa02a161248bcdf602e36e3e62 Signed-off-by: Lewanczyk, Dawid <dawid.lewanczyk@intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
OpenPOWER on IntegriCloud