summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-06-12Update supported ResetTypes and actionsJason M. Bills1-45/+79
This updates the supported ResetType options and triggers the corresponding state change request on DBus. Tested: Used Postman to send POST commands with various ResetType values and confirmed the appropriate response: ForceOff: System forced off ForceOn: System powered-on ForceRestart: System reset forced GracefulRestart: System gracefully shut down followed by a power-on GracefulShutdown: System gracefully shut down Nmi: Not supported: On: System powered-on PowerCycle: System forced off followed by a power-on PushPowerButton: Not supported Change-Id: Id672b154968fa46c540272c1af6709b04770a849 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-06-10Redfish: Correct PATCH for IPv6 static addressesJohnathan Mantey1-12/+4
Manipulating IPv6 static addresses works the same way as IPv4 static addresses. Keep the IPv6StaticAddresses collection, and remove write access from the read-only IPv6Addresses collection. Change-Id: If58c858c676f7ae843e0642800a4083c5df79d1d Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
2019-06-07Fix for Certificate Signature validation failureJayanth Othayoth1-1/+1
Resolves openbmc/bmcweb#82 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com> Change-Id: I944c1f9afe03ca58f61fdde34f83f092ff8d8ab2
2019-06-06Support Processors and its collection for ProcessorType AcceleratorAlpana Kumari1-13/+91
Interface- phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/ Inventory/Item/Accelerator.interface.yaml Redfish schema Status/state is mapped to two properties- Functional and Present xyz.openbmc_project.State.Decorator.OperationalStatus xyz.openbmc_project.Inventory.Item Tested: -- ran Redfish-Service-Validator, All 6 GPUs shows Success -- ran GET on Processors Collection curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/system/Processors { "@odata.context": "/redfish/v1/$metadata#ProcessorCollection.ProcessorCollection", "@odata.id": "/redfish/v1/Systems/system/Processors/", "@odata.type": "#ProcessorCollection.ProcessorCollection", "Members": [ { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0" }, { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu1" }, { "@odata.id": "/redfish/v1/Systems/system/Processors/gv100card0" }, { "@odata.id": "/redfish/v1/Systems/system/Processors/gv100card1" }, { "@odata.id": "/redfish/v1/Systems/system/Processors/gv100card2" }, { "@odata.id": "/redfish/v1/Systems/system/Processors/gv100card3" }, { "@odata.id": "/redfish/v1/Systems/system/Processors/gv100card4" }, { "@odata.id": "/redfish/v1/Systems/system/Processors/gv100card5" } ], "Members@odata.count": 8, "Name": "Processor Collection" curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/system/Processors/gv100card0 { "@odata.context": "/redfish/v1/$metadata#Processor.Processor", "@odata.id": "/redfish/v1/Systems/system/Processors/gv100card0", "@odata.type": "#Processor.v1_3_1.Processor", "Id": "gv100card0", "Name": "Processor", "ProcessorType": "Accelerator", "Status": { "Health": "OK", "State": "Absent" } Change-Id: I5315df80d88d3a04de4b62435a200a718a10cd4c Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
2019-06-06Redfish(Network): Add support for IPv6Addresses and IPv6StaticAddressesRavi Teja1-60/+445
Added GET support for IPv6Addresses Added GET and PATCH support for IPv6StaticAddresses Tested by: GET PATCH -D patch.txt -d '{"IPv6StaticAddresses": [{"Address": "2002:905:150e:301:72e2:84ff:fe14:222","PrefixLength": 64}]}' PATCH -D patch.txt -d '{"IPv6StaticAddresses": [{},{"Address": "2002:905:150e:301:72e2:84ff:fe14:333","PrefixLength": 64}]}' PATCH -D patch.txt -d '{"IPv6StaticAddresses": [null,{},{"Address": "2002:905:150e:301:72e2:84ff:fe14:444","PrefixLength": 64}]}' PATCH -D patch.txt -d '{"IPv6StaticAddresses": [{"Address": "2002:905:150e:301:72e2:84ff:fe14:555","PrefixLength": 64},{}]}' PATCH -D patch.txt -d '{"IPv6StaticAddresses": [{},{"Address": "2002:905:150e:301:72e2:84ff:fe14:666"}]}' PATCH -D patch.txt -d '{"IPv6StaticAddresses": [{},{"PrefixLength": 64}]}' Tested with validator and no errors. Change-Id: I7d1314a0c7843aae8425d66119f0d205a5cfac55 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
2019-06-06bmcweb: Fix sensor name identification methodRichard Marian Thomaiyar1-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>
2019-06-05Add inventory added and removed to registryJames Feist1-0/+34
Add registry entries to aid parsing logs. Tested: Removed entity manager persistence file and got logs like the following: { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/#1557855925", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2019-05-14T17:45:25+00:00", "EntryType": "Event", "Id": "1557855925", "Message": "F1UL16RISER1 Board with serial number BQWK63400247 was installed.", "MessageArgs": [ "F1UL16RISER1", "Board", "BQWK63400247" ], "MessageId": "OpenBMC.0.1.InventoryAdded", "Name": "System Event Log Entry", "Severity": "OK" } Change-Id: Id111872121b47395335d8c9e118dc6809a1b7574 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-06-05Add basic PowerControl and PowerLimit propertiesEddie James2-4/+175
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
2019-05-31Update fan added / removed to use stringJames Feist1-5/+5
Fan names aren't always fan %d, sometimes there are numbers too, or identifiers like CPU Fan 1. Change the argument to a string. Tested: Launched bmcweb and saw: { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/#1556037042", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2019-04-23T16:30:42+00:00", "EntryType": "Event", "Id": "1556037042", "Message": "Fan 1 removed.", "MessageArgs": [ "Fan 1" ], "MessageId": "OpenBMC.0.1.FanRemoved", "Name": "System Event Log Entry", "Severity": "OK" }, { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/#1556037055", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2019-04-23T16:30:55+00:00", "EntryType": "Event", "Id": "1556037055", "Message": "Fan 1 inserted.", "MessageArgs": [ "Fan 1" ], "MessageId": "OpenBMC.0.1.FanInserted", "Name": "System Event Log Entry", "Severity": "OK" }, Change-Id: Ic0d07ea1c96ee6a61caa912ecd091c2783f1d963 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-05-30Fix DBUS Name For BootSource CdSantosh Puranik1-2/+2
Commit 9f16b2c1b6b6884482bca304fcaa573caf91d0d6 changed the mapping for redfish boot source 'Cd' to 'xyz.openbmc_project.Control.Boot.Source.Sources.DVD'. However, that mapping does not match what we have in phosphor-dbus-interfaces: 'xyz.openbmc_project.Control.Boot.Source.Sources.ExternalMedia' This commit reverts that mapping back to ExternalMedia. Tested: -- Ran redfish service validator - no errors seen. -- Tested PATCH on BootSourceOverrideTarget with value "Cd" curl -k -H "X-Auth-Token: $bmc_token" -X PATCH https://${bmc}:${port}/redfish/v1/Systems/system -d '{"Boot": {"BootSourceOverrideEnabled": "Continuous", "BootSourceOverrideTarget": "Cd"}}' { "@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" } ] curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}:${port}/redfish/v1/Systems/system { "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem", "@odata.id": "/redfish/v1/Systems/system", .... .... .... "Boot": { "BootSourceOverrideEnabled": "Continuous", "BootSourceOverrideMode": "Legacy", "BootSourceOverrideTarget": "Cd", "BootSourceOverrideTarget@Redfish.AllowableValues": [ "None", "Pxe", "Hdd", "Cd", "Diags", "BiosSetup" ] }, Change-Id: Ibd1fe3bc2c98dc97422b8dd71f9f95f6e9e25285 Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
2019-05-30[Redfish] Fixed PATCH behavior of IndicatorLED in ComputerSystemJennifer Lee1-6/+3
Patching IndicatorLED to "Lit" was not working. Also modified the response code to 204 no-content for successful PATCH request. Tested: PATCH /redfish/v1/Systems/system HTTP/1.1 { "IndicatorLED": "Lit" } Response: 204 No Content GET /redfish/v1/Systems/system HTTP/1.1 Response: { "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem", "@odata.id": "/redfish/v1/Systems/system", "@odata.type": "#ComputerSystem.v1_6_0.ComputerSystem", "Actions": { "#ComputerSystem.Reset": { "ResetType@Redfish.AllowableValues": [ "On", "ForceOff", "GracefulRestart", "GracefulShutdown" ], "target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset" } }, "Boot": { "BootSourceOverrideEnabled": "Disabled", "BootSourceOverrideMode": "Legacy", "BootSourceOverrideTarget": "None", "BootSourceOverrideTarget@Redfish.AllowableValues": [ "None", "Pxe", "Hdd", "Cd", "Diags", "BiosSetup" ] }, "Description": "Computer System", "Id": "system", "IndicatorLED": "Lit", "LogServices": { "@odata.id": "/redfish/v1/Systems/system/LogServices" }, "Memory": { "@odata.id": "/redfish/v1/Systems/system/Memory" }, "MemorySummary": { "Status": { "State": "Disabled" }, "TotalSystemMemoryGiB": 0 }, "Name": "Computer System", "PowerState": "On", "ProcessorSummary": { "Count": 4, "Model": "Intel Xeon processor", "Status": { "State": "Enabled" } }, "Processors": { "@odata.id": "/redfish/v1/Systems/system/Processors" }, "Status": { "State": "Enabled" }, "SystemType": "Physical", "UUID": "13876882-7708-4200-bcf2-2c5681218bc8" } Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Change-Id: I8ae152190ee9f122e8580903a9d5e687b2fd9e13
2019-05-30REST: PUT: return DBus error descriptionLei YU1-1/+2
The boost::system::error_code returned by the DBus call will contain the DBus error name and description in its error_category, use the category's name and message as REST API's description and message. Tested: Verify the REST API output when trying to set host time while the settings does not allow that: $ curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X PUT -d '{"data": 1436655598435272}' https://$bmc/xyz/openbmc_project/time/bmc/attr/Elapsed { "data": { "description": "xyz.openbmc_project.Time.Error.NotAllowed" }, "message": "The operation is not allowed", "status": "error" } Resolves openbmc/bmcweb#83 Change-Id: I90c11c0fc61e55329c809ecb5f948ae041a579d0 Signed-off-by: Lei YU <mine260309@gmail.com>
2019-05-30[Redfish] Enable PATCH for DHCPv4 properties in EthernetInterface schemaJennifer Lee1-1/+86
DHCPv4 were read-only properties, this code change make following properties to be PATCHable: - DHCPEnabled - UseDNSServers - UseDomainName - UseNTPServers Tested: 1. Check DHCPv4 properties value GET /redfish/v1/Managers/bmc/EthernetInterfaces/<ethID> HTTP/1.1 Response: { ...... "DHCPv4": { "DHCPEnabled": true, "UseDNSServers": true, "UseDomainName": true, "UseNTPServers": true }, ...... } 2. PATCH DHCPv4 PATCH /redfish/v1/Managers/bmc/EthernetInterfaces/eth1 HTTP/1.1 { "DHCPv4": { "DHCPEnabled":false, "UseDNSServers": false, "UseDomainName": false, "UseNTPServers": false } } 3. Check whether DHCPv4 properties are set GET /redfish/v1/Managers/bmc/EthernetInterfaces/<ethID> HTTP/1.1 Response: { ...... "DHCPv4": { "DHCPEnabled": false, "UseDNSServers": false, "UseDomainName": false, "UseNTPServers": false }, ...... } Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Change-Id: I125029ae4cdef329edabd18f6aa6a16db6e27d3d
2019-05-30Add security headers to websocketsEd Tanous1-4/+15
websocket connections are by definition temporal, and cannot be cached. Unfortunately, certain security scanners don't see it that way, and flag errors on lack of CSP, XSS, and Content-Type headers when giving a websocket upgrade response. This commit adds the: Strict-Transport-Security Pragma Cache-Control Content-security-policy X-XSS-Protection X-Content-Type-Options Headers to the response when an upgrade occurs, to make the security scanners happy. Tested: Opened the main application, obseved the /subscribe api. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: If76dc54f6501b3eb2caf44913d254a8b32d3fd30
2019-05-30Add ClearLog support for the Redfish Event Log ServiceJason M. Bills2-0/+56
This change adds support for the LogService.ClearLog action to clear the Redfish Event Log. Tested: 1. Added entries to the EventLog 2. Sent the ClearLog action using Postman: /redfish/v1/Systems/system/LogServices/EventLog/Actions/LogService.ClearLog 3. Confirmed that the EventLog was empty 4. Added entries to the EventLog 5. Confirmed that the new entries logged successfully Change-Id: I6ac4ea4aff8d7defbea693a2c8a755a712fb39a6 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-05-29Fix a trailing slash on LogServicesEd Tanous1-2/+2
Redfish takes a not-so-strong opinion on trailing slashes, and while they're kind of allowed, the validator does mention them. This fixes the URI endpoint to not contain a slash. Tested: Ran redfish service validator, and observed no new errors. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I697f99e17fd4564f5f9648b972a1168de78c271d
2019-05-29Set GraphicalConsole to enabledSantosh Puranik1-4/+4
This commit sets GraphicalConsole's ServiceEnabled property to true. The ConnectTypesSupported is set to KVMIP. Tested: -- Ran redfish service validator. No errors seen. Manager.v1_0_0.Manager:GraphicalConsole value: OrderedDict([('ConnectTypesSupported', ['KVMIP']), ('ServiceEnabled', True)]) <class 'collections.OrderedDict'> has Type: Manager.v1_0_0.GraphicalConsole complex is Optional ***going into Complex Manager.v1_0_0.GraphicalConsole:ConnectTypesSupported value: ['KVMIP'] <class 'list'> has Type: Collection(Manager.v1_0_0.GraphicalConnectTypesSupported) enum is Optional permission OData.Permission/Read is Collection Success -- GET on the manager shows the newly added properties. curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}:${port}/redfish/v1/Managers/bmc { "@odata.context": "/redfish/v1/$metadata#Manager.Manager", "@odata.id": "/redfish/v1/Managers/bmc", .... .... "GraphicalConsole": { "ConnectTypesSupported": [ "KVMIP" ], "ServiceEnabled": true } .... .... Change-Id: I169b581b7dd6b2cef96a2a3eb5f2ce3b1089c8b4 Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
2019-05-24Redfish: Move checkDbusPathExist function to dbus utilityRatan Gupta2-18/+18
This function is a utility function which would be needed by other files. TestedBy: ran the redfish validator: PASS Change-Id: I2a0d07f264952f47a724da11f72b15ca5e019d62 Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
2019-05-24Redfish(Account): Support the patch for individual properties for LDAPRatan Gupta1-0/+477
This commit supports the patch of individual properties under LDAP. Tested by: Ldap Config not exist 1) Run the redfish validator tool 2) PATCH the authentication, auth type, username property Keep getting the message what is missing. 3) PATCH with all the required properties. Ldap Config Exist 4) Run the redfish validator tool 5) PATCH the service address property 6) PATCH Auth type, account providertype 7) PATCH user name 8) PATCH multiple properties Detailed test reults are at the following location https://pastebin.com/ibX5nyAc Change-Id: Ib09c7765f86f626d3b74b5ba7a3e7a97cedb4acf Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
2019-05-24Redfish: Populate the LDAP property in AccountService schemaRatan Gupta1-1/+181
With this commit get request on account service gets the LDAP/AD configuration. RemoteRoleMapping under LDAP property will be supported by other commit. TestedBy: 1) Run the redfish - validator => when there is no LDAP configuration => After LDAP Configuration. 2) GET request through redfish /redfish/v1/AccountService Detailed test cases are at the following location. https://pastebin.com/ibX5nyAc Change-Id: I718d1eb4b40d3a626440487ac9a63d8c96721cee Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
2019-05-24PID: Add fan profile supportJames Feist2-266/+601
This adds fan profiles to redfish. This uses the Thermal Mode interface to allow switching between different fan profiles. Only the selected fan profile will be seen. When adding a new controller, they will also be added to the configuration item for that profile. Patching of the profile to switch between supported profiles is also supported. Tested: Could change profiles in redfish. Python test script: def testProfile(): a = { "Oem": { "OpenBmc": { "Fan": { "Profile" : "Acoustic" } } } } return a def dopatch(): resp = requests.patch(address, json=testProfile(), verify=False, auth=("root", "0penBmc")) resp.raise_for_status() Change-Id: Ie2d8582616ed5bde58e3328b21ba8c59437e88ce Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-05-23[Redfish] Add OCP required properties for ChassisJennifer Lee2-1/+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
2019-05-21vm_websocket: Add websocket handlerAdriana Kobylak3-0/+227
On receiving a websocket request on endpoint /vm/0/0, connect to the nbd-proxy app and send/receive stdio. Tested: Verified that the host could see the virtual media usb device, mounted it manually and checked the contents of the iso file used for the test were there. To test, used the html and js script: https://github.com/openbmc/jsnbd/tree/master/web and an Ubuntu iso image file. Verified that it worked after closing the websocket (using the stop function from the html file), to check that the processes were cleaned up and freed up for a subsequent request. Change-Id: I0b070310b070c086d67d0ae3e2c165551d6b87cc Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2019-05-21Fix 404 handling in Redfish EthernetInterfacesEd Tanous1-16/+40
Previously, when a user requested a network interface that was non-sensical, like: /redfish/v1/Managers/bmc/EthernetInterfaces/foobar/VLANs OR /redfish/v1/Managers/bmc/EthernetInterfaces/foobar They would be presented with a 200-OK, and a partially filled in object. While this doesn't matter much for the casual redfish user, who uses the collection to properly enumerate devices, this causes an issue with security scanners, which think they've found some vulnerability when they can throw whatever injection text they want to in the message, and it shows up in the response. This patchset corrects this, and causes the urls referenced above to properly return 404, and the appropriate "ResourceNotFound" error message. Tested: Attempted both URLs shown above. Both return 404. Ran redfish service validator, observed no errors related to EthernetInterface, or sub nodes. Attempted good URLs, and observed no change to the payload. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Idb2758858d4dbaf421c0cef28b1d5d02402e0ad8
2019-05-13Redfish: Fix managers UUID mixupEd Tanous2-3/+7
In redfish, there are 3 UUIDs. 1. Service root. This is unique to Redfish, and not needed outside the service. It is generated on first startup, and persisted to nonvolatile in the bmcweb_persistent_data.json file. This is the one that is present in the ServiceRoot schema, as well as in the Systems schema under the ServiceEntryPointUUID. 2. Managers. This UUID needs to match the UUID avaialble in IPMI, using the Get Device GUID command. This is generated via the systemd sd_id128_get_machine_app_specific call, with a matching application ID in ipmi. 3. System. This UUID is generated from teh host system. In the case of Power, it comes from settingsd. In the case of x86, it comes from MDRv2. This patchset corrects a few properties to pull from the correct place, after some regressions in the last few weeks that weren't caught right away. Vernon has an oncoming patch to IPMI to correct the IPMI side of this. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I98f3a06ba552c84142aaa749cfd199541a0ae1fd
2019-05-10Improve Redfish log entry parsingJason M. Bills1-9/+25
This change makes the log entry parsing more robust by checking only for the first space to get the timestamp instead of splitting on all spaces. Tested: Added log entries using sensor override and confirmed that all of them can be correctly displayed in the EventLog LogService. Change-Id: Ic0374f6bf8d5ec052dae84b36ab48d16041c614f Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-05-10[Redfish] Fix incorrect mapping of dbus and Redfish API strings for BootSourceJennifer Lee1-2/+11
- "Cd" should be mapped to "xyz.openbmc_project.Control.Boot.Source.Sources.DVD" - Adding mapping "Usb" to "xyz.openbmc_project.Control.Boot.Source.Sources.Removable" Tested: PATCH /redfish/v1/Systems/system HTTP/1.1 { "Boot": { "BootSourceOverrideTarget": "Cd" (or "Usb") } } Response: { "@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" } ] } GET /redfish/v1/Systems/system HTTP/1.1 Response: ... Boot: { ... "BootSourceOverrideTarget": "Cd", (or "Usb") ... } ... Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com> Change-Id: Ib5f69fe93d45b4012c089bd48e484ef978a4e57a
2019-05-10Redfish: Make sensor names more friendlyEd Tanous1-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
2019-05-10Redfish: fix warning in validatorEd Tanous2-87/+87
The validator gives warnings like: URI acquired ends in slash: /redfish/v1/JsonSchemas/Zone These warnings don't actually result in warnings, because the trailing slash has always been a question in the spec, but we might as well do it correctly, even if most of the tools don't take an issue with it. Tested: Ran service validator, saw no new failures, and observed no errors mentioned above. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I184422d7a14838339253c945d7a0c91878093e17
2019-05-09Redfish(Network): Implemented PATCH of Nameservers arrayRAJESWARAN THILLAIGOVINDAN1-2/+11
Testing: "NameServers": [], "NameServers@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The property NameServers is a read only property and cannot be assigned a value.", "MessageArgs": [ "NameServers" ], "MessageId": "Base.1.4.0.PropertyNotWritable", "Resolution": "Remove the property from the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ] Change-Id: I12b8cb0ad9b8ad83371ee1d834f38e7537cc7b61 Signed-off-by: RAJESWARAN THILLAIGOVINDAN <rajeswgo@in.ibm.com>
2019-05-09simpleupdate: Move code around for future re-useAndrew Geissler1-140/+143
A lot of the existing code for the UpdateService path can be used for SimpleUpdate. Move the common code into static functions so that both paths can call them. Tested: Verified good path code update still works against UpdateService Change-Id: Ie69b2bdc7b286b9d0596a2ca193810270a3f7dbb Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2019-05-09Redfish: Remove BMCWEB_ENABLE_REDFISH_ONE_CHASSISShawn McCarney7-122/+3
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>
2019-05-09Acquire chassis sensors using the sensor association DBus itemJohnathan Mantey4-173/+304
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>
2019-05-08Use syslog for Redfish messagesJason M. Bills1-140/+131
Limitations were discovered after the journal was made persistent that reduce the benefits of using it directly for persistent event logs. As an alternative, we will leave the journal volatile and use rsyslog to persist only the event logs. This change switches to the syslog files for Redfish event messages instead of looking directly in the journal. Tested: Navigated to "/redfish/v1/Systems/system/LogServices/EventLog/Entries" and confirmed that all of the stored Event Log Entries are returned. Change-Id: Ib0aebda68eb95bb171fccd208350c3d073787a13 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-05-08Construct Redfish messages using the Message RegistryJason M. Bills1-19/+72
Instead of using the message and severity from the journal, this change allows Redfish to search for the MessageId in the Message Registries to construct the message. This will provide more accurate Redfish messages and severities since they come from a single source. Tested: Logged Redfish events using new MessageIds and confirmed that the correct message from the Message Registry is displayed rather than the message from the journal. Change-Id: I294593647998c988b36ffccaf95a69cbeab3f92e Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-05-08Remove the static OpenBMC Message Registry fileJason M. Bills5-143/+1334
This change removes the static OpenBMC Message Registry file and replaces it with a compile-time structure. Tested: Verified the OpenBMC Message registry is correctly returned from the existing endpoints without using the static files. Change-Id: I60ab3ce0d23c9ac7e91ebb85f445fb9ca731983d Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-05-08Parse Message Registry header info from the fileJason M. Bills4-14/+56
This extends the Message Registry parsing to include header details that are part of the redfish resource. Tested: Verified that the MessageRegistry info all returns correctly in the redfish response. Change-Id: I6179c07f4067cd4520fce3e774d18530fede0a95 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-05-08Remove the static Base Message Registry fileJason M. Bills8-579/+1268
This change removes the static Base Message Registry file and replaces it with a compile-time structure. A script is used to pull the Base Message Registry file from the DMTF and parse it into the .hpp structure. Tested: Verified that after running the script, I can get the same Redfish data back from the existing endpoints without using the static files. Change-Id: Ide3c61ecff62801c06619d5c3edc2229c945d8e7 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-05-04Fix OemManager schema for profilesJames Feist2-41/+97
Make schema pass validator. Found quite a few missing fields and odata.id issues. Tested: Passes validator Change-Id: Ibba92018d07a2a9f2ba833c295a235fee7845a97 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-05-02bmcweb: /s/boost::beast::string_view/std::string_view/gAdriana Kobylak4-33/+33
Follow-on to https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/18891 Tested: Checked that the host console and virtual media endpoints still worked as expected. Change-Id: Ifdc5f21f3668bdf9bd24189504aaeb17b232c921 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2019-05-02Redfish: Supporting ServiceRootUUID field for ↵Bernard Wong3-23/+58
/redfish/v1/Managers/{ManagerId}schema - Created a common utiity file called, systemd_utils.hpp to hold the function getUuid. - Added json field support for ServiceEntryPointUUID field to retrieve it from system_utils.hpp. - Amended the header file, service_root.hpp to get the uuid from the newly created system_utils.hpp file. Changes tested with QEMU emulator and Witherspoon image => Passed Redfish Validator => Passed Change-Id: If7f2aba49942a0b315fb012da29af194ebd0ea6f Signed-off-by: Bernard Wong <trials13@hotmail.com>
2019-04-30Redfish(Network): Implement IPv6DefaultGateway supportRavi Teja1-1/+22
Added GET support for IPv6DefaultGateway.its read only property On Patch operation display "PropertyNotWritable" message. Tested by: GET PATCH -D patch.txt -d '{"IPv6DefaultGateway": "fe80::226:88ff:feac:8401"}' Tested with validator and no errors. Change-Id: Ib67234496b70ec53508a9be36cd86c1859b5d895 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
2019-04-26Fix empty IPV4 gateway errorGunnar Mills1-1/+8
If an IPV4 gateway is empty use "0.0.0.0". The RedfishServiceValidator throws the following error on a Witherspoon system: "IPv4Addresses[0].Gateway: String '' does not match pattern ''^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$''" Tested: Ran RedfishServiceValidator and no longer observe the error. IPV4 addresses with gateways are untouched. Change-Id: I423aeeb0bec46fa5cc0c8cf5a017c16d20314984 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2019-04-24CMakeLists.txt: Remove BOOST_ASIO_NO_DEPRECATEDAdriana Kobylak1-1/+2
Comment out the BOOST_ASIO_NO_DEPRECATED flag until Yocto moves to Boost 1.70 (currently at 1.69), since it breaks boost/process.hpp which is used for the Virtual Media enpoint. Reference: - https://github.com/boostorg/process/issues/29 - https://github.com/boostorg/process/pull/67 Tested: Verified that the virtual media commit that includes boost/process.hpp compiles and the interface still works as expected. Change-Id: Iffc53c260a44947a0891822ec00a1562849e7ae2 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2019-04-24crow: websocket: Increase input buffer sizeAdriana Kobylak1-1/+1
Increase the websocket input buffer size to support virtual media. The max network block device buffer size is 128kb plus 16bytes for the message header: https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md#simple-reply-message Change-Id: I6d6a95855f8c86f795532b8294d6189f3b766ece Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2019-04-22Change application and interface names to CrashdumpJason M. Bills3-63/+67
Crashdump is the preferred name, so replace all uses of CPU Log with Crashdump. Tested: On-demand crashdump functions correctly Change-Id: I6cf8fb81bc8f2e85dd4a3561835f3fafbff764e5 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
2019-04-22Add systemd unit filesBrad Bishop3-0/+35
Add bmcweb.socket, a systemd unit file that enables systemd socket activation of bmcweb. Systemd socket activation defers startup of socket listening applications until something connects to the socket. There are presently no configurable parameters in bmcweb.socket. Add bmcweb.service, a systemd unit file for starting bmcweb. bmcweb.service has one configurable parameter, the installation prefix. Prior these unit files were hosted in the meta-phosphor repository but OpenBMC is moving away from unit-files-in-metadata and trying to do it the way the rest of the world does it - unit files are provided by the projects that contain the application source. The unit files were copied mostly verbatim (minor update for installation prefix in bmcweb.service template) so the only new logic here is in the cmake logic. Tested by: 1 - devtool add bmcweb. 2 - apply this diff to bmcweb_git.bb: -inherit obmc-phosphor-systemd +inherit systemd 3 - bitbake bmcweb. 4 - manual inspection of the image dir in the yocto build tree. Change-Id: I61b49d519f5b4eb06e97a14d4f6707344e544434 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
2019-04-15Remove references to experimental filesystemJames Feist4-19/+3
We're at CPP17 everywhere now, no need to keep the experimental refrerence. Tested: It builds Change-Id: I5f6571eb411bf055e9715f7d96d1be5a3cb2e119 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-04-11fw-update: Support host image updateAndrew Geissler1-50/+92
Per the Redfish schema for the UpdateService, it supports all SoftwareInventory targets. On OpenBMC this is currently the BMC and the Host (BIOS) firmware. Introduced a new fwUpdateInProgress static variable so that the signal subscription could be disabled once the required interface was added. This prevented multiple call backs and multiple activations of the same image. Tested: Verified that a host and BMC image update worked as expected on a witherspoon system. $ curl -k -H "X-Auth-Token: $TOKEN" -H "Content-Type: application/octet-stream" -X POST -T ./obmc-phosphor-image-witherspoon.ubi.mtd.tar https://${BMC_IP}/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" } ] } Change-Id: I7bb9381f1b79bf65604464b628ef98646951d840 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2019-04-11fw-inventory: Add RelatedItem to inventoryAndrew Geissler1-0/+27
Added TODO reference for BIOS reference. This commit is required: https://gerrit.openbmc-project.xyz/#/c/openbmc/bmcweb/+/16775/ Tested: VERBO - SoftwareInventory.v1_1_0.SoftwareInventory:RelatedItem VERBO - value: [OrderedDict([('@odata.id', '/redfish/v1/Managers/bmc')])] <class 'list'> VERBO - has Type: Collection(Resource.Item) entity VERBO - is Optional VERBO - permission OData.Permission/Read VERBO - is Collection VERBO - Success curl -k -H "X-Auth-Token: $TOKEN" -X GET https://${BMC_IP}/redfish/v1/UpdateService/FirmwareInventory/969635f8 { "@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/969635f8", "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory", "Description": "BMC update", "Id": "969635f8", "Members@odata.count": 1, "Name": "Software Inventory", "RelatedItem": [ { "@odata.id": "/redfish/v1/Managers/bmc" } ], "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" }, "Updateable": false, "Version": "2.6.0-rc1-312-g8d6abcd6d" } With the TODO code un-commented, this is the output: curl -k -H "X-Auth-Token: $TOKEN" -X GET https://${BMC_IP}/redfish/v1/UpdateService/FirmwareInventory/ace821ef { "@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory", "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/ace821ef", "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory", "Description": "Host update", "Id": "ace821ef", "Members@odata.count": 1, "Name": "Software Inventory", "RelatedItem": [ { "@odata.id": "/redfish/v1/Systems/system/BIOS" } ], "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Enabled" }, "Updateable": false, "Version": "IBM-witherspoon-OP9-v2.0.10-2.22" } Change-Id: Iae563a938532c6f53f41c8fc5c758693155be1a0 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>