summaryrefslogtreecommitdiff
path: root/redfish-core
AgeCommit message (Collapse)AuthorFilesLines
2020-06-30Add Crashdump.Telemetry interface and triggerKenny L. Ku2-2/+79
Tested: - Sent post requests Crashdump.OnDemand & Crashdump.Telemetry and correct trigger is received in crashdump application. - Redfish validator is run successfully. Signed-off-by: Kenny K. Ku <kenny.k.ku@intel.com> Change-Id: Ie0f49d3230aeb4450e11dfa2d46e309946763a6a
2020-06-29openbmc_message_registry: update failure reason in FirmwareUpdateFailedChalapathi Venkataramashetty1-3/+3
Update the failure reason in FirmwareUpdateFailed redfish message entry. Tested: 1. Update the corrupted image so that fw update fails. POST: https://<BMC_IP>/redfish/v1/UpdateService/ with <Corrupted_Update_Capsule> binary file Check event logs in redfish. Command: GET: https://<BMC_IP>/redfish/v1/Systems/system/LogServices/ EventLog/Entries Response: { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1591111739", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-06-02T15:28:59+00:00", "EntryType": "Event", "Id": "1591111739", "Message": "BMC firmware update to version 00.59 started.", "MessageArgs": [ "BMC", "00.59", "" ], "MessageId": "OpenBMC.0.1.FirmwareUpdateStarted", "Name": "System Event Log Entry", "Severity": "OK" }, { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1591111742", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-06-02T15:29:02+00:00", "EntryType": "Event", "Id": "1591111742", "Message": "BMC firmware update to version 00.59 failed: due to image verification error.", "MessageArgs": [ "BMC", "00.59", "due to image verification error" ], "MessageId": "OpenBMC.0.1.FirmwareUpdateFailed", "Name": "System Event Log Entry", "Severity": "Warning" }, Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com> Change-Id: I79e9509f129a3b87fb21e961e7b7bd78809ca1e2
2020-06-29Fix: Replace span with vectorAppaRao Puli1-10/+7
The message args in the event service data is coming empty and also crashing bmcweb when multiple arguments present. The boost::beast::span has issue in passing it as reference to function for assignment. Replaced span with std::vector to avoid empty response to caller function. Tested: - All message arguments are working fine and resolved crash. Change-Id: I800247cfd0d5dba7698cdb3e60c1290e478bf3ac Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-06-29EventService: Add inotify on dir for event logAppaRao Puli1-15/+91
Redfish event log file (/var/log/redfish) may or may not exist while starting bmcweb. Also when event logs are cleared this file will be removed and rsync service will create it again. To handle above cases, Added inotify on /var/log/ directory. This directory watch will handle create/delete of log file and add/remove watch on event log file. Tested: - Removed event log file, re-started the bmcweb and did Ac cycle. Works fine. - Started bmcweb with existing event log file. - Verified the functionality by doing removal(clear event log) and creation of redfish event log file during run time. Change-Id: I6a6c48cf4a410ed6f11d73dae8484d4c21d01e37 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-06-29Revert "Revert "EventService: Add event log support with inotify""AppaRao Puli1-1/+457
This reverts commit 29d2a95ba12f8b5abed040df7fd59790d6ba2517. Enable EventService back by fixing issue with not having '/var/log/redfish' file. Fix is at: https://gerrit.openbmc-project.xyz/#/c/openbmc/bmcweb/+/33639/ Tested: - Along with above mentioned change, removed '/var/log/redfish' file and restarted bmcweb. It works. Change-Id: Ia908bbdf5b9a643afee212a526074f62372208dc Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-06-27Update Service: Change error message based on error logsJames Feist4-3/+112
THis adds support for better error responses based on the logs generated by phosphor-software-manager. Tested: Got 400 error with different messages based on failure type { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid archive.", "MessageArgs": [ "/redfish/v1/UpdateService", "invalid archive" ], "MessageId": "OpenBMC.0.1.0.InvalidUpload", "Resolution": "None.", "Severity": "Warning" } ], "code": "OpenBMC.0.1.0.InvalidUpload", "message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid archive." } } { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid image format.", "MessageArgs": [ "/redfish/v1/UpdateService", "invalid image format" ], "MessageId": "OpenBMC.0.1.0.InvalidUpload", "Resolution": "None.", "Severity": "Warning" } ], "code": "OpenBMC.0.1.0.InvalidUpload", "message": "Invalid file uploaded to /redfish/v1/UpdateService: Invalid image format." } } { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "The resource /redfish/v1/UpdateService was unable to satisfy the request due to unavailability of resources.", "MessageArgs": [ "/redfish/v1/UpdateService" ], "MessageId": "Base.1.4.0.ResourceExhaustion", "Resolution": "Ensure that the resources are available and resubmit the request.", "Severity": "Critical" } ], "code": "Base.1.4.0.ResourceExhaustion", "message": "The resource /redfish/v1/UpdateService was unable to satisfy the request due to unavailability of resources." } } Change-Id: Ida9a23c10aedbf9a48c96f4050a04e06bddff284 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-06-26Enable retrieving mapping of Redfish URI to D-Bus sensor pathAdrian Ambrożewicz3-46/+179
Background: Change is necessary to support TelemetryService implementation. TelemetryService specifies its own resource type for data - MetricDefinition. In principle - MetricDefinition might point to Redfish Sensor in the system. Each MetricDefinition requires MetricProperty - URI to specific property in resource wih the value. This change allows retrieving such data alongside corresponding D-Bus sensor to be used as source of Metrics value. This change: Function was implemented to allow retrieving mapping of Redfish URI paths to D-Bus sensors in the system. Some minor refactoring in regards to SensorsAsyncResponse were also introduced to enhance code locality. Idea for the changes was to be the least intrusive if possible, as retrieving sensors in the system requires lots of processing. Existing logic was used and left intact. Utilizing existing logic required to 'fake' a HTTP request to traverse the sensors in the system and build the response. It's crucial to use exact logic of building Redfish nodes representation, as goal of the function is to retrieve exact Redfish URI for sensor value. Extra parameter was introduced to SensorsAsyncResp - callback to be called when sensor data will be fully determined. After processing is complete caller is notified with the outcome (success or failure) and map<URI:D-Bus sensor>. Testing: - all positive cases (3 chassis, 3 subnodes) in the system, one of obtained mappings looked like the following: { /redfish/v1/Chassis/WP_Baseboard/Power#/Voltages/3/ReadingVolts : /xyz/openbmc_project/sensors/voltage/P1V8_PCH } - negative cases (wrong chassis, wrong subnode) - callback with error status was called - RedfishServiceValidator passed Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com> Change-Id: I4389eb3df275126974168d1bb9af33dbf5cdb5b7
2020-06-25Manager: LastResetTimeGunnar Mills1-1/+38
Manager LastResetTime was added in Redfish release 2020.2. It maps to LastRebootTime on D-Bus. LastRebootTime on D-Bus is in epoch time, in milliseconds. Redfish uses the ISO 8601 standard for dates. Will be used on the OpenBMC GUI. Tested: Validator passes. curl -k https://$bmc/redfish/v1/Managers/bmc ... "LastResetTime": "2020-06-23T19:43:24+00:00", Took the epoch time at state/bmc0/attr/LastRebootTime and verified when converted it was the same. GMT: Tuesday, June 23, 2020 7:43:24 PM Change-Id: I55da7ad87ccd6021e4a8e7d522333941afe4084d Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-25Remove done TODOGunnar Mills1-1/+0
ForceRestart support was added here: https://github.com/openbmc/bmcweb/commit/d22c8396f0bcec4488d0c98eae3092384b3a5929 Change-Id: I631d465861fb423b1915f5fcc384b8117adf6bd5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-24Validation enhancement for Hypervisor EthernetInterface update.Sunitha Harish1-1/+8
This commit returns propertyNotWritable error for Hypervisor "IPv4Addresses" parameter. Without this, if the PATCH operation includes this parameter; then bmcweb returns the error as "PropertyUnknown" which is not meaningful. Tested By: PATCH -D patch.txt -d '{"IPv4Addresses": [null]}' https://${bmc}/redfish/v1/Systems/hypervisor/EthernetInterfaces/<intf> { "IPv4Addresses@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "The property IPv4Addresses is a read only property and cannot be assigned a value.", "MessageArgs": [ "IPv4Addresses" ], "MessageId": "Base.1.4.0.PropertyNotWritable", "Resolution": "Remove the property from the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ] } Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Ia3bf142068128ab742864030b867d12e5c2697e0
2020-06-23Redfish: Add chassis resetP.K. Lee2-0/+76
Add chassis reset by using Redfish. Tested: Passed validator. Chassis reset worked. Usage: POST on /redfish/v1/Chassis/chassis/Actions/Chassis.Reset/ { "ResetType": "PowerCycle" } Change-Id: Ia8949e6695e60ee63776ac70e4f8cd85a4b186c3 Signed-off-by: P.K. Lee <p.k.lee@quantatw.com>
2020-06-22Dictionary translating ME Health to Redfish EventsAgnieszka Szlendak1-2/+330
This change follows commit intel-ipmi-oem/31645. Following code adds ME-specific event definitions to OpenBMC Message Registry. Testing: - injected all possible events with busctl call (faking ME) - tested on actual platform with manually triggered events by actual ME Signed-off-by: Agnieszka Szlendak <Agnieszka.Szlendak@intel.com> Change-Id: I36e26fc940d7fd279870504a19c3b37dd64d115e
2020-06-17ipmi: Enable/Disable IPMI-over-LANTom Joseph1-1/+79
This patch adds support for enabling and disabling IPMI-over-LAN using Redfish API. If there are multiple instances of phosphor-ipmi-net service, then the PATCH action applies to all the instances. This patch does not add support for configuring the port of IPMI-over-LAN. Tested: 1) Ran the Redfish Validator. 2) Disabled IPMI-over-LAN from Redfish and verified network IPMI stopped and verified ProtocolEnabled is false for IPMI. 3) Enabled IPMI-over-LAN from Redfish and verified network IPMI is running and verified ProtocolEnabled is true for IPMI. Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com> Change-Id: Ie9b00c8195bbfea14a69cbe9a73492187e6b4e1c
2020-06-17Fetch the ClientIP during session creationSunitha Harish1-4/+9
This commit saves the IP Address of the client from where the session was created. - This is not a user supplied value. The BMC will internally pull the IP address from the incoming create-session request. - It should also be noted that ClientIP will not change if the same session token is used from some other IP address for further management of the BMC. Tested by: 1. Create session 2. Display the Session details with GET command to check the IP from where the session is created/updated. GET https://${bmc}/redfish/v1/SessionService/Sessions/<id> { "@odata.id": "/redfish/v1/SessionService/Sessions/<id>", "@odata.type": "#Session.v1_0_2.Session", "Description": "Manager User Session", "Id": "<id>", "Name": "User Session", "Oem": { "OpenBMC": { "@odata.type": "#OemSession.v1_0_0.Session", "ClientOriginIP": "<ip address>" } }, "UserName": "root" } 3. Redfish validator is run successfully. Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I0076f260f50a991600ec060c72f3e46fb9a9cbb8
2020-06-17Session creation : Get and Set Oem ClientIDSunitha Harish1-4/+26
This commit implements handling the OemSession ClientID parameter for the IBM management console. Each session gets a random generated unique Id (Resource Id); but this Id is not a parameter that the client can set to a well known identifier. This Oem parameter ClientID is the string which the client can supply to uniquely identify itself among other sessions in the BMC. This is a read-only property which shall be passed in only during the session creation. 1. Create session by supplying the ClientID Oem parameter 2. Display the ClientID associated with the session 3. Persist the ClientID across BMC reboot Tested by: ============ 1. POST https://${bmc}/redfish/v1/SessionService/Sessions -d '{"UserName":"root", "Password":<>, "Oem":{"OpenBMC" : {"ClientID":"<client unique id>"}}}' 2. GET https://${bmc}/redfish/v1/SessionService/Sessions/<id> { "@odata.id": "/redfish/v1/SessionService/Sessions/<id>", "@odata.type": "#Session.v1_0_2.Session", "Description": "Manager User Session", "Id": "<id>", "Name": "User Session", "Oem": { "OpenBMC": { "@odata.type": "#OemSession.v1_0_0.Session", "ClientID": "<client unique id>" } }, "UserName": "root" } 3. Verified the session creation works fine without the Oem parameters. 4. Redfish validator Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Ia740a610e3974dc3781bcee702c74ded9903944a
2020-06-12ManagerAccount: Implement AccountTypesGunnar Mills1-7/+8
Seeing "ERROR - AccountTypes: Mandatory prop does not exist" validator fails. This should not be an error, because bmcweb is using ManagerAccount.v1_3_0 which doesn't have this property. The workaround (implement AccountTypes) improves the code, more information and easier later when moving to a later schema, so bump the ManagerAccount schema and Implement AccountTypes. Taking this issue forward with Redfish. Believe this was introduced in the following Validator commit: https://github.com/DMTF/Redfish-Service-Validator/commit/de71f0388bf85c920ae48deb6b16aed124f4f23b From https://redfish.dmtf.org/schemas/ManagerAccount.v1_6_0.json: "AccountTypes": { "description": "The account types.", "items": { "anyOf": [ { "$ref": "#/definitions/AccountTypes" }, ... "versionAdded": "v1_4_0" }, ... "required": [ "@odata.id", "@odata.type", "Id", "Name", "AccountTypes" ], ... "AccountTypes": { "enum": [ "Redfish", "SNMP", "OEM" ], "enumDescriptions": { "OEM": "OEM account type.", "Redfish": "Allow access to the Redfish Service.", "SNMP": "Allow access to SNMP services." }, "type": "string" Tested: Built and latest validator passes on a Witherspoon. curl -k https://${bmc}/redfish/v1/AccountService/Accounts/root { "@odata.id": "/redfish/v1/AccountService/Accounts/root", "@odata.type": "#ManagerAccount.v1_4_0.ManagerAccount", "AccountTypes": [ "Redfish" ], Change-Id: If48c4b8deb5f199f459858bb2c7469f0ebd44781 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-11clang-format: update to latest from docs repoGunnar Mills27-1202/+1209
This is from openbmc/docs/style/cpp/.clang-format Other OpenBMC repos are doing the same. Tested: Built and validator passed. Change-Id: Ief26c755c9ce012823e16a506342b0547a53517a Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-11Revert "EventService: Add event log support with inotify"James Feist1-457/+1
This reverts commit e9a14131650d30389eaf9dc38a3c32f1cb552f52. Reason for revert: if /var/log/redfish does not exist this causes bmcweb to crash on start Fixes #126 Change-Id: If6ba4717a32d4cd72aa92a9bc9c696d5813b5cac Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-06-10Memory: add health supportJames Feist2-1/+23
This adds health support to dimms. It also updates the health object to look for an individual inventory items health. Tested: Validator passed { "@odata.id": "/redfish/v1/Systems/system/Memory/memory_device11", "@odata.type": "#Memory.v1_6_0.Memory", "CapacityMiB": 129728, "DataWidthBits": 64, "Id": "memory_device11", "Manufacturer": "Intel", "MemoryDeviceType": "xyz.openbmc_project.Inventory.Item.Dimm.DeviceType.Logical", "Name": "DIMM Slot", "PartNumber": "", "SerialNumber": "", "Status": { "Health": "Critical", "HealthRollup": "Critical", "State": "Enabled" } } Change-Id: If2e1450b4228036f00ff78e6484e8da409a8039b Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-06-09Add unit test for the lock managementmanojkiraneda1-0/+356
- The idea behind this commit is to enable the unit test for the lock management algorithm, and below are the unit test cases that are written: Testedby: [----------] 20 tests from locktest [ RUN ] locktest.ValidationGoodTestCase [ OK ] locktest.ValidationGoodTestCase (3 ms) [ RUN ] locktest.ValidationBadTestWithLocktype [ OK ] locktest.ValidationBadTestWithLocktype (1 ms) [ RUN ] locktest.ValidationBadTestWithlockFlags [ OK ] locktest.ValidationBadTestWithlockFlags (0 ms) [ RUN ] locktest.ValidationBadTestWithSegmentlength [ OK ] locktest.ValidationBadTestWithSegmentlength (1 ms) [ RUN ] locktest.MultiRequestWithoutConflict [ OK ] locktest.MultiRequestWithoutConflict (3 ms) [ RUN ] locktest.MultiRequestWithConflictduetoSameSegmentLength [ OK ] locktest.MultiRequestWithConflictduetoSameSegmentLength (2 ms) [ RUN ] locktest.MultiRequestWithoutConflictduetoDifferentSegmentData [ OK ] locktest.MultiRequestWithoutConflictduetoDifferentSegmentData (1 ms) [ RUN ] locktest.MultiRequestWithConflictduetoSameSegmentData [ OK ] locktest.MultiRequestWithConflictduetoSameSegmentData (2 ms) [ RUN ] locktest.MultiRequestWithoutConflictduetoDifferentSegmentLength [ OK ] locktest.MultiRequestWithoutConflictduetoDifferentSegmentLength (1 ms) [ RUN ] locktest.MultiRequestWithoutConflictduetoReadLocktype [ OK ] locktest.MultiRequestWithoutConflictduetoReadLocktype (1 ms) [ RUN ] locktest.MultiRequestWithoutConflictduetoReadLocktypeAndLockall [ OK ] locktest.MultiRequestWithoutConflictduetoReadLocktypeAndLockall (2 ms) [ RUN ] locktest.RequestConflictedWithLockTableEntries [ OK ] locktest.RequestConflictedWithLockTableEntries (6 ms) [ RUN ] locktest.RequestNotConflictedWithLockTableEntries [ OK ] locktest.RequestNotConflictedWithLockTableEntries (3 ms) [ RUN ] locktest.TestGenerateTransactionIDFunction [ OK ] locktest.TestGenerateTransactionIDFunction (1 ms) [ RUN ] locktest.ValidateTransactionIDsGoodTestCase [ OK ] locktest.ValidateTransactionIDsGoodTestCase (3 ms) [ RUN ] locktest.ValidateTransactionIDsBadTestCase [ OK ] locktest.ValidateTransactionIDsBadTestCase (2 ms) [ RUN ] locktest.ValidateisItMyLockGoodTestCase [ OK ] locktest.ValidateisItMyLockGoodTestCase (2 ms) [ RUN ] locktest.ValidateisItMyLockBadTestCase [ OK ] locktest.ValidateisItMyLockBadTestCase (2 ms) [ RUN ] locktest.ValidateSessionIDForGetlocklistBadTestCase [ OK ] locktest.ValidateSessionIDForGetlocklistBadTestCase (3 ms) [ RUN ] locktest.ValidateSessionIDForGetlocklistGoodTestCase [ OK ] locktest.ValidateSessionIDForGetlocklistGoodTestCase (3 ms) [----------] 20 tests from locktest (82 ms total) Signed-off-by: manojkiraneda <manojkiran.eda@gmail.com> Change-Id: Id274ee356adfa7ba03da02d83b609d37c8c99f8d
2020-06-08Add 'utilization' sensor to 'Sensors' pageAdrian Ambrożewicz1-1/+6
Recent change to xyz.openbmc_project.Sensor.Value interface has introduced new type of sensor - 'utilization'. This change makes bmcweb able to expose this kind of sensors in Sensors schema under /Chassis/{}/Sensors. Testing: - implemented simple mocked sensor and verified that: -- sensor appears in /Chassis/{}/Sensors -- sensor values are properly shown in /Chassis/{}/Sensors/{} -- 'ReadingUnits' is shown in /Chassis/{}/Sensors/{} - RedfishServiceValidator passed Change-Id: I9e4dc0b9db049a9815e79a0a64df60f275eeb822 Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
2020-06-05bmcweb: Replace deprecated boost::asio::io_serviceZhenfei Tai1-1/+2
bmcweb will not build when boost library is version 1.71.0. Also fix code format. In CMakeLists.txt 271 if ("${Boost_VERSION}" STREQUAL "107100") 272 add_definitions (-DBOOST_ASIO_NO_DEPRECATED) 273 endif () Signed-off-by: Zhenfei Tai <ztai@google.com> Change-Id: I4ebbf3cfcfd767ea016b4efd19704d25b845f86c
2020-06-04Redfish: Manager: ResetToDefaultGunnar Mills2-1/+83
ResetToDefaults, called factory reset in OpenBMC, was added in 2020.1. Calls BMC code updater factory reset since BMC code updater factory reset wipes the whole BMC read-write filesystem which includes things like the network settings. OpenBMC only supports ResetToDefaultsType "ResetAll". Depends on https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-bmc-code-mgmt/+/32989 Tested: Along with 32989, validator passes and was able to factory reset. curl -k https://$bmc/redfish/v1/Managers/bmc { "@odata.id": "/redfish/v1/Managers/bmc", "@odata.type": "#Manager.v1_8_0.Manager", "Actions": { "#Manager.Reset": { "ResetType@Redfish.AllowableValues": [ "GracefulRestart" ], "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset" }, "#Manager.ResetToDefaults": { "ResetType@Redfish.AllowableValues": [ "ResetAll" ], "target": "/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults" } }, ... curl -k -X POST \ https://${bmc}/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults \ -d '{"ResetToDefaultsType": "ResetAll"}' { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.4.0.Success", "Resolution": "None", "Severity": "OK" } ] } Change-Id: Ia830fd05dc15fd6311f84dff191a3718c645c040 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-06-03log_services: Fix Severity Empty string found issue when running Redfish ↵Tim Lee1-5/+7
Service Validator Symptom: When running Redfish Service Validator, we found that Severity Empty string issue except first post code in PostCodesEntry. *** /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-1 Regetting resource from URI /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-1 Type (#LogEntry.v1_4_0.LogEntry), GET SUCCESS (time: 0) PASS *** /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-2 Regetting resource from URI /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-2 Type (#LogEntry.v1_4_0.LogEntry), GET SUCCESS (time: 0) Severity: Empty string found - Services should omit properties if not supported Severity: Invalid Enum value '' found, expected ['OK', 'Warning', 'Critical'] FAIL... Root cause: In fillPostCodeEntry(), this statement "severity = message->severity" only be executed once. And another statement {"Severity", std::move(severity)} in the end of this function will clear severity string to null after calling std::move() standard function. Thus, only first post code Severity is 'OK', but the others are NULL. Solution: Move this statement "severity = message->severity" to for loop in fillPostCodeEntry() then all post codes will be recorded with correct severity string 'OK'. Tested: Passed the Redfish Service Validator and verified "Severity": "OK" in /redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-2 { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-2", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-04-27T01:48:10+00:00", "EntryType": "Event", "Id": "B1-2", "Message": "Boot Count: 1: TS Offset: 0.0046; POST Code: 0x02", "MessageArgs": [ "1", "0.0046", "0x02" ], "MessageId": "OpenBMC.0.1.BIOSPOSTCode", "Name": "POST Code Log Entry", "Severity": "OK" } Signed-off-by: Tim Lee <timlee660101@gmail.com> Change-Id: Ibfccfa47cfe8e0f58e7f24650871edda5d248674
2020-06-03Fix duplicate NTP servers patchTony Lee1-0/+5
Duplicate NTP servers value should not be patch. Tested: 1. Patch duplicate NTP servers curl -k -H "X-Auth-Token: $bmc_token" -XPATCH https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol -d '{"NTP":{"NTPServers":["9.9.9.9","9.9.9.9","1.1.1.1","9.9.9.9"]}}' 2. GET NTP servers information curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", "@odata.type": "#ManagerNetworkProtocol.v1_5_0.ManagerNetworkProtocol", "Description": "Manager Network Service", "FQDN": "", "HTTP": { "Port": 0, "ProtocolEnabled": false }, "HTTPS": { "Certificates": { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates" }, "Port": 443, "ProtocolEnabled": true }, "HostName": "", "IPMI": { "Port": 623, "ProtocolEnabled": true }, "Id": "NetworkProtocol", "NTP": { "NTPServers": [ "1.1.1.1", "9.9.9.9" ], "ProtocolEnabled": false }, Signed-off-by: Tony Lee <tony.lee@quantatw.com> Change-Id: Idb63cf5e28d36a5df1aae9b0a7d53a1b7a9c8d91
2020-06-02Manager: Refactor Reset ActionGunnar Mills2-58/+54
Updated comment and var name to follow camelCase. Moved doBMCGracefulRestart to common function so could be used by factory reset in later commit. Moved to BMCWEB_LOG_DEBUG. Tested: Passed validator. BMC reboot worked. Change-Id: I019c174c3db625666ab6601d08cd4fa13e9e0274 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-05-29EventService:persistent config & subscription infoAyushi Smriti1-11/+238
This commit is to persist EventService configuration and subscription information across the bmcweb service restart or bmc reboot by reading/writing config store data to the json file (location: /var/lib/bmcweb/eventservice_config.json) and loads this while initializing bmcweb EventService. URI's: /redfish/v1/EventService /redfish/v1/EventService/Subscriptions /redfish/v1/EventService/Subscriptions/<id> Tested: - Validated initialization and reading of config and subscription info from persist store. - Validated updation and writing of config and subscription info to the persist store: - Added new subscription using POST and validated using GET. - Validated delete subscription. - Validated subscription list is persistent after multiple bmc reboots - Verified by GET req on subscription collection and getting specific subscription id's. - Ran redfish validator successfully - Created some subscriptions - Rebooted BMC - Previous subscriptions were intact - Ran validator and verified. Change-Id: I9f044887b0c5b7559be58a6564b04585dc384be2 Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-29Update json helper function - readJsonAppaRao Puli1-37/+131
The json helper functions are currently coupled with response(crow::response) and limiting it to use only while sending response. There are some use cases where we don't send crow::response instead we extract json data from files and load configuration. Decoupled the business logic for validating json key existence, json value type checking and range validation with top level use cases. So this json helper functions can be used for validating json and extracting value from json object during init cases also(Ex: Used in EventService config initialization) Added new API in helper function which checks key existence, value is of desired Type and value is in acceptable range and assign value in output parameter. Tested: Verified post and patch methods with different kinds of value types( int, bool, string, vector array, json etc..) and it works. Change-Id: I21a6f9a12aef09f6ca79a02bc01d96efeeb3a20a Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-29BMCWeb : Fix a warning spotted in meson scan buildManojkiran Eda1-0/+7
- This commit fixes a warning that is spotted in meson scan build which is run as a part of CI. ``` ../../../redfish-core/include/../lib/log_services.hpp:1519:9: warning: Value stored to 'ret' is never read ret = sd_journal_seek_realtime_usec(journal.get(), ts); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. ``` Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: I6800ef9d908494d8328ab8e66c12778df394023c
2020-05-28FW Update: Task: Update messagesJames Feist2-59/+116
This adds reporting of percent updated and changes "staged" to paused to indicate some further action must happen to change state to Completed. Tested: validator passed "Messages": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has started.", "MessageArgs": [ "2" ], "MessageId": "TaskEvent.1.0.1.TaskStarted", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 5 percent complete.", "MessageArgs": [ "2", 5 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 10 percent complete.", "MessageArgs": [ "2", 10 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 15 percent complete.", "MessageArgs": [ "2", 15 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 20 percent complete.", "MessageArgs": [ "2", 20 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 25 percent complete.", "MessageArgs": [ "2", 25 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 30 percent complete.", "MessageArgs": [ "2", 30 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 35 percent complete.", "MessageArgs": [ "2", 35 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 40 percent complete.", "MessageArgs": [ "2", 40 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 45 percent complete.", "MessageArgs": [ "2", 45 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 50 percent complete.", "MessageArgs": [ "2", 50 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 55 percent complete.", "MessageArgs": [ "2", 55 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 60 percent complete.", "MessageArgs": [ "2", 60 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 65 percent complete.", "MessageArgs": [ "2", 65 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 70 percent complete.", "MessageArgs": [ "2", 70 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 75 percent complete.", "MessageArgs": [ "2", 75 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 80 percent complete.", "MessageArgs": [ "2", 80 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 85 percent complete.", "MessageArgs": [ "2", 85 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 90 percent complete.", "MessageArgs": [ "2", 90 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 95 percent complete.", "MessageArgs": [ "2", 95 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has changed to progress 100 percent complete.", "MessageArgs": [ "2", 100 ], "MessageId": "TaskEvent.1.0.1.TaskProgressChanged", "Resolution": "None.", "Severity": "OK" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has been paused.", "MessageArgs": [ "2" ], "MessageId": "TaskEvent.1.0.1.TaskPaused", "Resolution": "None.", "Severity": "Warning" }, { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 2 has Completed.", "MessageArgs": [ "2" ], "MessageId": "TaskEvent.1.0.1.TaskCompletedOK", "Resolution": "None.", "Severity": "OK" } ], Change-Id: I32103e53486d459fe945a8b451d2092232c12e83 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-05-28Redfish: ClearLog action support for system dump log entriesraviteja-b2-2/+49
Tested By: POST https://${IP}/redfish/v1/Systems/system/LogServices/SystemDump/Actions/LogService.ClearLog Change-Id: I28af3ccc1d7bd54c521e79d93e6ccb1436eefc4f Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
2020-05-28Redfish: Download action support for system dump entryraviteja-b2-0/+32
Tested By: POST https://${IP}/redfish/v1/Systems/system/LogServices/SystemDump/Entries/<id>/Actions/Oem/OpenBmc/LogEntry.DownloadLog Change-Id: I06262cf0799920aeb065a065886320b20c04aa7c Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
2020-05-21Redfish: Set AutomaticRetry (AutoReboot)Gunnar Mills1-8/+73
"AutomaticRetryConfig" can be 3 values, Disabled, RetryAlways, and RetryAttempts. OpenBMC only supports Disabled and RetryAttempts. Use AllowableValues to show this. "AutomaticRetryAttempts" is hardcoded in OpenBMC. "RemainingAutomaticRetryAttempts" is readonly in Redfish. Tested: Validator passes. PATCHing "Boot" "BootSourceOverrideEnabled" and "BootSourceOverrideTarget" still work. curl -k https://$bmc/redfish/v1/Systems/system ... "Boot": { "AutomaticRetryAttempts": 3, "AutomaticRetryConfig": "RetryAttempts", "AutomaticRetryConfig@Redfish.AllowableValues": [ "Disabled", "RetryAttempts" ], Can see the following two set correctly on Redfish and D-Bus: curl -k -v -X PATCH https://${bmc}/redfish/v1/Systems/system -d \ '{"Boot":{"AutomaticRetryConfig": "Disabled"}}' ... < HTTP/1.1 204 No Content curl -k -v -X PATCH https://${bmc}/redfish/v1/Systems/system -d \ '{"Boot":{"AutomaticRetryConfig": "RetryAttempts"}}' ... < HTTP/1.1 204 No Content Handles bad data: curl -k -v -X PATCH https://${bmc}/redfish/v1/Systems/system -d \ '{"Boot":{"AutomaticRetryConfig": "BadValue"}}' ... < HTTP/1.1 400 Bad Request ... "AutomaticRetryConfig@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "The value BadValue for the property AutomaticRetryConfig is not in the list of acceptable values.", "MessageArgs": [ "BadValue", "AutomaticRetryConfig" ], "MessageId": "Base.1.4.0.PropertyValueNotInList", Change-Id: I603ccce1a682ac40f2e496cba9172e2a6dfdb58d Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-05-21EventService: Add enable/disable supportAppaRao Puli2-44/+110
Add EventService enable/disable support. When EventService is enabled - Check for no of event log subscribers and then only process events async sending. - Check for no of metric report subscribers and register for metric report signal. When EventService is disabled - Discard the inotify event for redfish logs. - Unregister the metric report signal. Tested: - Modified ServieEnabled, DeliveryRetryAttempts, DeliveryRetryInterval values using patch and it reflects on subsequent gets. - Above mentioned functionality tested with Service enabled & disabled modifications. - Ran redfish validator successfully. Change-Id: Id049860a89d3040d859ac8907e7bad5b4209b73d Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-20update to ManagerAccount.v1_3_0Joseph Reynolds1-6/+6
The PasswordChangeRequired commit did not pass the Redfish validator. It uses the ManagerAccount.PasswordChangeRequired property which was added in 1_3_0. Tested: Passed the Redfish Service Validator Signed-off-by: Joseph Reynolds <joseph-reynolds@charter.net> Change-Id: Icb3bacd887c018baad107c22ddd7623243232339
2020-05-20Redfish: AutomaticRetry (AutoReboot)Gunnar Mills1-1/+86
A new feature of 2020.1. Three properties to represent this: AutomaticRetryConfig (Enum with three values): Disabled RetryAttempts: "Automatic retrying of booting is based on a specified retry count." RetryAlways AutomaticRetryAttempts: "The number of attempts the system will automatically retry booting." RemainingAutomaticRetryAttempts: "The number of remaining automatic retry boots." Only the "GET". A later commit will allow PATCHing of AutomaticRetryConfig. AutomaticRetryAttempts is not on D-Bus and is instead hardcoded to 3. Tested: Validator passed. "Boot": { "AutomaticRetryAttempts": 3, "AutomaticRetryConfig": "RetryAttempts", ... "RemainingAutomaticRetryAttempts": 3 }, Change-Id: I7a098270411eef2112c47d129aae39cd2b419825 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-05-20Implement Redfish PasswordChangeRequiredJoseph Reynolds6-8/+96
This implements the Redfish PasswordChangeRequired handling. See section 13.3.7.1 "Password change required handling" in the 1.9.1 spec: https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.9.1.pdf These portions of the spec are implemented: - Authenticatation with a correct but expired password creates a session: - The session is restricted to the ConfigureSelf privilege which allows a user to change their own password (via GET and PATCH Password for their own account). Support for the ConfigureSelf privilege is already in BMCWeb. - The session object has the PasswordChangeRequired message. - All other operations respond with http status code 403 Forbidden and include the PasswordChangeRequired message. - The ManagerAccount (URI /redfish/v1/AccountService/Accounts/USER) PasswordChangeRequired property is implemented for local accounts but not present for remote accounts. This has the following additional behavior: The PasswordChangeRequired property is updated at the start of each new REST operation, even within an existing session. This behavior implements a "dynamic" PasswordChangeRequired handling that responds to changes to the underlying "password expired" status. Specifically: - Sessions restricted by the PasswordChangeRequired handling lose that restriction when the underlying account password is changed. - Sessions become subject to the PasswordChangeRequired handling restrictions whenever the underlying account password expires. - The mechanism is to check if the password is expired at the start of every new REST API operation, effectively updating the ManagerAccount PasswordChangeRequired property each time. This makes BMCWeb responsive to changes in the underlying account due to other activity on the BMC. Notes: 1. Note that when an account password status is changed (for example, the password becomes expired or is changed) and that account has active sessions, those sessions remain. They are not deleted. Any current operations are allowed to complete. Subsequent operations with that session pick up the new password status. 2. This does not implement OWASP recommendations which call for sessions to be dropped when there is a significant change to the underlying account. For example, when the password is changed, the password becomes expired, or when the account's Role changes. OWASP's recommendation is due to the session fixation vulnerability. See the OWASP Session Management Cheat Sheet section "Renew the Session ID After Any Privilege Level Change": https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#renew-the-session-id-after-any-privilege-level-change BMCWeb protects against session fixation vulnerabilities because it always regenerates new session IDs when successful authentication creates a new session. 3. Users authenticating via mTLS are not subject to the PasswordChangeRequired behavior because mTLS takes precedence over password-based authentication. Tested: 0. Setup: - The `passwd --expire USERNAME` command was used to expire passwords. The `chage USER` command was also used. - The following were used to change the password: Redfish API, passwd command, and the SSH password change dialog. - Tested the following via Basic Auth, /login, and Redfish login (except where Basic Auth does not create a persistent session). - Only local user account were tested. - Did not test authentication via mTLS or with LDAP users. 1. When the password is not expired, authentication behaves as usual for both correct and incorrect passwords. 2. When the password is incorrect and expired, authentication fails as usual. 3. When the password is correct but expired: A. A session is created and has the PasswordChangeRequired message. B. That session cannot access resources that require Login privilege and the 403 message contains the PasswordChangeRequired message. C. That session can be used to GET the user's account, PATCH the Password, and DELETE the session object. D. The account PasswordChangeRequired reports true. 4. While a session is established, try expiring and changing (unexpiring) the password using various mechanisms. Ensure both the session object and the ManagerAccount PasswordChangeRequired property report the correct condition, and ensure PasswordChangeRequired handling (restricting operations to ConfigureSelf when PasswordChangeRequired is true) is applied correctly. Signed-off-by: Joseph Reynolds <joseph-reynolds@charter.net> Change-Id: Iedc61dea8f949e4b182e14dc189de02d1f74d3e8
2020-05-16vlan id should be 32 bitAndrew Geissler1-1/+1
Upstream yocto appears to bring in a new compiler which is flagging the inconsistency of the VLAN ID data type and failing to compile bmcweb because of it. The redfish specification lists the datatype for VLANId as a integer that can range from 0-4094. Here's the error: /lib/ethernet.hpp:2221:58: error: no matching function for call to 'std::variant<unsigned int>::variant(uint64_t&)' | 2221 | std::variant<uint32_t>(vlanId)); Change-Id: Ic92ad6518a9529f5099a1eaf1250df106119d319 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
2020-05-16Add OCP mandatory entry for IPv6AddressPolicyTableJohnathan Mantey1-0/+3
The Open Compute Project mandates the presence of the IPv6AddrssPolicyTable collection in Redfish. This commit adds the mandatory collection as an empty collection. Tested: Ran redfish service validator and confirmed the table collection was found. Change-Id: I6e98295f2a33acd49a3bb01d97aa840525875dd2 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
2020-05-15Conditional build issue fixAppaRao Puli1-1/+1
When BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES is set to "ON", bmcweb build is failing. This flag is set to ON for some OEM and causing build failures. Corrected the placement of #endif. Tested: Set the BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES compile flag to "ON" and build is successful. Change-Id: I88b3b40d0a22600c0f592219f8b7b976e7e6c5f5 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-14Create the IPv6 AddressState Redfish node for OCPJohnathan Mantey1-2/+4
The Open Compute Project defines the IPv6 AddressState entry to be a mandatory field. OpenBMC does not have any support in phosphor-network for reporting the actual IPv6 state. The AddressState field is allowed to be null. This commit returns the AddressState as a null. Tested: Ran service validator Ran a GET on Managers/bmc/EthernetInterfaces/eth0 and saw the addition of the AddressState, and that it was null. Change-Id: Ia2847f94ac73fc05ff2ca1be40a3f601fa0a3dfc Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
2020-05-14Redfish(Network): Fix PATCH of existing IPv4StaticAddresses propertiesRavi Teja1-7/+0
Currently Unable to modify(PATCH) existing IP address properties. Failure case: add an ipv4 static address and try to do patch operation to modify properties of this static address entry. say existing entry "IPv4StaticAddresses": [ { "Address": "223.7.7.7", "AddressOrigin": "Static", "Gateway": "223.7.7.1", "SubnetMask": "255.255.0.0" }] do patch operation, it returns success but does not update properties. 1.PATCH -D '{"IPv4StaticAddresses": [{"Address": "10.7.7.20","SubnetMask": "255.255.0.0","Gateway":"223.7.7.1"}]}' 2.PATCH -D '{"IPv4StaticAddresses": [{},{"Address": "10.8.8.8"}]} both cases expected to work. . Test By: Pacthing existing entry properties and creating new entries. 1.PATCH -d '{"IPv4StaticAddresses": [{},{"Address": "10.7.7.20","SubnetMask": "255.255.0.0","Gateway":"10.7.7.1"}]}' 2.PATCH -D '{"IPv4StaticAddresses": [{},{"Address": "10.8.8.8"}]} 3.PATCH -d '{"IPv4StaticAddresses": [{},{"Address": "10.8.8.8"},{"Address": "10.9.9.9","SubnetMask": "255.255.0.0","Gateway":"9.41.164.1"}]}' 4.GET https://${IP}/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/ Signed-off-by: Ravi Teja <raviteja28031990@gmail.com> Change-Id: Ic23330592e9041ddd1e9f96d08ea0bb88c6d8ca7
2020-05-14Task: Use TaskEvent messagesJames Feist4-5/+137
Task registry messages make more sense to use for task events then standard registry entries when applicable. Use them. Tested: "Messages": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "The task with id 0 has started.", "MessageArgs": [ "0" ], "MessageId": "TaskEvent.1.0.1.TaskStarted", "Resolution": "None.", "Severity": "OK" } ], Validator passed Change-Id: I707492544e18def2833e8a2e2216ce803c42c775 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-05-14sdbusplus: replace message::variant with std::variantPatrick Williams7-23/+19
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia5d0845741f1d8d4bc6fd227c6d2e6f3a8d42b2e
2020-05-14sdbusplus: remove deprecated variant_nsPatrick Williams7-170/+125
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I86e11299512704fa1df1e5f6517ea25cc6eced8f
2020-05-14EventService: Add MetricReport supportAppaRao Puli2-4/+186
Add Telemetry metric report support to EventService. - Adding MetricReport support to schema implemenation. - Dynamically register and unregister the metric report signal. - Reads Telemtry data using D-Bus calls. - Filter the metric reports depending on user configured MetricReportDefinition. - Format the Telemetry readings as per MetricReport schema. - Send the formatted data to the client. Tested: - HTTP client successfully received asynchronous metric reports data. - valdiated the register and unregister by adding and deleting subscriptions. - Ran Redfish validator successfully. Change-Id: I7b59ac3ecad169a7959a800730dbc2fe85baf068 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-08EventService: Add event log support with inotifyAppaRao Puli1-0/+457
Add event logs support - Event log monitor by adding inotify on redfish log file. - Read event logs from "/var/log/redfish" file. - Filter the event logs using configured settings. - Format the event log data as per Events schema. - Send event log information to subcribed client. Tested: - Added new event log subscription with filters and verified the event logs on event listener. - Ran redfish validater successfully. - Disabled BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES and build successful. Event on listener looks as below: { "@odata.type":"#Event.v1_4_0.Event", "Events":[ { "Context":"CustomText", "EventId":"94787", "EventTimestamp":"1970-01-02T02:19:47+00:00", "EventType":"Event", "Message":"Memory ThermTrip asserted: .", "MessageArgs":[ "" ], "MessageId":"OpenBMC.0.1.MemoryThermTrip", "Severity":"Critical" } ], "Id":"3", "Name":"Event Log" } Change-Id: Ie87322ff59f9f7caa26fb18d2e3b8d7af77ec540 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-05-08Redfish: Log service implementation for system dumpraviteja-b2-0/+337
Dump is the debug data collected at any point of time from the system and is stored in a file Currently, Redfish doesn't have schema for operations on debug data(dump). This commit implements logService for system dump. we have a DMTF proposal to extend existing LogService schema for this purpose but its still work in progress, so moved to oem schema. below commit has changes to move properties to OEM https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/30352 Tested By: GET https://${IP}/redfish/v1/Systems/system/LogServices/SystemDump DELETE https://${IP}/redfish/v1/Systems/system/LogServices/SystemDump/Entries/<id> Redfish validator passed. (above mentioned commit required to pass validator). Change-Id: I4a4a4083be4556bc46a4335d31ce56f834bd4f5a Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
2020-05-07EventService: SubmitTestEvent initial supportAppaRao Puli3-2/+67
This commit adds SubmitTestEvent initial support to send out test events to subscribers. URI: /redfish/v1/EventService/Actions/EventService.SubmitTestEvent Tested: - Client subscribed to event listener via destination uri. After sending POST request on SubmitTestEvent uri, could see generated test event. - Successfully ran the redfish validator. Counter({'metadataNamespaces': 1739, 'pass': 26, 'skipOptional': 22, 'serviceNamespaces': 3, 'passGet': 3, 'passAction': 1}) Validation has succeeded. Change-Id: I16e02c1977e99af39317070567196767ac7c7400 Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com>
2020-05-06bmcweb: Replace deprecated boost callZhenfei Tai1-1/+3
The boost::asio::io_context::post() is deprecated and will not build when boost library is version 1.71.0. See CMakeLists.txt 271 if ("${Boost_VERSION}" STREQUAL "107100") 272 add_definitions (-DBOOST_ASIO_NO_DEPRECATED) 273 endif () Signed-off-by: Zhenfei Tai <ztai@google.com> Change-Id: Iacd657af320ba6eebb1518cd86a955f355ed5068