History log of /openbmc/bmcweb/features/redfish/lib/log_services.hpp (Results 126 – 150 of 317)
Revision Date Author Comments
# 6d6574c9 28-Jun-2022 Jason M. Bills <jason.m.bills@intel.com>

Update host logger with recent JSON fixes

Similar changes were recently made for other log entry types to improve
handling of JSON objects. This applies the same fixes for host logger
entries.

I do

Update host logger with recent JSON fixes

Similar changes were recently made for other log entry types to improve
handling of JSON objects. This applies the same fixes for host logger
entries.

I don't have a system that uses the host logger, so I'm not able to
test this change.

Change-Id: If5af976885a321e1077d89d92129f4b87a8e2943
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# 517d9a58 28-Jun-2022 Tony Lee <tony.lee@quantatw.com>

Fix fail on get PostCode entry

Get url /redfish/v1/Systems/system/LogServices/PostCodes/Entries/<str>
return error.
Compare with sha dcf2ebc020257bc298d948fcb4da761c284e84d7
Condition checking is di

Fix fail on get PostCode entry

Get url /redfish/v1/Systems/system/LogServices/PostCodes/Entries/<str>
return error.
Compare with sha dcf2ebc020257bc298d948fcb4da761c284e84d7
Condition checking is different from the original.

Tested:
Before fix:
curl -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/PostCodes/Entries
...
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605",
"@odata.type": "#LogEntry.v1_8_0.LogEntry",
"Created": "1970-01-01T00:11:17+00:00",
"EntryType": "Event",
"Id": "B1-605",
"Message": "Boot Count: 1; Time Stamp Offset: 603.1745 seconds; POST Code: 0x84",
"MessageArgs": [
"1",
"603.1745",
"0x84"
],
"MessageId": "OpenBMC.0.2.BIOSPOSTCode",
"Name": "POST Code Log Entry",
"Severity": "OK"
}
],
curl -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The resource at the URI '/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605' was not found.",
"MessageArgs": [
"/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605"
],
"MessageId": "Base.1.11.0.ResourceMissingAtURI",
"MessageSeverity": "Critical",
"Resolution": "Place a valid resource at the URI or correct the URI and resubmit the request."
}
],
"code": "Base.1.11.0.ResourceMissingAtURI",
"message": "The resource at the URI '/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605' was not found."
}

After fixed:
curl -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/PostCodes/Entries",
"@odata.type": "#LogEntry.v1_4_0.LogEntry",
"Description": "Collection of POST Code Log Entries",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/PostCodes/Entries/B1-605",
"@odata.type": "#LogEntry.v1_8_0.LogEntry",
"Created": "1970-01-01T00:11:17+00:00",
"EntryType": "Event",
"Id": "B1-605",
"Message": "Boot Count: 1; Time Stamp Offset: 603.1745 seconds; POST Code: 0x84",
"MessageArgs": [
"1",
"603.1745",
"0x84"
],
"MessageId": "OpenBMC.0.2.BIOSPOSTCode",
"Name": "POST Code Log Entry",
"Severity": "OK"
}
],

Signed-off-by: Tony Lee <tony.lee@quantatw.com>
Change-Id: Iada035214a9c1dc47be00c0ed3010562b80b0a3c

show more ...


# ac992cde 24-Jun-2022 Jason M. Bills <jason.m.bills@intel.com>

Use an enum to return message registry parsing status

We need to handle an event differently if it's not found in the
registries vs. failing to parse, so a simple success/fail return status
is no lo

Use an enum to return message registry parsing status

We need to handle an event differently if it's not found in the
registries vs. failing to parse, so a simple success/fail return status
is no longer enough.

This adds an enum to return additional status information so we can
continue parsing events if one is not found in a registry.

Tested:
Confirmed that events not found in the registry are still correctly
skipped.

Change-Id: Ib3be587fc165670e231a2897d490416bd29530be
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# 84afc48b 24-Jun-2022 Jason M. Bills <jason.m.bills@intel.com>

log_services: remove brace initialization

This removes brace initialization for event, journal, and crashdump log
entries.

Tested:
Confirmed that each log entry is the same before and after this ch

log_services: remove brace initialization

This removes brace initialization for event, journal, and crashdump log
entries.

