summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* bmcweb: merge conflict resolutionJason M. Bills2018-10-292-134/+60
| | | | | | | | | | | | | | Merge conflict in: Improve the Redfish error reporting interface 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: I3b37cce1e7f603c0b4cc74a16f8f00da9a7f1373 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* [scripts] Avoid deleting Oem Schemas During UpdateJames Feist2018-10-291-1/+4
| | | | | | | Don't delete Oem json and xml files. Change-Id: I2e4e2a49c776442c5d5e9d85400d3f6dba1f1d5a Signed-off-by: James Feist <james.feist@linux.intel.com>
* Chassis: Power: Support get PowerSupply and VoltagesEd Tanous2018-10-295-8/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add PID PatchJames Feist2018-10-291-2/+536
| | | | | | | | | | | | | | | | | | | This allows runtime modifying Pid configurations and zones. Tested by: Sent PATCH for: Modify FanController Modify FanZone New FanController New FanZone Modify PidController New PidController Delete FanController Delete FanZone Change-Id: Ie2dd52ea0b09dc4ad1ed016ec4c27b3c39be28de Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add paging and partial results for BMCLogServiceJason M. Bills2018-10-292-3/+75
| | | | | | | | | | | | | | | | | | Since BMC logs can be very large and may take some time to load, the browser could time out during the request. This change adds partial results support for those logs using the $skip and $top redfish query parameters so only up to 1000 are printed at a time with a link to get the next 1000 if they exist. Tested: Loaded a log with more than 1000 entries and confirmed that $skip entries are skipped and only $top (up to 1000) are loaded. Also verified that the nextLink property correctly points to the next set of log entries. Change-Id: I0a586524a8aab47b9ab457e1d3f56a8b6d97a700 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Speed up managers schemaJames Feist2018-10-291-0/+10
| | | | | | | PID was doing every query 8x times. Change-Id: I11fa064c2f9c416fe15fdfb15c63a6490f0b68dd Signed-off-by: James Feist <james.feist@linux.intel.com>
* Improve the Redfish error reporting interfaceJason M. Bills2018-10-2220-3076/+1484
| | | | | | | | | | | 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 a new way of unpacking json to structsEd Tanous2018-10-225-431/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing way of decoding json structures, while fast has some disadvantages. 1. it's very verbose to write. 2. It requires in depth knowlege of redfish error messages to get correct. 3. It _can_ lead to undesired behavior, like half of a patch being applied, if only some of the values have bad types. This commit implements a new interface for decoding redfish json named.... readJson. It is a templated function, that lets you decode json values based on type easily, while still handling all the correct error codes that were handled previously. Use is done similar to the example below: std::string required; boost::optional<std::string> optional; if (!json_util::readJson(req, res, "OptionalParam", optional, "RequiredParam", required)) { return; } if (optional){ // optional param was given, take action. } As part of this patchset, the systems schema is moved to the new interface, which deletes some of the code involved and shows the improvement in clarity. Change-Id: I041a97c84d294df8cd4de4c2702e5ee22c0bc120 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Clean up SessionService POSTEd Tanous2018-10-221-114/+53
| | | | | | | | | | | | | | | | | | | | Previously, SessionService would return a json decode error for all errors, even if certain keys were incorrect. This updates the POST handler to use a better method, and should reduce the binary size a little, given that we're removing the possibly throwing get<> code. This needs a very good review. This endpoint is available pre-auth, and needs to be secure regardless of input. Tested By: curl --noproxy "*" -k -X POST -d '{"UserName": "root", "Password": "0penBmc"}' https://10.243.48.30/redfish/v1/SessionService/Sessions/ Returns correct response. Tested several variations, including extra parameters, missing username, missing password, ect. Got correct error code in all cases. Change-Id: Ic8e6edd9f7badc0d22aa8dafa9c0c260386712ac Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* bmcweb: remove warning about coroutinesEd Tanous2018-10-221-0/+1
| | | | | | | | Boost coroutines seems to be in use in sdbusplus asio, despite its depcrecation in boost. Silence the warning. Change-Id: Ic72545604f597a7ce937710068b040362ab0d224 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Fix URL query parameter parsingJason M. Bills2018-10-192-2/+2
| | | | | | | | | | | | This change makes some minor corrections requried to properly parse query parameters in the url. Tested: Checked that parsing is working properly by using redfish $skip and $top parameters and values and confirming the values are correctly available in redfish. Change-Id: If95838cf0d4a1044059d3ca2630c8e3640b1f558 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Add a BMC LogServiceJason M. Bills2018-10-192-216/+527
| | | | | | | | | | | | | | | Adds a redfish LogService that provides the contents of the BMC journald instance available over readfish. This should be considered a prototype at this time, and suggestions on how this could be done better are welcome. At some point in the future, we could make this available over the redfish TaskService via SSE. Change-Id: Ibca0d473dcef545763256cc1df5574571a3af414 Signed-off-by: Ed Tanous <ed.tanous@intel.com> Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Fixup mapbox variant referencesWilliam A. Kennington III2018-10-184-14/+12
| | | | | | | | This removes all dependencies on the mapbox specific variant api. The code is now compatible with the drop in std::variant api. Change-Id: Ie64be86ecae341def54f564eb282fb3b5356cc18 Signed-off-by: William A. Kennington III <wak@google.com>
* bmcweb: Move to C++17Ed Tanous2018-10-181-1/+1
| | | | | | | | Move to c++ 17 to use some of the new features like std::variant, std::optional, ect Change-Id: I6d1d4a3ceb863256309641d29a2eb99ce44bef32 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* cleanup: close open filesPatrick Venture2018-10-162-0/+2
| | | | | | | | | | Clean up missing fclose calls. [src/getvideo_main.cpp:77]: (error) Resource leak: fp [src/ast_video_puller_test.cpp:56]: (error) Resource leak: fp Change-Id: I4d460e861a6275bfa6c02a319894d3154aec8ee7 Signed-off-by: Patrick Venture <venture@google.com>
* Implement fan PWM reading through redfishEd Tanous2018-10-162-36/+35
| | | | | | | | | 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>
* Redfish: Fixed incorrect firmware ID stringsJennifer Lee2018-10-161-40/+54
| | | | | | | | | | | Fixes: https://github.com/openbmc/bmcweb/issues/4 It was probably caused by incorrect merging, and that messed up the logic of the code. Fixed it so the Firmware Collection and Firmware response reflects correct information. Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Change-Id: I749a0af804cfa3e5cce89d1b8e11ec09d00d818d
* Redfish Rename LogService variablesEd Tanous2018-10-161-53/+49
| | | | | | | To match naming convention. Change-Id: I18371e7c605c03eaade5e3c00d2852c95ffa751a Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Add PID Get To RedfishJames Feist2018-10-163-52/+462
| | | | | | | | | Add doGet to managers for PID configuration data. Make sure passes schema validation. Change-Id: Ieeb97bf76a3d8a3c06f59f79cc0887aec746675e Signed-off-by: James Feist <james.feist@linux.intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implement PowerState in the chassis schemaEd Tanous2018-10-161-0/+1
| | | | | | | | Because the bmc is always "On" simply hardcode the value to ON. This is done because some compliance profiles require it. Change-Id: I8833355ca2a12d3606d10e7f653fca59ae8cf56a Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Redfish- Clean up system schema implementationEd Tanous2018-10-162-111/+71
| | | | | | | Move the system schema awa from using single letter variable names. Change-Id: I41f9c00f6a227a43126ad47f60e26950f0cf89ec Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Cleanups to ethernet schemasEd Tanous2018-10-161-1391/+1225
| | | | | | | | | | | | | | Several rounds of cleanup to the ethernet interfaces. Changes involved: 1. Move schemas to std::shared_ptr for handling responses 2. Remove the use of the "providers" interface. As there is currently only one usage, the providers interface doesn't give us any flexibility. 3 Move the ethernet interfaces to flat_set, to allow better sorting and lookup times. 4. Fix a number of "use after free" bugs with lambda callbacks that were passing by reference instead of by value. Change-Id: I3f8ffb10702563b25fda88155f1929b8d8e38bf5 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Fix JsonSchema indexesEd Tanous2018-10-16140-24936/+27090
| | | | | | | | | | | JsonSchema was throwing errors in the validator, so implement changes to the update script to add the appropiate indexes. Tested by: Schema validator passes on the JsonSchema Fields Change-Id: I6cb2737901b55c1089aef744d3ce3c3dfe13f17f Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Fix a minor spacing issue in CMakeLists.txtEd Tanous2018-10-161-1/+1
| | | | | | | | | Spaces got messed up in one spot in a comment. This resolves it. Tested By: Looking at the comment, and observing that it was now easier to read. Change-Id: I92393e61d61df3ea7c064d7bba35083939655fbf
* RedfishEd Tanous2018-10-161-3/+2
| | | | | | | | | | Rename openbmc to bmc in one spot. The initial code review to change this missed one spot in network protocol. Make sure it's renamed everywhere. Change-Id: I43f60038bb560924ce7544d3e0cb006339660bd9 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Fix an implementation commentEd Tanous2018-10-161-1/+1
| | | | | | | It was pointed out that a code comment mixed up the difference between ascending and descending. This resolves that issue. Change-Id: Ie71862b03bc23d9c20ac29ca78c076e05e47476a
* Fix merge conflict, and enable SOLEd Tanous2018-10-161-0/+5
| | | | | | | | | | A merge conflict caused the SOL websocket code to get removed from master. This resolves the merge conflict, and reenables SOL in bmcweb. Tested By: Launched SOL console in phosphor-webui, and observed appropriate behavior. Change-Id: I88116fdfb488b6c41aa859e4904b38e918111d04
* Avoid some copies in some loopsEd Tanous2018-10-121-2/+2
| | | | | | | | | Auto does not work the way you want it to in this case, and gives you copies, when you really wanted const references. This commit moves the loops to const references. Change-Id: I7aceedc03528b4d41c56b100e0c956a64b001ad9 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Ampere bmcweb: Add Firmware Version to Managers SchemaJennifer Lee2018-10-121-18/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cherry-picked from: https://github.com/ampere-openbmc/bmcweb/commit/a92abc99ac6831499ed362aa8e2d14cfe2d99e48 Change-Id: Ie817d8b3aab765e1e9a948c1d3de91cfca1f31ad Signed-off-by: Tung Vu <tung.vu@amperecomputing.com> Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Ampere: Correct Cpp coding style on previous commit Limit column of a line to 80 characters. cherry-picked from: https://github.com/ampere-openbmc/bmcweb/commit/7065ea3e9179a6ec5f294e21e6028ed15637262c Change-Id: I1d8f2cf84ee48f9d4af5176858be00aa6a4f582d Signed-off-by: Chuong Tran <chuong.tran@amperecomputing.com> Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Ampere bmcweb: Managers: Add ManagerType property. Add ManagerType property to "BMC" type. cherry-picked from: https://github.com/ampere-openbmc/bmcweb/commit/d589325ed7c5da2f3468ac0d105cfecc6405528a Tested: Browser and redfishtool Command test: redfishtool -A Basic -S Always --rhost=$bmc_ip -u $bmc_user -p $bmc_password Managers -I openbmc Redmine ID: #2026 Change-Id: I2cee251aa1b47fd06148f96b6b4fba018e0e5f1f Signed-off-by: Tung Vu <tung.vu@amperecomputing.com> Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implement redfish LogServiceEd Tanous2018-10-096-2/+629
| | | | | | | | | | | This commit implements an optional LogService endpoint for debugging CPUs over Redish. It exposes both the ability to create a new log with the LogImmediate action, as well as to pull a stored log using the LogCollection schema. This feature is disabled by default, and should be enabled in the meta-x86 layer. Change-Id: Ied1d5e263a0857e09cd9a24fddec9c11a4066cd2 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Last round of variable renamesEd Tanous2018-10-081-25/+24
| | | | | | | | 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: I43b006cf159403955c5adee31f3d826e8597c710 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Fix buffer bug in websocketsEd Tanous2018-10-081-11/+11
| | | | | | | | | | The websocket implementation had a buffer bug where buffers would duplicate the input data. This commit fixes the buffering issues, by backing the buffer with a simple std::string rather than a fixed buffer, and properly consuming it. Change-Id: If7407250d667b6b21cb0fa8699e0e396a2178203 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implement AccountService POSTEd Tanous2018-10-081-0/+191
| | | | | | | | | | | | | | | | | | | | | | | This commit implements POST events for AccountService/Accounts to aid in the creation of users. It utilizes the DBus User manager API to do its work, as well as PAM to set the password. Tested By: Created users of varying field counts to test all cases. {"UserName": "foobar", "Password": "superpassword", "RoleId": "Administrator"} Observed a user get enabled as Administrator {"UserName": "foobar", "Password": "superpassword"} Observed user created enabled, with default user level of "User" {"UserName": "foobar", "Password": "superpassword", "Enabled": false} observed a user get created as disabled {"UserName": "foobar", "Password": "password"} Observed error due to bad password security Change-Id: I09522c1ddd0f531e6201e7786c6d376d3b0a89e6 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implement AccountService DELETE methodEd Tanous2018-10-081-0/+34
| | | | | | | | | | | | This commit implements the AccountService DELETE method within redfish. It accesses the user manager interfaces as required. Tested by: Created a user using the dbus interface, then removed it using a DELETE command. Observed user was deleted from both dbus and redfish. Change-Id: I5ba639837a643731fcf180410a92011a08d968c7 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Unhardcode Enabled and Locked from AccountServiceEd Tanous2018-10-081-1/+41
| | | | | | | | | | | | AccountService previously hardcoded accounts to Enabled, and not locked. This patchset makes them pull from phsophor-network manager correctly. Tested By: Pulled AccountService with a collection of enabled and disabled accounts, and observed correct behavior. Change-Id: I0b122ba42b3c63acabe46caf56f843cfe02cf9e5 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implement AccountService PATCH methodEd Tanous2018-10-082-8/+156
| | | | | | | | This patchset implements the AccountService PATCH method, using PAM and dbus in combination. Change-Id: I754590f787fc84a21a9453e7e10726c56da5c3f7 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Move AccountService to node structureEd Tanous2018-10-084-124/+167
| | | | | | | | | | AccountService was the last service hanging on to the old way of doing things. This moves it up to our current standard using the Node class. Tested by: Ran service validator. Saw no errors. Change-Id: I84d0097f48803cb06d2ec95171f18bff04661666 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* remove providers interface from chassis schemaEd Tanous2018-09-261-115/+56
| | | | | | | | This commit removes the providers interface from the chassis schema, and cleans up quite a bit of code. Change-Id: I8984af67c9f15834ce59951c5e8f3b0d5c26697c Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Clean up rest-dbus interfaceEd Tanous2018-09-182-282/+426
| | | | | | | | | This is the first round of making the rest-dbus interface use the modern practices, like shared_ptr responses, and no-throw XML parsing. While it makes the implementation better, it does not fix everything. Change-Id: I985d45b03f1992e334f8a650f7f9392cc5fff30c Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Implement JsonSchema endpointEd Tanous2018-09-1774-0/+25314
| | | | | | | | | | This patchset implements JsonSchema support, and automates our update of the XML metadata, and Json schema files in the future by way of a python script. Change-Id: Iec6f580d10736678149db18d87be2f140b535be9 Signed-off-by: Ed Tanous <ed.tanous@intel.com> Signed-off-by: James Feist <james.feist@linux.intel.com>
* Implement Computer System reset actionEd Tanous2018-09-122-2/+148
| | | | | | | | | | | | This commit adds the ComputerSystem.Reset action to the redfish interface. Tested by: Ran compliance tool, and it appeared to pass. Also ran POST on the interface, and observed the system reset. Change-Id: Ie39bf9d1c78fe0688f4fee22b1ecf91268f2242c Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Modernization of systemsEd Tanous2018-09-121-190/+168
| | | | | | | | | | | | This moves systems schemas over to modern useages: 1. Remove the use of wildcard lambda captures [&] 2. Correctly handle the case where we are given a PATCH with parameters we don't support. 3. Move some functions that are no longer required, and are done more cleanly inside the specific handlers. Change-Id: Iab4a360e6b675e4f792b49c8cb2df9a3e7f68cbb Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Remove the providers interface from systemsEd Tanous2018-09-121-544/+490
| | | | | | | | | | | | | The providers class is entirely static, and has no real purpose at this point in time. This commit removes it so we don't copy the pattern in other places. Tested By: Ran a subset of gets and patches to the computer system schema, observed the same behavior. Change-Id: Ia9e49aee6bd944aeadb2536de38a905b25047d9e Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Generalize the "Async Response" patternEd Tanous2018-09-122-119/+109
| | | | | | | | | | Lots of endpoints have been using the AsyncResp structure, and some, like the systems schemas, have created their own. This is the start of a series of patches to move to a more condensed async response object. Tested by: ran GET on systems schema and observed no change to behavior. Change-Id: I4c9afc583be3f75371b31cc76dcc02590ce5e9a7
* Implement /console0 websocketEd Tanous2018-09-053-0/+159
| | | | | | | | | | | | | | | This commit ipmlements the serial console websocket in a way that is compatible with phosphor-rest. This allows the webui serial console to function. Latency doesn't appear improved, but I suspect that the obmc-console server has issues. Tested By: Booted phosphor-webui serial console. Serial console works as expected. Also implemented a serial console in python using python websocket, and it appears to send and receive data correctly. Change-Id: I0e571beb70a51923d6d7d148779a1154432c45c9 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Move to clang-format-6.0Ed Tanous2018-09-0568-13975/+16973
| | | | | | | | 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>
* Resolve issue with duplicated static filesEd Tanous2018-08-291-6/+18
| | | | | | | | | | | | | | | | | Resolves: https://github.com/openbmc/bmcweb/issues/5 In certain contexts when using nginx, there are cheats required to add duplicated files into the filesystem, making nginx beleive it has both compressed and uncompressed resources. This messes with bmcweb, as it previously treated this as a fatal error, given that it doesn't have a filesystem limitation. This patchset changes the behavior so that bmcweb now treats this as an ok situation, and only creates the route for the gzipped version, under the assumption that they are the same. Change-Id: I5744d651e9764242c5e52eeafb8c4df72b8a81a2 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Make dbus monitor compatible with phosphor-restEd Tanous2018-08-242-36/+174
| | | | | | | | | | | | | | | | | | | | This patchset makes the dbus monitor compatible with the upstream dbus monitor, which should help adoption. Performance seems greatly improved compared to the python implementation. The example given in the documentation of watching for sensors and state changes is checked in as a test script websocket_test.py, and seems to consume less of the CPU than the actual sensors that get produced (about 4% CPU on my ast2500) when producing 30 sensor updates per second. This can likely be improved in the future by batching change events, but it seems to be performant enough for the moment. Tested: Used test script checked in, and verified webui can register state change events properly. Change-Id: I7d4c61d0259b7773eb46df0f59f8fea1c7796450 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Add json to the known content typesEd Tanous2018-08-241-0/+1
| | | | | | | | | | | | Recently the odata endpoint has been implemented as a static file. This adds the appropriate content type to the map, so that we can return the appropriate header. Fixes the error: Cannot determine content-type for "/usr/share/www/redfish/v1/odata/index.json" with extension .json Change-Id: Ia6d55c9644c344a2d1957b878bfc25a994e8678b
* Make dbus-rest produce bool type instead of intEd Tanous2018-08-201-7/+0
| | | | | | | | | | | | | | To replicate the dbus-rest interfaces exactly, bmcweb explicitly converted bool values on dbus into their int equivalent (0 or 1) to faithfully replicate the "bug" in dbus-rest. With the review posted here https://gerrit.openbmc-project.xyz/#/c/openbmc/phosphor-rest-server/+/11267/ there is discussion around correcting this behavior in dbus-rest. This patchset is to maintain compatibility with the dbus rest interfaces, and to implement a TODO that's existed in bmcweb for a while. Change-Id: I4b832d7f1b46e09c35c587511af0ecaeb2df12fd Signed-off-by: Ed Tanous <ed.tanous@intel.com>
OpenPOWER on IntegriCloud