summaryrefslogtreecommitdiff
path: root/redfish-core/lib
AgeCommit message (Collapse)AuthorFilesLines
2020-02-20sessions: Remove odata.contextGunnar Mills1-6/+0
Redfish made odata.context optional (1.6.0 of DSP0266, Sept 2018). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. Change-Id: Iffc75a7cb68f22d67548e5632d7ebfbdd67d6598 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-20Roles: Remove odata.contextGunnar Mills1-5/+1
Redfish made odata.context optional (1.6.0 of DSP0266, Sept 2018). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. Change-Id: Ic267d8c9f1fbbec6087e61edf16e6bffe11c927e Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-20Sensors: Remove odata.contextGunnar Mills1-6/+0
Redfish made odata.context optional (1.6.0 of DSP0266, Sept 2018). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. The reason for making optional and removing from mockups/examples, "no one could figure out how to use it and it did not add value". Don't see value in it for our implementation. Change-Id: I8d1c91460ea5836cb793ba1a2774a97649da208a Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-20Service root: Remove odata.contextGunnar Mills1-2/+0
Redfish made odata.context optional (1.6.0 of DSP0266, Sept 2018). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. The reason for making optional and removing from mockups/examples, "no one could figure out how to use it and it did not add value". Don't see value in it for our implementation. Change-Id: I94bac092a3abfec59721eed2c8f10371624dacb3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-20Storage: Remove odata.contextGunnar Mills1-8/+0
Redfish made odata.context optional (1.6.0 of DSP0266, Sept 2018). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. The reason for making optional and removing from mockups/examples, "no one could figure out how to use it and it did not add value". Don't see value in it for our implementation. Change-Id: I16b95a4923f4b764d82cf3bc71b2ca51896822ef Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-20System: Remove odata.contextGunnar Mills1-5/+0
Redfish made odata.context optional (1.6.0 of DSP0266, Sept 2018). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. The reason for making optional and removing from mockups/examples, "no one could figure out how to use it and it did not add value". Don't see value in it for our implementation. Change-Id: Iee73d72d56237e8787e839ed06b979779c97d2f3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-20Update service: Remove odata.contextGunnar Mills1-7/+0
Redfish made odata.context optional (1.6.0 of DSP0266, Sept 2018). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. The reason for making optional and removing from mockups/examples, "no one could figure out how to use it and it did not add value". Don't see value in it for our implementation. Change-Id: I0dbf424c8fb91f448da19ce12b0dadb512880204 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-20virtual media: Remove odata.contextGunnar Mills1-4/+0
Redfish made odata.context optional (1.6.0 of DSP0266, Sept 2018). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. The reason for making optional and removing from mockups/examples, "no one could figure out how to use it and it did not add value". Don't see value in it for our implementation. Change-Id: I3972fea43d89267ba91f5a0f7c0aac00a18e0f6c Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-20diag-mode: return InTest if host is in diag modeAndrew Geissler1-0/+6
Per discussion with DMTF and clarification of InTest state within http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Status it was determined that this would represent the situation where the host is collecting diagnostic data. This maps to the new DiagnosticMode state added to the xyz.openbmc_project.State.Host.HostState namespace. Tested: Verified that Redfish API returned expected result when in DiagnosticMode: "Status": { "Health": "OK", "HealthRollup": "OK", "State": "InTest" }, Change-Id: I1c5deb5fdc251a5dcd4d1d01f4eedb6c507ded0a Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2020-02-19Permit Redfish to enable/disable the network interface cardJohnathan Mantey1-15/+74
The InterfaceEnabled property for an EthernetInterfaces element was hardcoded to "true". This change gets the actual state of the NIC. It also permits the NIC to be enabled or disabled. Tested: GET sut_ip/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 (and eth1) PATCH InterfaceEnabled to false GET sut_ip/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 (and eth1) PATCH InterfaceEnabled to true GET sut_ip/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 (and eth1) Confirmed the NIC was disabled from the BMC console using "ip link" Confirmed the Get NIC status reported the correct enabled state. Performed the tests above on a different network to confirm the second NIC can be controlled orthogonally. Passed service validator. Change-Id: I09b703118fe71765c7b1020688a803c74648c7c4 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
2020-02-19Account Service: Remove odata.contextGunnar Mills1-9/+1
Redfish made odata.context optional (1.6.0 of DSP0266). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. The reason for making optional and removing from mockups/examples, "no one could figure out how to use it and it did not add value". Don't see value in it for our implementation. From the Redfish issue removing it: "@odata.context provides little/no value. The common format we use provides no value/guidance. A generic odata client cannot use it because we don't return the specific version nor do we require it be changed with a query parameter. Between @odata.type and the metadata document and service document/service root, clients get all of the information they need. And the case where it is helpful (joins, etc) is something we never do." https://github.com/DMTF/Redfish-Service-Conformance-Check/pull/171 removes from Redfish-Service-Conformance-Check. Tested: Ran service validator. No errors. Ran Redfish-Service-Conformance-Check. No additional errors. Change-Id: Ic2c33080604ea275cf487e5cd5b9f7948af07db9 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-15log service: Remove odata.contextGunnar Mills1-25/+0
Tested: Built this commit and the commits under it. Loaded on a Witherspoon and ran validator. No errors. Change-Id: Id54bc61319f500c4122213bd0e0d6ba140c7c690 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-15ethernet: Remove odata.contextGunnar Mills1-13/+0
Redfish made odata.context optional (1.6.0 of DSP0266), has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. Change-Id: I5a78856c510f063df67999bb8196e77401c56aac Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-15chassis: Remove odata.contextGunnar Mills1-4/+0
Redfish made odata.context optional (1.6.0 of DSP0266) and has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. Change-Id: I96e8908f07d27696aaf2e2ba33f49411b8e51ec5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-15cpudimm: Remove odata.contextGunnar Mills1-7/+0
Redfish made odata.context optional (1.6.0 of DSP0266) and has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. Change-Id: I4f9ce00b8cc6f413896879d8c8ec6e093279bd47 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-15certificate_service: Remove odata.contextGunnar Mills1-15/+0
Redfish made odata.context optional (1.6.0 of DSP0266, Sept 2018). Redfish has removed odata.context from example payloads in the specification (1.7.0 of DSP0266), removed it from the mockups, and Redfish recommended not using. The reason for making optional and removing from mockups/examples, "no one could figure out how to use it and it did not add value". Don't see value in it for our implementation. Change-Id: I3d634aa1a58072589e565f2361e010b459bfd3f5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-14Move to latest Redfish Service versionGunnar Mills1-1/+1
The latest version of the Redfish Service is 1.9.0. Nothing preventing us from moving to it. Find the Redfish Specification (DSP0266) here: https://www.dmtf.org/dsp/DSP0266 Looks like code is already trying to use some of the 1.7.0 features: "Added "Password Management" clause to describe functional behavior for restricting access when an account requires a password change." Eventing mechanism and ApplyTime. Will want to use features like: odata.context optional, query parameter clarification, and eventing clarification. Tested: Redfish Validator. Not really a valid test though. Ran Redfish-Service-Conformance-Check, didn't see additional errors. Note: bmcweb still has a lot of Conformance Checker errors, we are not in 100% complicance with Redfish specification. Change-Id: I0acd28efa2aaa91149f53efddae530816fd41fff Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-14Report NIC link status via netlink carrier stateJohnathan Mantey1-2/+12
Update Redfish to use a DBus boolean value specifically intended for communicating the NIC link state. Existing Intel server boards have a NCSI channel with a speed value always assigned to 100Mbps. This makes identifying link state impossible via the network speed value. The DBus boolean uses the netlink carrier on/off state which is more accurate. Tested: BMC Console commands: ip link set down dev eth0 Get managers/bmc/eth0 state ;; LinkStatus is LinkDown ip link set up dev eth0 Get managers/bmc/eth0 state ;; LinkStatus is LinkUp Remove NIC cable from RJ45 connector Get managers/bmc/eth0 state ;; LinkStatus is LinkDown Insert NIC cable into RJ45 connector Get managers/bmc/eth0 state ;; LinkStatus is LinkUp Change-Id: I93d3f716a0afc563e3312e99b4a4163187985521 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
2020-02-13Redfish: Processor: Add new 2019.4 propertiesGunnar Mills1-1/+13
In 2019.4 was a new 1.7.0 Processor schema that included PartNumber, SerialNumber, and Version. Tested: Ran validator. curl -k https://${bmc}/redfish/v1/Systems/system/Processors/cpu0 { "@odata.context": "/redfish/v1/$metadata#Processor.Processor", "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0", "@odata.type": "#Processor.v1_7_0.Processor", "Id": "cpu0", "InstructionSet": "PowerISA", "Manufacturer": "IBM", "Model": "", "Name": "Processor", "PartNumber": "02CY102", "ProcessorArchitecture": "Power", "ProcessorType": "CPU", "SerialNumber": "YA1934292547", "Status": { "Health": "OK", "State": "Enabled" }, "TotalCores": 18, "Version": "22" } Change-Id: I6ad02eacf77640965d126a9db6c51cdfdb691978 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-13Update to the new ResetType mappingJason M. Bills1-5/+7
This updates Redfish ResetType with the new states added in the document below: ref: https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/28706 Tested: Sent a POST with the updated ResetType values and confirmed the correct behavior: ForceRestart: host restarted using Host.ForceWarmReboot GracefulRestart: host restarted using Host.GracefulWarmReboot PowerCycle: host restarted using Host.Reboot Change-Id: I053919f2aaa709ba92685d67c1692bfc88b10d39 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2020-02-12pid: Don't delete configurationsJames Feist1-11/+5
Code added that deleted configurations was needed to get the chassis data. Instead just count the number of configurations to not allow posting more. Tested: Creating new PIDs worked again Change-Id: Ieb7ff7d16967402da64faf6a5cb2d0989af36d23 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-02-10Add a pid controller size limitJames Feist1-0/+33
Right now there is no limit, so someone could attack the bmc by adding a very large number of controllers. Create a limit so this isn't possible. Tested: Add / Remove functionality still works Change-Id: Ib408293431250d93b0af71616a1668f6a3d0904a Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-02-10PID: Don't attempt to delete unknown objectsJames Feist1-4/+25
This puts a block in to return early if we are asked to delete something we can't find on D-Bus. This code path was creating a segfault, but theres no reason to continue after we can't find an object we are asked to delete, so we can just avoid it. Also clean up the end iterator dereference so it doesn't happen in any other path. Tested: Segfault goes away Change-Id: I33622e5e8ab09fba0681e4f86f4a7068f6ef0be7 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-02-10Update AccountService PrivilegeGunnar Mills1-2/+1
"GET" should be a "Login" Privilege for the AccountService resource. This makes sense, a "Readonly" and "Operator" user should be able to see properties like MaxPasswordLength and MinPasswordLength since they are allowed to change their own password. This was changed in Redfish 2019.3, redfish issue 1914 explains more. From Redfish_1.0.4_PrivilegeRegistry.json: "Entity": "AccountService", "OperationMap": { "GET": [ { "Privilege": [ "Login" ] } ], "HEAD": [ { "Privilege": [ "Login" ] } ], "PATCH": [ { "Privilege": [ "ConfigureUsers" ] } ], "PUT": [ { "Privilege": [ "ConfigureUsers" ] } ], "DELETE": [ { "Privilege": [ "ConfigureUsers" ] } ], "POST": [ { "Privilege": [ "ConfigureUsers" ] } ] Change-Id: Iab8acbac97a58aed865bf94f665d6c9a32de81dd Tested: Build for Witherspoon and AccountService looks good. Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-08Add Power Supply AttributesGunnar Mills1-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>
2020-02-07Move Crashdump to OemCrashdumpGunnar Mills1-3/+3
All other Oem Schemas start with Oem. This is used by the update_schemas.py to determine an Oem schema and is a reasonable requirement for Oem schemas. https://github.com/openbmc/bmcweb/blob/a3268f98f308ca7c8660b1ace44d5b9a40be204b/scripts/update_schemas.py#L43 Tested: Ran the validator against this change on a Witherspoon with BMCWEB_ENABLE_REDFISH_CPU_LOG enabled and OemCheck true. Validator passed. Might be worth running on a system that actually uses BMCWEB_ENABLE_REDFISH_CPU_LOG. curl -k https://${bmc}/redfish/v1/Systems/system/LogServices/Crashdump { "@odata.context": "/redfish/v1/$metadata#LogService.LogService", "@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump", "@odata.type": "#LogService.v1_1_0.LogService", "Actions": { "#LogService.ClearLog": { "target": "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/LogService.ClearLog" }, "Oem": { "#Crashdump.OnDemand": { "target": "/redfish/v1/Systems/system/LogServices/Crashdump/Actions/Oem/Crashdump.OnDemand" } } }, "Description": "Oem Crashdump Service", "Entries": { "@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries" }, "Id": "Oem Crashdump", "MaxNumberOfRecords": 3, "Name": "Open BMC Oem Crashdump Service", "OverWritePolicy": "WrapsWhenFull" } Change-Id: Iacc11be1284b99c2ed9a6c2ca0a936bd97855afb Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-02-03Add support to fetch the 'Updateable' componentsAppaRao Puli1-1/+3
Currently 'Updateable' property value in SoftwareInventory schema is hardcoded. Added support to look through the updateable software associations objects and use it for 'Updateable' Redfish property in SoftwareInventory. Tested: - Checked 'Updateable' Property value for both programmable and non-programmable firmware inventory components and it works as expected. - Ran the Redfish validator and no new issues found. Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Change-Id: Ia24f942f3afe49674ec3628cac0356a5496ef337
2020-01-30Enhance return value from pamAuthenticateUserJoseph Reynolds1-1/+1
This enhances the return value from the pamAuthenticateUser function so callers can articulate PAM error codes like PAM_NEW_AUTHTOK_REQD which means the credentials are correct, but the password must be changed. Tested: Yes, scenarios via both Redfish login and Basic Auth: - correct username and password, password is not expired - correct username and password, password is expired - correct username and incorrect password, password is not expired - correct username and incorrect password, password is expired - non-existent user (passsword is not relevant) Signed-off-by: Joseph Reynolds <joseph-reynolds@charter.net> Change-Id: I1114d6c9cc591fb0a1853cb4edea32ad22f7b015
2020-01-27Add OemVirtualMedia schemaPrzemyslaw Czarnowski1-4/+7
OEM Schema for VirtualMedia added. Also OpenBMC level has been added to OEM field in the code to conform to schema standard. Tested: Manually using full stack of VirtualMedia. * Inserting/ejecting media in both legacy and proxy mode * Redfish Service Validator 1.3.2 ran Change-Id: Iaa87dd767a4bf2062bd4e74dd790a2496aca96de Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2020-01-27InsertMedia and EjectMedia actions added to VirtualMedia schemaPrzemyslaw Czarnowski1-1/+376
As continuation for VirtualMedia Redfish support, this patch adds insertion and eject actions into existing VirtualMedia code base. Testing: * Manual tests together with nbd proxy and virtual media app - For requests: Postman and/or HTTPie, with logs enabled and Valgrind) - Manual result validation * Tests run: - GET on collection with manual validation - PUT/POST/DELETE on collection - GET on item/nonexistent item - PUT/POST/DELETE on item - GET/PUT/DELETE on action - POST on action - EjectMedia/InsertMedia, legacy mode - POST on action - InsertMedia, proxy mode - POST on action - input validation (empty, invalid URL), legacy mode * Redfish Service Validator tested, no new issues found. Change-Id: Icccc433c1e84bc2ac37d9c295fe72749187fb735 Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2020-01-27Add VirtualMedia schema to RedfishPrzemyslaw Czarnowski3-5/+387
This change adds VirtualMedia scheme to Redfish. Implementation is based on input from virtual-media module and nbd proxy which is a bmcweb part. The code is used only in case ndb-proxy is supported in bmcweb (BMCWEB_ENABLE_VM_NBDPROXY compilation flag). Tested: * Manual tests together with nbd proxy and virtual media app - For requests: Postman and/or HTTPie, started with logs enabled and Valgrind - Manual result validation * Tests ran: - GET on collection with manual validation - PUT/POST/DELETE on collection - GET on item/nonexistent item - PUT/POST/DELETE on item * Redfish Service Validator tested, no new issues found. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Change-Id: I5415dc0ffe52069fd35bc614b0378bbc4ad41ff6
2020-01-17Changed input data format for Crashdump.SendRawPeciKarthick Sundarrajan1-12/+50
At present, the Crashdump.SendRawPeci redfish interface accepts one PECI command at a time. Changed it to accept array of PECI commands through which multiple PECI commands can be aggregated into one redfish call. Also provided backward compatibility for existing single PECI command input format. Tested: Tested by aggregating 1000 PECI commands in one redfish call. Tested by giving single PECI command with the existing format. Change-Id: I05c547438ce9833519807b39347223183bdfb4ed Signed-off-by: Karthick Sundarrajan <karthick.sundarrajan@intel.com>
2020-01-07only return fw images in FirmwareInventoryAndrew Geissler1-2/+6
Some systems create a xyz.openbmc_project.Software.Version D-bus object for reasons other then storing a FirmwareInventory object. For example the phosphor-logging code can add it to a log to track what level of code was running when a log was created. These should not show up in the Redfish FirmwareInventory API. Tested: Before this change, 3 and 4 correlated to phosphor-logs on system curl -k -H "X-Auth-Token: $TOKEN" -X GET https://${BMC_IP}/redfish/v1/UpdateService/FirmwareInventory/ { "@odata.context": "/redfish/v1/$metadata#SoftwareInventoryCollection.SoftwareInventoryCollection", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory", "@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection", "Members": [ { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/3" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/4" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/224cd310" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/3b296352" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/e9b7a436" } ], "Members@odata.count": 5, "Name": "Software Inventory Collection" } After: Verified 3 and 4 were no longer returned in FirmwareInventory curl -k -H "X-Auth-Token: $TOKEN" -X GET https://${BMC_IP}/redfish/v1/UpdateService/FirmwareInventory/ { "@odata.context": "/redfish/v1/$metadata#SoftwareInventoryCollection.SoftwareInventoryCollection", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory", "@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection", "Members": [ { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/224cd310" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/2d556644" }, { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/7432374c" } ], "Members@odata.count": 3, "Name": "Software Inventory Collection" } Ran Redfish validator and ensured no errors Change-Id: I3e99fe7570b87b83f75918873267fb1587add182 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2020-01-07Add IndicatorLed to Chassis SchemaJames Feist3-138/+280
This adds the indicator property to Chassis Schema, and moves the logic from systems.hpp to a common header to share the code. Tested: Passed the validator, was able to turn LED on Change-Id: I79458a2a4656d7ddf2939bb9f56845eb6d9a27ca Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-12-12Redfish: Support health status of firmware inventory objectsCarol Wang1-1/+0
Support health status of firmware inventory objects based on the mapping relationship: [dbus status] [redfish state] [redfish health] Ready Disabled OK Activating Updating OK Active Enabled OK NotReady Disabled Warning Invalid Disabled Warning Failed Disabled Warning Tested: [dbus status] --> [redfish state] --> [redfish health] 1. Ready --> Disabled --> OK $ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate { ... "/xyz/openbmc_project/software/9557fe67": { "Activation": "xyz.openbmc_project.Software.Activation.Activations.Ready", ... } $curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/9557fe67 { "@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/9557fe67", ... "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Disabled" }, ... } 2. Activating --> Updating --> OK $ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate { ... "/xyz/openbmc_project/software/9557fe67": { "Activation": "xyz.openbmc_project.Software.Activation.Activations.Activating", ... } $curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/9557fe67 { "@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/9557fe67", ... "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Updating" }, ... } 3. Active --> Enabled --> OK $ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate { "data": { "/xyz/openbmc_project/software/9557fe67": { "Activation": "xyz.openbmc_project.Software.Activation.Activations.Active", ... } $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/9557fe67 { "@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/9557fe67", ... "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" }, ... } 4. Invalid --> Disabled --> Warning # busctl call xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/c0bbba12 \ org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Software.Activation Activation s \ xyz.openbmc_project.Software.Activation.Activations.Invalid $ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate { ... "/xyz/openbmc_project/software/c0bbba12": { "Activation": "xyz.openbmc_project.Software.Activation.Activations.Invalid", ... } $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/c0bbba12 { "@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/c0bbba12", ... "Status": { "Health": "Warning", "HealthRollup": "OK", "State": "Disabled" }, ... } 5. NotReady --> Disabled --> Warning # busctl call xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/c0bbba12 \ org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Software.Activation Activation s \ xyz.openbmc_project.Software.Activation.Activations.NotReady $ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate { ... "/xyz/openbmc_project/software/c0bbba12": { "Activation": "xyz.openbmc_project.Software.Activation.Activations.NotReady", ... } $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/c0bbba12 { "@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/c0bbba12", ... "Status": { "Health": "Warning", "HealthRollup": "OK", "State": "Disabled" }, ... } 6. Failed --> Disabled --> Warning # busctl call xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/c0bbba12 \ org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Software.Activation Activation s \ xyz.openbmc_project.Software.Activation.Activations.Failed $ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate { ... "/xyz/openbmc_project/software/c0bbba12": { "Activation": "xyz.openbmc_project.Software.Activation.Activations.Failed", ... } $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/c0bbba12 { "@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/c0bbba12", ... "Status": { "Health": "Warning", "HealthRollup": "OK", "State": "Disabled" }, ... } Validator tool result: Counter({'pass': 2992, 'skipOptional': 2470, 'metadataNamespaces': 1605, 'passGet': 189, 'serviceNamespaces': 71, 'invalidPropertyValue': 10, 'warningPresent': 6, 'passAction': 6, 'optionalAction': 5, 'warnDeprecated': 2, 'unverifiedComplexAdditional': 1}) Validation has succeeded. Change-Id: Ic475f56d19c0be01ca7aebf67a3f6814d35bcacd Signed-off-by: Carol Wang <wangkair@cn.ibm.com>
2019-12-10ProcSummary: Use NothrowJames Feist1-7/+21
Exceptions are compiled out, and json.get throws, change it to get_ptr. Tested: no functional change Change-Id: Ie2db7285b89b45b1fd61d8526561b772c85151b3 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-12-06bmcweb: Handle ConfigureSelf privilegeJoseph Reynolds2-3/+55
Enhances BMCWeb to correctly handle the Redfish ConfigureSelf privilege. Redfish document DSP2046 defines the ConfigureSelf privilege as "Can change the password for the current user account and log out of their own sessions." This notion is formalized in the Redfish DSP8011 PrivilegeRegistry where ConfigureSelf appears in three operations: - ManagerAccount (/redfish/v1/AccountService/Accounts/{account}) GET operation. - ManagerAccount (/redfish/v1/AccountService/Accounts/{account}) PATCH Password property override. - Session (/redfish/v1/SessionService/Sessions/{sessionid}) DELETE operation. Tested: Yes, tested the above operations using users with various Roles to determine which operations are allowed. ReadOnly users (privileges: Login, ConfigureSelf): - Can GET their own account. - Can change their password. - Can log out. - Cannot change any other properties of their own account. - Cannot change anyone else's password. - Cannot GET someone else's account. - Cannot log out anyone else. Operator users (privileges: Login, ConfigureComponents, ConfigureSelf): - Same access as a ReadOnly user. Administrator users (all privileges): - Can do everything Operator can do. - Can change one or more properties of their account - Can GET and change properties of someone else's account. - Can logoff any session. Signed-off-by: Joseph Reynolds <joseph-reynolds@charter.net> Change-Id: If8efd71cb9743a59b7c5fe1565804d21e788ea29
2019-12-05Redfish: Implement ResetBios actionCarol Wang2-0/+76
This action resets the BIOS attributes to default. Tested: GET test: 1. $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Systems/system { ... "Bios": { "@odata.id": "/redfish/v1/Systems/system/Bios" }, ... } 2. $ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Systems/system/Bios { "@odata.id": "/redfish/v1/Systems/system/Bios", "@odata.type": "#Bios.v1_1_0.Bios", "Actions": { "#Bios.ResetBios": { "target": "/redfish/v1/Systems/system/Bios/Actions/Bios.ResetBios" } }, "Description": "BIOS Configuration Service", "Id": "BIOS", "Name": "BIOS Configuration" } POST test: 1. Change gard list: # ./gard list No GARD entries to display # ./gard create /Sys0/Node0/Proc1/EQ1/EX1/Core0 # ./gard list ID | Error | Type | Path ----------------------------------------------------------------------- 00000001 | 00000000 | Manual | /Sys0/Node0/Proc1/EQ1/EX1/Core0 ======================================================================= 2. Reset bios: # curl -k -H "X-Auth-Token: $token" -X POST https://${bmc}/redfish/v1/Systems/system/Bios/Actions/Bios.ResetBios 3. Check gard list again: # ./gard list No GARD entries to display Validator tool test: Counter({'pass': 3001, 'skipOptional': 2475, 'metadataNamespaces': 1605, 'passGet': 191, 'serviceNamespaces': 72, 'invalidPropertyValue': 10, 'passAction': 7, 'optionalAction': 6, 'warningPresent': 6, 'warnDeprecated': 2, 'unverifiedComplexAdditional': 1}) Validation has succeeded. Signed-off-by: Carol Wang <wangkair@cn.ibm.com> Change-Id: I0cba966bfde04566001b6df07ad15217f627c327
2019-12-04Redfish: ApplyTime property GET and PATCH supportJayashankar Padath1-33/+96
This change is to GET and PATCH the ApplyTime property using the UpdateServce redfish schema. GET request can be used to check the value before initiating the BMC image upload and activation. PATCH request can be used to update the ApplyTime value. If the ApplyTime value is Immediate, force-reboot.service gets called which reboots the BMC. If the ApplyTime value is OnReset, no force reboot will be triggered and the new BMC image will be functional till the user decideds to reboot the BMC manually. Tested: Changes passed the Redfish-Service-Validator test. Success Scenarios: 1. If the value of ApplyTime is Immediate (GET request) GET https://$bmc/redfish/v1/UpdateService { "@odata.context": "/redfish/v1/$metadata#UpdateService.UpdateService", "@odata.id": "/redfish/v1/UpdateService", "@odata.type": "#UpdateService.v1_2_0.UpdateService", "ApplyTime": "Immediate", "Description": "Service for Software Update", "FirmwareInventory": { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory" }, "HttpPushUri": "/redfish/v1/UpdateService", "Id": "UpdateService", "Name": "Update Service", "ServiceEnabled": true } 2. PATCH request to change value to OnReset: PATCH -d '{ "HttpPushUriOptions": { "HttpPushUriApplyTime": { "ApplyTime""OnReset"}}}' https://${bmc}/redfish/v1/UpdateService { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.4.0.Success", "Resolution": "None", "Severity": "OK" } ] } Error Scenarios: 1. Test by giving wrong HttpPushUriOptions name [Given as "HttpPushUriOptions1"] PATCH -d '{ "HttpPushUriOptions1": { "HttpPushUriApplyTime": { "ApplyTime":"Immediate"}}}' https://${bmc}/redfish/v1/UpdateService { "HttpPushUriOptions1@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The property HttpPushUriOptions1 is not in the list of valid properties for the resource.", "MessageArgs": [ "HttpPushUriOptions1" ], "MessageId": "Base.1.4.0.PropertyUnknown", "Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ] } 2. Test by giving wrong HttpPushUriApplyTime name [Given as "HttpPushUriApplyTime1"] PATCH -d '{ "HttpPushUriOptions": { "HttpPushUriApplyTime1": { "ApplyTime:"Immediate"}}}' https://${bmc}/redfish/v1/UpdateService { "HttpPushUriApplyTime1@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The property HttpPushUriApplyTime1 is not in the list of valid properties for the resource.", "MessageArgs": [ "HttpPushUriApplyTime1" ], "MessageId": "Base.1.4.0.PropertyUnknown", "Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ] } 3. Test by giving wrong ApplyTime name [Given as "ApplyTime1"] PATCH -d '{ "HttpPushUriOptions": { "HttpPushUriApplyTime": { "ApplyTime1":"Immediate"}}}' https://${bmc}/redfish/v1/UpdateService { "ApplyTime1@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The property ApplyTime1 is not in the list of valid properties for the resource.", "MessageArgs": [ "ApplyTime1" ], "MessageId": "Base.1.4.0.PropertyUnknown", "Resolution": "Remove the unknown property from the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ] } 4. Giving wrong ApplyTime value ["Immediat" instead of "Immediate"] PATCH -d '{ "HttpPushUriOptions": { "HttpPushUriApplyTime": { "ApplyTime":"Immediat"}}}' https://${bmc}/redfish/v1/UpdateService { "ApplyTime@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The value Immediat for the property ApplyTime is not in the list of acceptable values.", "MessageArgs": [ "Immediat", "ApplyTime" ], "MessageId": "Base.1.4.0.PropertyValueNotInList", "Resolution": "Choose a value from the enumeration list that the implementation can support and resubmit the request if the operation failed.", "Severity": "Warning" } ] } 5. NULL value given for "HttpPushUriOptions" PATCH -d '{ "HttpPushUriOptions": ""}' https://${bmc}/redfish/v1/UpdateSrvice { "HttpPushUriOptions@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The value \"\" for the property HttpPushUriOptions is of a different type than the property can accept.", "MessageArgs": [ "\"\"", "HttpPushUriOptions" ], "MessageId": "Base.1.4.0.PropertyValueTypeError", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ] } 6. NULL value given for "HttpPushUriApplyTime" PATCH -d '{ "HttpPushUriOptions": { "HttpPushUriApplyTime":""}}' https:/${bmc}/redfish/v1/UpdateService { "HttpPushUriApplyTime@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The value \"\" for the property HttpPushUriApplyTime is of a different type than the property can accept.", "MessageArgs": [ "\"\"", "HttpPushUriApplyTime" ], "MessageId": "Base.1.4.0.PropertyValueTypeError", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ] } 7. NULL value given for "HttpPushUriApplyTime" PATCH -d '{ "HttpPushUriOptions": { "HttpPushUriApplyTime":{ "ApplyTime":""}}}' https://${bmc}/redfish/v1/UpdateService { "ApplyTime@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The value for the property ApplyTime is not in the list of acceptable values.", "MessageArgs": [ "", "ApplyTime" ], "MessageId": "Base.1.4.0.PropertyValueNotInList", "Resolution": "Choose a value from the enumeration list that the implementation can support and resubmit the request if the operation failed.", "Severity": "Warning" } ] } Signed-off-by: Jayashankar Padath <jayashankar.padath@in.ibm.com> Change-Id: Icd01bb6c102c0a24285c79ccf4d41fd5fe53f0ed
2019-12-03Fix No Total Memory Size IssueCheng C Yang2-20/+39
Total Memory in redfish is always 0, fix the problem. Tested: After DC cycle the system. TotalSystemMemoryGiB in Redfish system page should not be zero. "MemorySummary": { "Status": { "State": "Enabled" }, "TotalSystemMemoryGiB": 16 }, Signed-off-by: Cheng C Yang <cheng.c.yang@linux.intel.com> Change-Id: I89ad8ed1cf5f9ca9589db444740167645dab9a6e
2019-12-02Return no-content instead of waiting for OnDemandJason M. Bills1-89/+1
Since an OnDemand crashdump could take some time it may cause the request to time out before the response can be sent. The correct fix for this is to implement the Redfish Task Monitor service to handle all asynchronous tasks. Until then, this change will return 204 (no content) and add the OnDemand log to the Entries list. When Task Monitor is implemented it can return 202 (accepted) with the location of the Task to poll. Tested: Used Postman to trigger the OnDemand action and immediately got a 204 response. Polled the Entries list and saw the OnDemand entry after it was ready. Change-Id: I3e2692ec5d377823072e0d610fa3ca17a9259a37 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-12-02Return 503 instead of 500 when Crashdump is busyJason M. Bills1-0/+6
Tested: Used Postman to send the OnDemand action twice and got a 503 with a retry message on the second attempt. Change-Id: I319a6318ee57e504a54b3fdb6894a5aeb43af203 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-12-02Return a 404 instead of 500 for invalid Crashdump URIsJason M. Bills1-1/+10
Tested: Used a browser to request an invalid Crashdump URI and got a 404 with a resource not found error. Change-Id: Idcac7868bb1f3b4c0248926b46be2cf4fce05328 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-12-02Add "Retry-After" header for temporarily unavailable messagesJason M. Bills3-3/+0
Whenever the Redfish response is that a service is temporarily unavailable, the "Retry-After" header is added with the same value, so just set the header automatically with the response. Tested: Confirmed that the "Retry-After" header is set correctly with the Redfish temporarily unavailable message. Change-Id: I9c940be94d9d284b9633c5caa2ce71ade76d22d5 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-11-27Remove error for empty subtree responseJames Feist1-1/+1
This interface doesn't have to exist Change-Id: If0ea4e3c201c80c25e825f64ba3601685ef9ed95 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-11-27Storage: Add Storage ControllerJames Feist2-21/+174
This adds support for Storage Controllers. Tested: Validator passed { "@odata.context": "/redfish/v1/$metadata#Storage.Storage", "@odata.id": "/redfish/v1/Systems/system/Storage/1", "@odata.type": "#Storage.v1_7_1.Storage", "Drives": [ { "@odata.id": "/redfish/v1/Systems/system/Storage/1/Drives/Drive_1" }, { "@odata.id": "/redfish/v1/Systems/system/Storage/1/Drives/Drive_2" }, { "@odata.id": "/redfish/v1/Systems/system/Storage/1/Drives/Drive_3" }, { "@odata.id": "/redfish/v1/Systems/system/Storage/1/Drives/Drive_4" }, { "@odata.id": "/redfish/v1/Systems/system/Storage/1/Drives/Drive_5" }, { "@odata.id": "/redfish/v1/Systems/system/Storage/1/Drives/Drive_6" }, { "@odata.id": "/redfish/v1/Systems/system/Storage/1/Drives/Drive_7" }, { "@odata.id": "/redfish/v1/Systems/system/Storage/1/Drives/Drive_8" } ], "Drives@odata.count": 8, "Id": "1", "Name": "Storage Controller", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" }, "StorageControllers": [ { "@odata.context": "/redfish/v1/$metadata#Storage.StorageController", "@odata.id": "/redfish/v1/Systems/system/Storage/1#/StorageControllers/0", "@odata.type": "#Storage.v1_7_0.StorageController", "Manufacturer": "$BOARD_MANUFACTURER", "MemberId": "HSBP_1", "Model": "$BOARD_PRODUCT_NAME", "Name": "HSBP_1", "PartNumber": "$BOARD_PART_NUMBER", "SerialNumber": "$BOARD_SERIAL_NUMBER", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" } } ] } Change-Id: I9d956343daa74ddfa912e3cbe0d38b0e42a4859f Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-11-25Health: Allow populate to only be called onceJames Feist1-0/+6
Populate does a mapper call and a get managed objects and should only be called once. Enforce it. Tested: No actual change, it is currently never called twice, this is just for future protection with multiple async calls. Change-Id: I8fb9d8d19b2aa2a1c957a0ac8b609adf5e6ba6d0 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-11-21Fix extracting certificate idIwona Klimaszewska1-7/+6
std::strtol() expects null-terminated string. This means that passing string_view.data() to it may cause undefined behaviour. Let's fix it by using boost::convert instead. Tested: Manually by sending valid requests and looking for empty responses. Change-Id: I319277551b5e85586783afdc8c86e4a7d8db876e Signed-off-by: Iwona Klimaszewska <iwona.klimaszewska@intel.com>
2019-11-19Redfish: Set the power capCarol Wang3-69/+241
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
2019-11-19bmcweb: Add IndicatorLED property to sensorsAnthony Wilson1-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>