Tested:
Confirmed that each log entry is the same before and after this change.

Change-Id: I29a79a86b55c959671f424d36f4913865e590161
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# d405bb51 24-Jun-2022 Jason M. Bills <jason.m.bills@intel.com>

log_services: don't replace res.jsonValue

There were places where res.jsonValue was being replaced by assigning a
new object. This changes those to use res.jsonValue.update() to replace
the contents

log_services: don't replace res.jsonValue

There were places where res.jsonValue was being replaced by assigning a
new object. This changes those to use res.jsonValue.update() to replace
the contents instead of the entire object.

Tested:
Confirmed that individual event, journal, and crashdump entries can
still be retrieved.

Change-Id: I8a0885530af58393d4b90fe15390db8c3af02994
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# 3a48b3a2 24-Jun-2022 Jason M. Bills <jason.m.bills@intel.com>

log_services: use nlohmann::json::object_t

This updates fillBMCJournalLogEntryJson() and the crashdump logEntry to
use the nlohmann::json::object_t type.

Tested:
Confirmed that the journal and cras

log_services: use nlohmann::json::object_t

This updates fillBMCJournalLogEntryJson() and the crashdump logEntry to
use the nlohmann::json::object_t type.

Tested:
Confirmed that the journal and crashdump entries are still displayed
correctly.

Change-Id: Ia940a41aab8e17bac006ee7735b33132e211d5a0
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# de703c5d 23-Jun-2022 Jason M. Bills <jason.m.bills@intel.com>

Update handling of skipped log entries

We now skip log entries where the MessageId is not in the Message
Registry. However, since a blank entry is added to the array before the
MessageId is checked,

Update handling of skipped log entries

We now skip log entries where the MessageId is not in the Message
Registry. However, since a blank entry is added to the array before the
MessageId is checked, it was leaving an empty {} in that location and
incrementing the Members@odata.count.

This change moves the MessageId check to before the entry count is
incremented to fix the Members@odata.count and moves the push_back()
into the array to the end, so an entry is only added if it's valid.

Tested:
Added three entries to the log as follows: good, bad, good.
The entries array showed only the two good entries with
Members@odata.count=2.
Using top=2, still showed only the two good entries with
Members@odata.count=2.
Skip did not work but appears to already be broken, so it was not
impacted by this change.
Confirmed that getting a single good entry still works.

Change-Id: I08ffc56af14004e2221acdb4a091bbfeb9c21c70
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# efde4ec9 24-Jun-2022 Jason M. Bills <jason.m.bills@intel.com>

Clean up firstEntry boolean checks

The check if firstEntry is true is unnecessary and it is safe to always
set to false after the first entry ID is found. So, we can clean up a
few lines of if check

Clean up firstEntry boolean checks

The check if firstEntry is true is unnecessary and it is safe to always
set to false after the first entry ID is found. So, we can clean up a
few lines of if checks and always set to false.

Tested:
Confirmed that log entries are still listed correctly.

Change-Id: If3bb1a37696786e43860848c9a038b70424950e6
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>

show more ...


# 21ab404c 26-Jun-2022 Nan Zhou <nanzhoumails@gmail.com>

log_service: make function static

clang14++ doesn't build at HEAD because of the non-static function
|getDumpEntriesPath|.

Tested: clang builds.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Ch

log_service: make function static

clang14++ doesn't build at HEAD because of the non-static function
|getDumpEntriesPath|.

Tested: clang builds.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ib6a03f3deb435afbb04445cd7f76ee0514ceb3f1

show more ...


# fdd26906 01-Mar-2022 Claire Weinan <cweinan@google.com>

LogService: Add support for Fault Log

The corresponding log service is at
/redfish/v1/Managers/bmc/LogServices/FaultLog

Fault Log is a new type of dump for aggregating fault data. For details
pleas

LogService: Add support for Fault Log

The corresponding log service is at
/redfish/v1/Managers/bmc/LogServices/FaultLog

Fault Log is a new type of dump for aggregating fault data. For details
please see
https://github.com/openbmc/docs/blob/master/designs/hw-fault-monitor.md

We're currently assuming we'll have a single Fault Log instance per
BMC, which can support multiple host processors.

Tested:
First enabled redfish-dump-log option

Fault Log showed up in the expected LogService collection:
./curl_bin -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices",
"@odata.type": "#LogServiceCollection.LogServiceCollection",
"Description": "Collection of LogServices for this Manager",
"Members": [
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/Journal"
},
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/Dump"
},
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/FaultLog"
}
],
"Members@odata.count": 3,
"Name": "Open BMC Log Services Collection"
}

FaultLog dump entries are created when a fault is detected by a BMC
daemon -- we don't support FaultLog dump entry creation requested by
a Redfish client via the CollectDiagnosticData LogService action.
Fault Log CollectDiagnosticData returned Not Found (HTTP error
404) as expected:
$curl -k -H "X-Auth-Token: $token" -X POST http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/LogService.CollectDiagnosticData -d '{"DiagnosticDataType":"Manager", "OEMDiagnosticDataType":"FaultLog"}'
Not Found

Generated Fault Log dump entries via BMC console:
busctl call xyz.openbmc_project.Dump.Manager /xyz/openbmc_project/dump/faultlog xyz.openbmc_project.Dump.Create CreateDump a{sv} 0

Retrieved Fault Log dump entries (including with query parameters top and skip):
curl -k -H "X-Auth-Token: $token" -X GET
http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1
curl -k -H "X-Auth-Token: $token" -X GET
http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries
curl -k -H "X-Auth-Token: $token" -X GET
http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries?\$skip=2
curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries?\$top=3

Deleted Fault Log dump entry:
curl -k -H "X-Auth-Token: $token" -X DELETE http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1

Note: The following command to clear the Fault Log will not work until
Fault Log entries have the required D-Bus interface implemented
(xyz.openbmc_project.Dump.Entry.FaultLog):
curl -k -H "X-Auth-Token: $token" -X POST http://${bmc}/redfish/v1/Managers/bmc/LogServices/FaultLog/Actions/LogService.ClearLog

Redfish Service Validator succeeded on the following URIs:
/redfish/v1/Managers/bmc/LogServices
/redfish/v1/Managers/bmc/LogServices/FaultLog
/redfish/v1/Managers/bmc/LogServices/FaultLog/Entries

Also did cursory testing of BMC Dump (/redfish/v1/Managers/bmc/LogServices/Dump/)
and System Dump (/redfish/v1/Systems/system/LogServices/Dump/) for code
paths that were refactored.

Signed-off-by: Claire Weinan <cweinan@google.com>
Change-Id: I80b5444e61263f79e89b10abd556d59af6f17c8c

show more ...


# 3ba00073 06-Jun-2022 Carson Labrado <clabrado@google.com>

Expose AsyncResp shared_ptr when handling response

For Redfish Aggregation, we need a common point to check the D-Bus
for satellite configs. If they are available then we perform the
aggregation op

Expose AsyncResp shared_ptr when handling response

For Redfish Aggregation, we need a common point to check the D-Bus
for satellite configs. If they are available then we perform the
aggregation operations. The functions in query.hpp are used by all
endpoints making them the logical location. The aggregation code
requires a shared_ptr to the AsyncResp so these functions need to be
able to supply that.

This patch is broken out of a future patch for routing Redfish
Aggregation requests
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310

The follow commands can be used to perform most of the replacements:
find . -type f | xargs sed -i 's/setUpRedfishRoute(app, req, asyncResp->res/setUpRedfishRoute(app, req, asyncResp/g'
find . -type f | xargs sed -i 's/setUpRedfishRouteWithDelegation(app, req, asyncResp->res/setUpRedfishRouteWithDelegation(app, req, asyncResp/g'

Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: I4f4f9f22cdcfb14a3bd94b9a8f3d64aae34e57bc

show more ...


# c7a6d660 13-Jun-2022 Claire Weinan <cweinan@google.com>

LogService: Fix setUpRedfishRoute() for dumps

There's an inconsistency between how setUpRedfishRoute() is called for
BMC dump vs. System dump. In requestRoutesSystemDumpEntry(),
setUpRedfishRoute()

LogService: Fix setUpRedfishRoute() for dumps

There's an inconsistency between how setUpRedfishRoute() is called for
BMC dump vs. System dump. In requestRoutesSystemDumpEntry(),
setUpRedfishRoute() is called within getDumpEntryById, while in
requestRoutesBMCDumpEntry() setUpRedfishRoute() is called before
getDumpEntryById() as well as within getDumpEntryById(). The
inconsistency was introduced in
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/52393/20/redfish-core/lib/log_services.hpp
and seems to be accidental.

This change removes setUpRedfishRoute() from getDumpEntryById() and
makes requestRoutesSystemDumpEntry() call setUpRedfishRoute() before
calling getDumpEntryById(). In addition to fixing the inconsistency,
this change prevents setUpRedfishRoute() from being called twice for
BMC dump.

Tested:
After creating System dump entry, retrieved it successfully with
./curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries/1

Saw “setup redfish route” message in journalctl:
bmcweb[19717]: (2022-06-13 16:42:52) [DEBUG "routing.hpp":1294] Matched rule '/redfish/v1/Systems/system/LogServices/Dump/Entries/<str>/' 2 / 4
bmcweb[19717]: (2022-06-13 16:42:52) [DEBUG "query.hpp":19] setup redfish route

Received the expected error when adding a query parameter for a
non-collection resource, which indicates setUpRedfishRoute() had been
called:
./curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries/1?\$skip=1
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/Dump/Entries/1",
"@odata.type": "#LogEntry.v1_8_0.LogEntry",
"AdditionalDataSizeBytes": 0,
"AdditionalDataURI": "/redfish/v1/Systems/system/LogServices/Dump/Entries/1/attachment",
"Created": "1970-01-01T00:27:35.135000+00:00",
"DiagnosticDataType": "OEM",
"EntryType": "Event",
"Id": "1",
"Name": "System Dump Entry",
"OEMDiagnosticDataType": "System",
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "Querying is not supported on the requested resource.",
"MessageArgs": [],
"MessageId": "Base.1.11.0.QueryNotSupportedOnResource",
"MessageSeverity": "Warning",
"Resolution": "Remove the query parameters and resubmit the request if the operation failed."
}
],
"code": "Base.1.11.0.QueryNotSupportedOnResource",
"message": "Querying is not supported on the requested resource."
}
}

Repeated the same testing for a BMC dump entry.

Signed-off-by: Claire Weinan <cweinan@google.com>
Change-Id: I41ea93bfc6971a775241a368491e4615295cc4db

show more ...


# 002d39b4 31-May-2022 Ed Tanous <edtanous@google.com>

Try to fix the lambda formatting issue

clang-tidy has a setting, LambdaBodyIndentation, which it says:
"For callback-heavy code, it may improve readability to have the
signature indented two levels

Try to fix the lambda formatting issue

clang-tidy has a setting, LambdaBodyIndentation, which it says:
"For callback-heavy code, it may improve readability to have the
signature indented two levels and to use OuterScope."

bmcweb is very callback heavy code. Try to enable it and see if that
improves things. There are many cases where the length of a lambda call
will change, and reindent the entire lambda function. This is really
bad for code reviews, as it's difficult to see the lines changed. This
commit should resolve it. This does have the downside of reindenting a
lot of functions, which is unfortunate, but probably worth it in the
long run.

All changes except for the .clang-format file were made by the robot.

Tested: Code compiles, whitespace changes only.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib4aa2f1391fada981febd25b67dcdb9143827f43

show more ...


# e7dbd530 05-May-2022 Potin Lai <potin.lai@quantatw.com>

log_services: fix wrong AdditionalDataURI

fix wrong AdditionalDataURI of EventLog entries

Tested:
[Before]
$ curl -s -u root:0penBmc -k https://10.10.11.203/redfish/v1/Systems/system/LogServices/Ev

log_services: fix wrong AdditionalDataURI

fix wrong AdditionalDataURI of EventLog entries

Tested:
[Before]
$ curl -s -u root:0penBmc -k https://10.10.11.203/redfish/v1/Systems/system/LogServices/EventLog/Entries/60 |\
> python -c 'import sys, json; print(json.load(sys.stdin)["AdditionalDataURI"])'
/redfish/v1/Systems/system/LogServices/EventLog/attachment/60

$ curl -s -u root:0penBmc -k https://10.10.11.203/redfish/v1/Systems/system/LogServices/EventLog/attachment/60
Not Found

[After]
$ curl -s -u root:0penBmc -k https://10.10.11.203/redfish/v1/Systems/system/LogServices/EventLog/Entries/60 |\
> python -c 'import sys, json; print(json.load(sys.stdin)["AdditionalDataURI"])'
/redfish/v1/Systems/system/LogServices/EventLog/Entries/60/attachment

$ curl -s -u root:0penBmc -k https://10.10.11.203/redfish/v1/Systems/system/LogServices/EventLog/Entries/60/attachment
BQAAADwAAAAGAAAAEeFXk4ABAAAtAAAAAAAAAHh5ei5vcGVuYm1jX3Byb2plY3QuTG9nZ2luZy5TRUwuRXJyb3IuQ3JlYXRlZAYAAAAAAAAACwAAAAAAAABFVkVOVF9ESVI9MQ8AAAAAAAAAR0VORVJBVE9SX0lEPTMyDQAAAAAAAABSRUNPUkRfVFlQRT0yEgAAAAAAAABTRU5TT1JfREFUQT01MjAyQzE6AAAAAAAAAFNFTlNPUl9QQVRIPS94eXovb3BlbmJtY19wcm9qZWN0L3NlbnNvcnMvdm9sdGFnZS9QMTJWX0ZBTjEIAAAAAAAAAF9QSUQ9MzAxAAAAAAAAAAAAIAAAAAAAAAAyLjEyLjAtZGV2LTEwOTQtZ2MzNDk4NzlmNi1kaXJ0eRHhV5OAAQAAAAAAAAAAAAAAAAAAAAAAAA==

Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I859638a942a0afcb57f68d6a6613d5c3498ab3be

show more ...


# c08f0325 16-May-2022 Ed Tanous <edtanous@google.com>

Fix regression in brace initialization

1476687de introduced a regression because of a simple copy/paste
transcription error. Unfortunately, dump logs aren't enabled on a
majority of systems, so thi

Fix regression in brace initialization

1476687de introduced a regression because of a simple copy/paste
transcription error. Unfortunately, dump logs aren't enabled on a
majority of systems, so this typo wasn't caught in the tested statement
for that commit, but was only caught in later CI.

Tested: Code compiles, code inspection (regression resolution)

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I98297546be3ed624e21461edbe8c5781287787db

show more ...


# 565dfb6f 28-Apr-2022 Claire Weinan <cweinan@google.com>

LogService: Sort dump entries collection by Id

Ordering by ID (represented internally as the last part of the D-Bus
object path, after the rightmost slash) is done for human readability,
but please

LogService: Sort dump entries collection by Id

Ordering by ID (represented internally as the last part of the D-Bus
object path, after the rightmost slash) is done for human readability,
but please note that Redfish clients should not be written in a way
that assumes a particular ordering of entries in a collection.

Without this change, entries are presented in the collection in
whatever order entries are returned by the D-Bus method
GetManagedObjects(), called in getDumpEntryCollection().

The effect of this change is that entries are presented in
chronological order (by ID) with the earliest entry appearing first.

Testing:
1. Prerequisite: Fixed createDump() locally, similar to
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/38954

2. Created 12 BMC dump entries by repeatedly calling
CollectDiagnosticData:

curl -k -H "X-Auth-Token: $token" -X POST http://${bmc}/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData -d '{"DiagnosticDataType":"Manager", "OEMDiagnosticDataType":"BMC"}'

3. Retrieved BMC dump entries collection and verified that entries were
sorted by ID (1,2,3,4,5,6,7,8,9,10,11,12):

curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Managers/bmc/LogServices/Dump/Entries

Signed-off-by: Claire Weinan <cweinan@google.com>
Change-Id: I99f96dd6679163cea443353ad0e4c8c750cd4330

show more ...


# 1476687d 15-Mar-2022 Ed Tanous <edtanous@google.com>

Remove brace initialization of json objects

Brace initialization of json objects, while quite interesting from an
academic sense, are very difficult for people to grok, and lead to
inconsistencies.

Remove brace initialization of json objects

Brace initialization of json objects, while quite interesting from an
academic sense, are very difficult for people to grok, and lead to
inconsistencies. This patchset aims to remove a majority of them in
lieu of operator[]. Interestingly, this saves about 1% of the binary
size of bmcweb.

This also has an added benefit that as a design pattern, we're never
constructing a new object, then moving it into place, we're always
adding to the existing object, which in the future _could_ make things
like OEM schemas or properties easier, as there's no case where we're
completely replacing the response object.

Tested:
Ran redfish service validator. No new failures.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iae409b0a40ddd3ae6112cb2d52c6f6ab388595fe

show more ...


# c937d2bf 05-Apr-2022 Ed Tanous <edtanous@google.com>

Make log services use parameter delegation

The commit prior to this one added support for delegation of $expand and
$only query param types; This commit adds support for delegation of top
and skip

Make log services use parameter delegation

The commit prior to this one added support for delegation of $expand and
$only query param types; This commit adds support for delegation of top
and skip (which we already have a few handlers for) and moves them to
the new style.

Note, this makes top and skip query params NOT below the
insecure-enable-redfish-query. top and skip have existed for a while,
and are unlikely to have security issues, as they're relatively simple
transforms.

Tested:

curl --insecure --user root:0penBmc https://192.168.7.2/redfish/v1/Managers/bmc/LogServices/Journal/Entries\?\$top\=3\&\$skip\=0

With varying $top between 1-5 and $skip between 0-5 gave the expected
number of log results.

Unit tests pass.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ia213a5e929c40579825eaf251e4b9159bc84c802

show more ...


# 54417b02 24-Mar-2022 Sui Chen <suichen@google.com>

Skip on log entries not found in the message registry

Because logs populated by fillEventLogEntryJson are expected to be
found in the message registry log entries that get returned in this
function

Skip on log entries not found in the message registry

Because logs populated by fillEventLogEntryJson are expected to be
found in the message registry log entries that get returned in this
function should have non-empty message and severity, because of the way
registries work.

Currently, for a log entry that is not present in the registry, the
function will use its log entry as-is and leave the message and severity
fields empty. This can cause the Redfish Service Validator to generate
an error.

This change fixes the fillEventLogEntryJson function so that when a log
message is not found in the registry, the message is not used for
populating the response, and is logged for further analysis.

TESTED:
First populate an offending entry.
echo "1970-01-01T00:00:47.991326+00:00 OpenBMC.1.0.ServiceStarted," > \
/var/log/redfish

Then run the Service Validator.
Before this change:
URL: /redfish/v1/Systems/system/LogServices/EventLog/Entries/60

*** /redfish/v1/Systems/system/LogServices/EventLog/Entries/60
Type (LogEntry.v1_8_0.LogEntry), GET SUCCESS (time: 0)
Severity: Empty string found - Services should omit properties if not
supported
Severity: Value Enum not found in ['OK', 'Warning', 'Critical']
Message: Empty string found - Services should omit properties if not
supported
FAIL...

After: the above response disappears from the response, the Validator
error disappears, and the following appears in the system journal:

(1970-01-01 13:01:47) [WARNING "log_services.hpp":1129] Log entry not
found in registry: 1970-01-01T00:00:47.991326+00:00
OpenBMC.1.0.ServiceStarted,

Signed-off-by: Sui Chen <suichen@google.com>
Change-Id: Ifa600d1de0e6e0cea33e9e8dfde621ee9d4e3325

show more ...


# 45ca1b86 25-Mar-2022 Ed Tanous <edtanous@google.com>

Add setUpRedfishRoute to all nodes in redfish

For better or worse, the series ahead of this is making use of
setUpRedfishRoute to do the common "redfish specified" things that need
to be done for a

Add setUpRedfishRoute to all nodes in redfish

For better or worse, the series ahead of this is making use of
setUpRedfishRoute to do the common "redfish specified" things that need
to be done for a connection, like header checking, filtering, and other
things. In the current model, where BMCWEB_ROUTE is a common function
for all HTTP routes, this means we need to propagate this injection call
into the whole tree ahead of the requests being handled.

In a perfect world, we would invent something like a REDFISH_ROUTE
macro, but because macros are discouraged, the routes take a variadic
template of parameters, and each call to the route has a .privileges()
call in the middle, there's no good way to effect this change in a less
costly manner. This was messaged both in the prior reviews, and on
discord sourcing improvements on this pattern, to which none arose.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Id29cc799e214edad41e48fc7ce6eed0521f90ecb

show more ...


# b9d36b47 26-Feb-2022 Ed Tanous <edtanous@google.com>

Consitently use dbus::utility types

This saves about 4k on the binary size

Tested: Redfish service validator passes.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I9546227a19c691b1aecb

Consitently use dbus::utility types

This saves about 4k on the binary size

Tested: Redfish service validator passes.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I9546227a19c691b1aecb80e80307889548c0293f

show more ...


# a2dd60a6 14-Mar-2022 Brandon Kim <brandonkim@google.com>

log_services: Initialize Members@odata.count as 0

Currently when Members array is initialized to an empty array, the
Members@odata.count is not present. Initialize it as 0.

The bug seems to have be

log_services: Initialize Members@odata.count as 0

Currently when Members array is initialized to an empty array, the
Members@odata.count is not present. Initialize it as 0.

The bug seems to have been introduced by:
https://gerrit.openbmc-project.xyz/50224

Tested: On QEMU -
Before change:
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of Crashdump Entries",
"Members": [],
"Name": "Open BMC Crashdump Entries"
}

After change:
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of Crashdump Entries",
"Members": [],
"Members@odata.count": 0,
"Name": "Open BMC Crashdump Entries"
}
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of Crashdump Entries",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/OnDemand",
"@odata.type": "#LogEntry.v1_7_0.LogEntry",
"AdditionalDataURI": "/redfish/v1/Systems/system/LogServices/Crashdump/Entries/OnDemand/crashdump_ondemand_1970-01-01T00:05:23Z.json",
"Created": "1970-01-01T00:05:23Z",
"DiagnosticDataType": "OEM",
"EntryType": "Oem",
"Id": "OnDemand",
"Name": "CPU Crashdump",
"OEMDiagnosticDataType": "PECICrashdump"
}
],
"Members@odata.count": 1,
"Name": "Open BMC Crashdump Entries"
}

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I5d17a8a62db23ad0da1c97113a4c6521bdec02cb

show more ...


# f7725d79 07-Mar-2022 Ed Tanous <edtanous@google.com>

Make code compile on clang again

There are a couple places we missed inline/static on our headers, and a
couple unused message entry callbacks for which their parameters were
incorrect (which clang

Make code compile on clang again

There are a couple places we missed inline/static on our headers, and a
couple unused message entry callbacks for which their parameters were
incorrect (which clang caught). Fix all of them.

Tested: Code compiles on clang. No-op changes.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I12c9c04d3b773c4991c6cd92d0cfd42b348762d6

show more ...


# 55f79e6f 25-Jan-2022 Ed Tanous <edtanous@google.com>

Enable readability checks

clang-tidy readability checks are overall a good thing, and help us to
write consistent and readable code, even if it doesn't change the
result.

All changes done by the ro

Enable readability checks

clang-tidy readability checks are overall a good thing, and help us to
write consistent and readable code, even if it doesn't change the
result.

All changes done by the robot.

Tested: Code compiles, inspection only (changes made by robot)

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iee4a0c74a11eef9f158f0044eae675ebc518b549

show more ...


# 5f2b84ee 08-Feb-2022 Ed Tanous <edtanous@google.com>

Drop message severity

In the way we store the message registry, we store both Severity and
MessageSeverity. Severity as a field is deprecated, and in every case
in every registry both fields have t

Drop message severity

In the way we store the message registry, we store both Severity and
MessageSeverity. Severity as a field is deprecated, and in every case
in every registry both fields have the same value. We shouldn't
duplicate data in that way. This commit changes the parse_registries.py
script to stop producing the Severity field into the struct. The few
uses we have left are moved over to use MessageRegistry.

Tested:

Redfish service validator shows no errors on the
/redfish/v1/Registries tree. Other errors present that were there
previously and are unchanged.

This saves a trivial amount: about 1kB on our compressed binary size.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ibbaf533dc59eb08365d6ed309aba16b54bc40ca1

show more ...


12345678910>>...13