Age | Commit message (Collapse) | Author | Files | Lines |
|
To quote from The Redfish release [1]
2022.3 Redfish Schema Bundle – This .zip file contains the current
versions of all Redfish schemas. The bundle includes 40 schema updates
and developer resources.
Added Compute Express Link (CXL) support (NEW)
Extensions to Fabric, PCIeDevice, Processor, Memory, ComputerSystem,
and Chassis schemas Defined by DMTF alliance partner Compute Express
Link (CXL) Consortium
Extensions to Fabric, PCIeDevice, Processor, Memory, ComputerSystem,
and Chassis schemas New CXLLogicalDevice schema
Added MultiFactorAuth to AccountService to configure a service for
multi-factor authentication
HTTP Basic authentication is not available for accounts configured
for multi-factor authentication
For client certificate authentication, the client provides their
identity certificate during TLS handshaking
For RSA SecurID, Google Authenticator, and Microsoft Authenticator,
clients provide a new Token property in the session creation request
Added Heater and HeaterMetrics resources
[1] https://www.dmtf.org/content/redfish-release-20223-now-available
Change-Id: Iefe80866bfb83e65ab98b2cf4ee2eacce5238c5b
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Adds support for retrieving the dump file that's generated by
phosphor-debug-collector as a result of using the LogServices/Dump
Action LogService.CollectDiagnosticData from the bmc Manager resource.
Refactors the handling for
/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/attachment
to use one of the new functions and remove the large lambda.
Tested:
I began the dump generation process by sending a POST request to
/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData.
That spawned a Task to track the dump being generated by
phosphor-debug-collector. The dump was retrieved by querying the
/redfish/v1/Managers/bmc/LogServices/Dump/Entries/<str>/attachment URI
which is associated with the Task.
Verified that an event log returned by querying
/redfish/v1/Systems/<str>/LogServices/EventLog/Entries/<str>/attachment
is the same as it was before this change.
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: I352b2628a9990bbde40f22e6134f02c89189c925
|
|
GET on redfish/v1/JsonSchema does not show OEM schemas but shows only
DMTF redfish schemas.
It is because Oem schemas are not included into `schemas.hpp`.
In addition, the explicit OEM JsonSchema gives the content of the file
rather than the valid Json output.
Tested:
- Query JsonSchemas
```
curl -k -H "X-Auth-Token: $token" -X GET "https://$bmc/redfish/v1/JsonSchemas"
curl -k -H "X-Auth-Token: $token" -X GET "https://$bmc/redfish/v1/JsonSchemas/<OemSchema>"
e.g.
curl -k -H "X-Auth-Token: $token" -X GET "https://$bmc/redfish/v1/JsonSchemas/OemManager"
```
- Redfish Service Validator passed
Change-Id: I0fc9c3d4a48fb9c6ddec9591af12fd2c849331e3
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
|
In boost 1.83.0, the boost::url maintainers deprecated the header only
usage of the library without warning. A discussion with the
maintainers[1] made it clear that they removed the abiliy on purpose,
and they're not going to add it back or add a deprecation strategy (they
did say they would update the documentation to actually match the
intent), and that from here on in we should be using the cmake boost
project to pull in the non-header-only boost libraries we use (which at
this point is ONLY boost url).
This commit updates to remove the usage of boost::urls::result typedef,
which was deprecated in this release (which causes a compile error) and
moves it to boost::system::result.
In addition, it updates our meson files to pull in the boost project as
a cmake dependency.
[1] https://cpplang.slack.com/archives/C01JR6C9C4U/p1696441238739129
Tested: Not yet.
Change-Id: Ia7adfc0348588915440687c3ab83a1de3e6b845a
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
This commit refactors the getCollectionMembers function into smaller
functions. Additionally, the 'subtree' parameter is no longer a
default parameter but is explicitly required in the function. All
calls to getCollectionMembers have been updated to pass the 'subtree'
parameter.
Tested: Validator passed
'''
curl -k https://$bmc/redfish/v1/Systems/system/Storage
{
"@odata.id": "/redfish/v1/Systems/system/Storage",
"@odata.type": "#StorageCollection.StorageCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/Storage/1"
}
],
"Members@odata.count": 1,
"Name": "Storage Collection"
}
curl -k https://$bmc/redfish/v1/Cables
{
"@odata.id": "/redfish/v1/Cables",
"@odata.type": "#CableCollection.CableCollection",
"Description": "Collection of Cable Entries",
"Members": [
{
"@odata.id": "/redfish/v1/Cables/dp0_cable0"
},
{
"@odata.id": "/redfish/v1/Cables/dp0_cable1"
},
{
"@odata.id": "/redfish/v1/Cables/dp0_cable2"
},
{
"@odata.id": "/redfish/v1/Cables/dp0_cable3"
}
],
"Members@odata.count": 4,
"Name": "Cable Collection"
}
curl -k https://$bmc/redfish/v1/Chassis
{
"@odata.id": "/redfish/v1/Chassis",
"@odata.type": "#ChassisCollection.ChassisCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Chassis/chassis"
}
],
"Members@odata.count": 1,
"Name": "Chassis Collection"
}
curl -k https://$bmc/redfish/v1/Systems/system/Memory
{
"@odata.id": "/redfish/v1/Systems/system/Memory",
"@odata.type": "#MemoryCollection.MemoryCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/Memory/dimm0"
},
{
"@odata.id": "/redfish/v1/Systems/system/Memory/dimm1"
},
......
{
"@odata.id": "/redfish/v1/Systems/system/Memory/dimm31"
}
],
"Members@odata.count": 32,
"Name": "Memory Module Collection"
}
'''
Change-Id: If5091431b548f371bff03b2897fd0aaf8b0ef203
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
We haven't been very good about maintaining this file, so lets generate
it like we do everything else.
This commit takes the existing, manually built
openbmc_message_registry.hpp and copies the generated json from a
working system, then hooks it into the parse_registries script to
generate the hpp file. This results in a couple changes, and somewhat
proves how bad our ability to manage this file manually is..
Tested: Looking for input on if this is the right direction.
Change-Id: I5dc03021d194f0674e4a8f41421096b211462a0a
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
This code as it stands pulls in the full datetime library from boost,
including io, and a bunch of timezone code. The bmc doesn't make use of
any of this, so we can rely on a much simplified version.
Unfortunately for us, gcc still doesn't implement the c++20
std::chrono::parse[1]. There is a reference library available from [2]
that backports the parse function to compilers that don't yet support
it, and is the basis for the libc++ version. This commit opts to copy
in the header as-written, under the assumption that we will never need
to pull in new versions of this library, and will move to the std
ersion as soon as it's available in the next gcc version.
This commit simplifies things down to improve compile times and binary
size. It saves ~22KB of compressed binary size, or about 3%.
Tested: Unit tests pass. Pretty good coverage.
[1] https://en.cppreference.com/w/cpp/chrono/parse
[2] https://github.com/HowardHinnant/date/blob/master/include/date/date.h
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I706b91cc3d9df3f32068125bc47ff0c374eb8d87
|
|
Type safety is a good thing. In:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/65606
It was found that splitting out the URI into encoded pieces in the early
phase removed some information we needed, namely whether or not a URI
was ipv6. This commit changes http client such that it passes all the
information through, with the correct type, rather than passing in
hostname, port, path, and ssl separately.
Opportunistically, because a number of log lines are changing, this uses
the opportunity to remove a number of calls to std::to_string, and rely
on std::format instead.
Now that we no longer use custom URI splitting code, the
ValidateAndSplitUrl() method can be removed, given that our validation
now happens in the URI class.
Tested: Aggregation works properly when satellite URIs are queried.
Change-Id: I9f605863179af54c5af2719bc5ce9d29cbfffab7
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
C++20 brought us std::ranges for a lot of algorithms. Most of these
conversions were done using comby, similar to:
```
comby -verbose 'std::lower_bound(:[a].begin(),:[b].end(),:[c])' 'std::ranges::lower_bound(:[a], :[c])' $(git ls-files | grep "\.[hc]\(pp\)\?$") -in-place
```
Change-Id: I0c99c04e9368312555c08147d474ca93a5959e8d
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
FanRemoved MessageArgs was mistakenly changed from 1 to 0. This changes
it back to 1 to fix getting Internal Server Error on events.
Tested:
Confirmed that FanRemoved events can be retrieved without getting a 500
error code.
Change-Id: I9a2a55a5ee3d2bea073d7d55ed9fe53dc2aaee9d
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
|
|
There are instances of ERROR logs that would work better as WARNING or
DEBUG since they do not actually result in bailing early and returning
an error response.
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: I1e7bca0bb38487b26a4642ab72ce475170bb53c6
|
|
Redfish event PowerSupplyPowerRestored has MessageArgs as 0 instead of
1. Due to this redfish events are not populated and getting Internal
Server Error.
So updated MessageArgs to 1.
Tested:
1. Redfish validator - passed for this new change
2. Verified GET /redfish/v1/Systems/system/LogServices/EventLog/Entries.
Able to populate Redfish event as expected.
Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I9a2450cba5ff668ff495b7f2ba3b86b856581fff
|
|
Clang-tidy has the aforementioned check, which shows a few places in the
core where we ignored the required optional checks. Fix all uses.
Note, we cannot enable the check that this time because of some weird
code in health.hpp that crashes tidy[1]. That will need to be a future
improvement.
There are tests that call something like
ASSERT(optional)
EXPECT(optional->foo())
While this isn't an actual violation, clang-tidy doesn't seem to be
smart enough to deal with it, so add some explicit checks.
[1] https://github.com/llvm/llvm-project/issues/55530
Tested: Redfish service validator passes.
Change-Id: Ied579cd0b957efc81aff5d5d1091a740a7a2d7e3
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Support for PATCH method is added to Metric Report Definition,
now selected read/write Report properties can be modified by PATCH method
Tested:
- Added Report via POST, overwrite editable properties via PATCH and
fetched Report via GET checking if received data is properly modified
Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: If75110a92c55c9e4f2415f0ed4471baa802643ff
|
|
std::format is a much more modern logging solution, and gives us a lot
more flexibility, and better compile times when doing logging.
Unfortunately, given its level of compile time checks, it needs to be a
method, instead of the stream style logging we had before. This
requires a pretty substantial change. Fortunately, this change can be
largely automated, via the script included in this commit under
scripts/replace_logs.py. This is to aid people in moving their
patchsets over to the new form in the short period where old patches
will be based on the old logging. The intention is that this script
eventually goes away.
The old style logging (stream based) looked like.
BMCWEB_LOG_DEBUG << "Foo " << foo;
The new equivalent of the above would be:
BMCWEB_LOG_DEBUG("Foo {}", foo);
In the course of doing this, this also cleans up several ignored linter
errors, including macro usage, and array to pointer deconstruction.
Note, This patchset does remove the timestamp from the log message. In
practice, this was duplicated between journald and bmcweb, and there's
no need for both to exist.
One design decision of note is the addition of logPtr. Because the
compiler can't disambiguate between const char* and const MyThing*, it's
necessary to add an explicit cast to void*. This is identical to how
fmt handled it.
Tested: compiled with logging meson_option enabled, and launched bmcweb
Saw the usual logging, similar to what was present before:
```
[Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled
[Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800
[Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist
[Info src/webserver_main.cpp:59] Starting webserver on port 18080
[Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file.
[Info src/webserver_main.cpp:137] Start Hostname Monitor Service...
```
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8
|
|
This commit implements the Redfish Fan schema and fetches basic
information about each fan. The code first validates the chassis ID and
then validates the fan ID by obtaining a list of fans through the
endpoints of the cooled_by association. Additionally, common properties
are added.
Tested: Validator passes
1. doGet method to get Fan
'''
curl -k https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan2
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan2",
"@odata.type": "#Fan.v1_3_0.Fan",
"Id": "fan2",
"Name": "Fan"
}
2. Input the wrong chassisId with the doGet method to get Fan
curl -k https://${bmc}/redfish/v1/Chassis2/chassis/ThermalSubsystem/Fans/fan3
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type named 'fan3' was not found.",
"MessageArgs": [
"",
"fan3"
],
"MessageId": "Base.1.13.0.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.13.0.ResourceNotFound",
"message": "The requested resource of type named 'fan3' was not found."
}
}
3. Input the wrong fanId with the doGet method to get fan
curl -k https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan78
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan78",
"@odata.type": "#Fan.v1_3_0.Fan",
"Id": "fan78",
"Name": "Fan",
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type Fan named 'fan78' was not found.",
"MessageArgs": [
"Fan",
"fan78"
],
"MessageId": "Base.1.13.0.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.13.0.ResourceNotFound",
"message": "The requested resource of type Fan named 'fan78' was not found."
}
}
'''
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I44994a998fd9c497d794e2568cc0148120bfbc15
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
The FanCollection schema is a resource in Redifsh version 2022.2 [1]
that represents the management properties for the monitoring and
management of cooling fans implemented by Redfish [2].
This commit retrieves the fan collection by obtaining the endpoints of
the `cooled_by` association. The `cooled_by` association represents the
relationship between a chassis and the fans responsible for providing
cooling to the chassis.
ref:
[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2022.2.pdf
[2] http://redfish.dmtf.org/schemas/v1/Fan.v1_3_0.json
Redfish validator is currently failing. In order for the validator to
pass, it is necessary to merge this commit with
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57559
Tested:
1. doGet method to get FanCollection
```
curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans",
"@odata.type": "#FanCollection.FanCollection",
"Description": "The collection of Fan resource instances chassis",
"Members": [
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan5"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan4"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan3"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan2"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan1"
},
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0"
}
],
"Members@odata.count": 6,
"Name": "Fan Collection"
}
2. Input the wrong chassisId with the doGet method
curl -k https://${bmc}/redfish/v1/Chassis/chassis11/ThermalSubsystem/Fans
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type Chassis
named 'chassis11' was not found.",
"MessageArgs": [
"Chassis",
"chassis11"
],
"MessageId": "Base.1.13.0.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and
resubmit the request."
}
],
"code": "Base.1.13.0.ResourceNotFound",
"message": "The requested resource of type Chassis named
'chassis11' was not found."
}
}
```
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: If5e9ff5655f444694c7ca1aea95d45e2c9222625
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
We already have a generator class. We should use it. Wrap this into a
function that can be unit tested, and add unit tests.
Note, some files also needed to change name, because random.hpp
conflicts with the built in random, and causes circular build problems.
This commit changes it to ossl_random.
Tested: Unit tests pass. Now has coverage.
Redfish service validator passes.
Change-Id: I5f8eee1af5f4843a352c6fd0e26d67fd3320ef53
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
The code that was here was quite complex, and relied on a number of c++
features that were hard to track. It also implemented a parser that
would parse a given number multiple times.
This commit replaces fromDurationString with a single pass, simpler
parser, that doesn't rely on templates. It does this with a basic state
machine, like one would see in any number of places.
This allows the details section to be completely removed, as it can now
be simply inlined. This results in a decrease of 1.1KB of the binary
size of bmcweb.
Note, C++20 now has an implementation of std::chrono::days, which
obsoletes the need for redfish::time_utils::details::Days, so that
conversion is done opportunistically.
Tested: Unit tests pass. Pretty good coverage here.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8eb9bee9807cc102f3680105b39f4eed3bd2e73c
|
|
The /ibm/v1 console is a different tree than Redfish, and as such,
should not be sending non-redfish resource events out. This is very
likely to break redfish clients on the other end. If the management
console wants an event-like entity, it needs to come up with its own
EventService-like resource, considering it is a separate tree.
Significant related discussion occurred here:
https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/36368
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ic2a9e572099490f8810e03ab08336518f5672690
|
|
Allows the aggregator to insert links to top level collections which are
only supported by the satellite bmc.
Tested:
Links were added to responses for collections which are not currently
supported by BMCWeb. Also verified that top level collections and
satellite resources were still aggregated correctly.
curl localhost/redfish/v1
{
...
"Fabrics": {
"@odata.id": "/redfish/v1/Fabrics"
},
...
}
curl localhost/redfish/v1/UpdateService
{
...
"SoftwareInventory": {
"@odata.id": "/redfish/v1/UpdateService/SoftwareInventory"
}
}
The following $expand queries also returned as expected
curl -s 'localhost/redfish/v1?$expand=.($levels=1)'
curl -s 'localhost/redfish/v1/UpdateService?$expand=.($levels=1)'
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: Ie755f67bd28f81f6677670c09c9a210935ae0af9
|
|
This commit refactors the redfishPcieGenerationFromDbus and
redfishSlotType functions by changing their return types. The return
value std::nullopt indicates that there is no output, while the return
value pcie_device::PCIeTypes::Invalid indicates that the input was
invalid and returns an internal error. Additionally, the code that calls
these functions has been updated to accommodate the changes.
Tested: Validator passed
Change-Id: I3f7c1a3c8c6b53fd9a39928e3ad9a5fed9be97ff
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
We're not consistent here, which leads to people copying and pasting
code all over, which has lead to a bunch of different names for error
codes.
This commit changes to coerce them all to "ec", because that's what
boost uses for a naming convention.
Tested: Rename only, code compiles.
Change-Id: I7053cc738faa9f7a82f55fc46fc78618bdf702a5
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Now that SSE is in the core, this code is no longer used or required.
Most of it now exists (in function) in http/server_sent_event.hpp.
Remove the dead code.
Tested: Code compiles
Change-Id: I346d1cea566a46157a6667ca472e59b17dfa9b19
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
It was pointed out in a prior review that single character variable
names were not very descriptive. Rename p to jsonPtr to be more
descriptive.
Tested: Pretty good unit test coverage here.
Change-Id: I9583d52dd6cc7f5e6a8eabe42bbe8da9efa44ee0
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Using pointers here would require to check for null in every handler,
which is a bit wasteful. Use a reference instead.
Tested: Unit tests pass. Pretty good coverage for this section of code.
Change-Id: If47e893affb96eb848262cbbcd718f676191664a
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
findNavigationReference handles a couple different types. Split it up
into the relevant types.
Tested: Unit tests pass. Pretty good coverage for this section of code.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I0c601a0779c23050b7803e4691334243485c8d29
|
|
clang-16 now supports std::source_location so remove the indirection
that uses experimental::source_location in some cases.
Tested: Compiled with `CXX=clang++`.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Id55bdf01855206c6892684e1e56cc5ff56e2b5a2
|
|
Implement SNMPTrap in EventDestination of Redfish. We can use
this Redfish interface to add/get/delete the SNMPTrap port and
destination address. When the error
log is generated, phosphor-snmp
will send SNMPTrap messages to our configured SNMPTrap destination.
The MIB is here:
[1] https://github.com/openbmc/phosphor-snmp/blob/master/mibs/NotificationMIB.txt
Refer:
[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2019.3.pdf
SNMPTrap test: Tested ok on the Witherspoon machine.
Steps are as follows:
1. Use this Redfish interface to configure the port and
destination address:
curl -k -H "X-Auth-Token: $token" -X POST
https://${bmc}/redfish/v1/EventService/Subscriptions
-d '{"Destination": "snmp://192.168.31.89:162",
"SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c"}'
2. Run the SNMPTrap receiver tool in the destination
computer(192.168.31.89),I used iReasoning MIB Browser as the
SNMPTrap receiving tool.
3. Trigger error logs such as power supply AC Lost. We will see
the error log under /xyz/openbmc_project/logging.
4. The SNMPTrap receiver tool in the destination computer received
the SNMPTrap sent by OpenBMC.
Tested: Validator passes
1. Add snmp client:
curl -k -H "X-Auth-Token: $token" -X POST
https://${bmc}/redfish/v1/EventService/Subscriptions
-d '{"Destination": "snmp://192.168.31.89:162",
"SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c",
"Context": "testContext"}'
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"Message": "The resource has been created successfully",
"MessageArgs": [],
"MessageId": "Base.1.8.1.Created",
"MessageSeverity": "OK",
"Resolution": "None"
}
]
}
2. Get snmp trap client configurations:
curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/EventService/Subscriptions/snmp1
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1",
"@odata.type": "#EventDestination.v1_7_0.EventDestination",
"Context": "testContext",
"Destination": "snmp://192.168.31.89:162",
"EventFormatType": "Event",
"Id": "snmp1",
"Name": "Event Destination snmp1",
"Protocol": "SNMPv2c",
"SubscriptionType": "SNMPTrap"
}
Reboot the BMC, and get the snmp trap client again:
curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/EventService/Subscriptions/snmp1
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1",
"@odata.type": "#EventDestination.v1_7_0.EventDestination",
"Context": "testContext",
"Destination": "snmp://192.168.31.89:162",
"EventFormatType": "Event",
"Id": "snmp1",
"Name": "Event Destination snmp1",
"Protocol": "SNMPv2c",
"SubscriptionType": "SNMPTrap"
}
3. Delete snmp client:
curl -k -H "X-Auth-Token: $token" -X DELETE
https://${bmc}/redfish/v1/EventService/Subscriptions/snmp1
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "Successfully Completed Request",
"MessageArgs": [],
"MessageId": "Base.1.8.1.Success",
"MessageSeverity": "OK",
"Resolution": "None"
}
]
}
4. After we have added some SNMP clients using Redfish, we can see them
in Dbus:
busctl tree xyz.openbmc_project.Network.SNMP
`-/xyz
`-/xyz/openbmc_project
`-/xyz/openbmc_project/network
`-/xyz/openbmc_project/network/snmp
`-/xyz/openbmc_project/network/snmp/manager
|-/xyz/openbmc_project/network/snmp/manager/1
busctl introspect xyz.openbmc_project.Network.SNMP
/xyz/openbmc_project/network/snmp/manager/1
xyz.openbmc_project.Network.Client
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
.Address property s "192.168.31.89" emits-change writable
.Port property q 162 emits-change writable
5. Use "busctl call" add client
busctl call xyz.openbmc_project.Network.SNMP
/xyz/openbmc_project/network/snmp/manager
xyz.openbmc_project.Network.Client.Create
Client sq 192.168.31.90 162
s "/xyz/openbmc_project/network/snmp/manager/2"
We will see it use the redfish url:
curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/EventService/Subscriptions/snmp2
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/snmp2",
"@odata.type": "#EventDestination.v1_7_0.EventDestination",
"Context": "",
"Destination": "snmp://192.168.31.90:162",
"EventFormatType": "Event",
"Id": "snmp2",
"Name": "Event Destination snmp2",
"Protocol": "SNMPv2c",
"SubscriptionType": "SNMPTrap"
}
6. Deleting snmp client using "busctl"
First, we use redfish to add some SNMP clients:
curl -k -H "X-Auth-Token: $token" -X POST
https://${bmc}/redfish/v1/EventService/Subscriptions
-d '{"Destination": "snmp://192.168.31.90:162",
"SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c",
"Context": "testContext0"}'
curl -k -H "X-Auth-Token: $token" -X POST
https://${bmc}/redfish/v1/EventService/Subscriptions
-d '{"Destination": "snmp://192.168.31.91:162",
"SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c",
"Context": "testContext1"}'
Then we can use redfish to get the subscriptions:
curl -k -H "X-Auth-Token: $token" -XGET
https://${bmc}/redfish/v1/EventService/Subscriptions
{
"@odata.id": "/redfish/v1/EventService/Subscriptions",
"@odata.type":"#EventDestinationCollection.EventDestinationCollection",
"Members": [
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1"
},
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/snmp2"
}
],
"Members@odata.count": 2,
"Name": "Event Destination Collections"
}
Now we use busctl to delete SNMP client 2:
busctl call xyz.openbmc_project.Network.SNMP
/xyz/openbmc_project/network/snmp/manager/2
xyz.openbmc_project.Object.Delete Delete
Then we won't see snmp2 in the subscriptions of redfish:
curl -k -H "X-Auth-Token: $token" -XGET
https://${bmc}/redfish/v1/EventService/Subscriptions
{
"@odata.id": "/redfish/v1/EventService/Subscriptions",
"@odata.type":"#EventDestinationCollection.EventDestinationCollection",
"Members": [
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1"
}
],
"Members@odata.count": 1,
"Name": "Event Destination Collections"
}
7. Test the generic event subscription to make sure it didn't impacted
Add Redfish subscription:
curl -k -H "X-Auth-Token: $token" -X POST
https://${bmc}/redfish/v1/EventService/Subscriptions
-d '{"Destination": "https://192.168.31.189:443",
"SubscriptionType": "RedfishEvent", "Protocol": "Redfish",
"Context": "testContext"}'
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The resource has been created successfully.",
"MessageArgs": [],
"MessageId": "Base.1.13.0.Created",
"MessageSeverity": "OK",
"Resolution": "None."
}
]
Get Redfish subscription:
curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/EventService/Subscriptions/1358109191
{
"@odata.id": "/redfish/v1/EventService/Subscriptions/1358109191",
"@odata.type": "#EventDestination.v1_8_0.EventDestination",
"Context": "testContext",
"DeliveryRetryPolicy": "TerminateAfterRetries",
"Destination": "https://192.168.31.189:443",
"EventFormatType": "Event",
"HttpHeaders": [],
"Id": "1358109191",
"MessageIds": [],
"MetricReportDefinitions": [],
"Name": "Event Destination 1358109191",
"Protocol": "Redfish",
"RegistryPrefixes": [],
"ResourceTypes": [],
"SubscriptionType": "RedfishEvent"
}
Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie589b3934ee749c7e0add35e3ed1b0b7e817c557
|
|
Similar to what we've done elsewhere, consolidate all the BMCWEB_ROUTE
calls on the bottom of the file. This is a consolidation such that you
no longer have to hunt for all the entry points into these handlers.
Tested: Code compiles
Change-Id: I9f2a2c6772445048e9ade2bf9e95330d73bedb05
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Add a utility function which estimates the size of the JSON tree.
It is used in the children change to limit the reponse size of expand
query.
Tested:
1. unit test passed;
2. tested on hardware, the following are real sizes and estimation
```
Real payload size, Estimation, query
15.69 KB, 10.21 KB, redfish/v1?$expand=.($levels=1)
95.76 KB, 62.11 KB, redfish/v1?$expand=.($levels=2)
117.14 KB, 72.71 KB, redfish/v1?$expand=.($levels=3)
127.65 KB, 77.64 KB, redfish/v1?$expand=.($levels=4)
```
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Iae26d6732a6ec63ecc59eacf657b4bf33c07c046
|
|
Since the getManagedObjects method has been implemented in
dbus_utility and this commit is to integrate all the places where the
GetManagedObjects method is obtained, and use the method in
dbus_utility uniformly.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ic13f2bef7b30f805cd3444a75d7df17b031f2eb0
|
|
Move redfishPcieGenerationFromDbus, called from both pcie.hpp and
pcie_slots.hpp, and busSlotTypeToRf functions, called from
pcie_slots.hpp, to a common PCIe utility file.
In the future commit, when integrating PCIeSlot with PCIeDevice, we will
call the busSlotTypeToRf function from pcie.hpp, so having it in the
common utility file will make it readily available.
Tested: build successful, no additional testing needed.
Change-Id: I6286bd5547ddafa6eac4f224ac56f6d790a44c7a
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
The previous patches modified these fields one at a time, for the cases
where we had code calling these in odd ways. This commit goes and
effects the same change on the rest of the message handlers where it
makes sense.
Any input to a message function that mentions a "value" replaces the
value with a nlohmann::json object, to make calling this code easier.
The one exception is StringValueTooLong, which by definition, requires
the input value to be a string, so that is left as string_view
intentionally.
Tested: Dead unused code. Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I00b9804b2aadf5584032be91a0ee53b9a94a7430
|
|
Similar to the previous patches, make propertyValueIncorrect accept a
nlohmann::json object as input. This removes the need for the dump()
call, which oddly enough, in our one usage, was actually incorrect, and
could cause bmcweb to throw an exception in parsing in theory.
Tested: Only used in one error condition. Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie35d61101c2db88b16d42d71e66bceef540e8429
|
|
Similar to other patches, make propertyValueFormatError accept a
nlohmann::json object, which removes a lot of the unsafe dump code that
we have littered about.
Tested: No easy to replicate error. Code is identical to previous
patchsets. Inspection and code compilation only.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic9d0f196b6e198073189f744b738db7ffa2f1b74
|
|
Similar to the prior patchset in this series, propertyValueTypeError can
be moved to safer constructs. This ensures that we are minimizing how
many places we are calling dump() from, and allows us to reduce the
amount of code written for error handling.
Tested:
PATCH /redfish/v1/SessionService {"SessionTimeout": "foo"}
Returns PropertyValueTypeError in the same behavior as prior to this
patch.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iddff4b787f35c49bf923663d61bba156687f358c
|
|
The error codes for this function accept a string_view, which has caused
a number of cases of users of this function to call dump() to_string()
and all manner of other conversions. Considering that dump() is
something that's difficult to call correctly, and overly wordy, it would
be ideal if the message code just handled that for us.
Therefore, this commit changes the prototype to include a nlohmann::json
object as an argument instead of string_view, then audits the codebase
for all uses, and moves them to a more normalized usage, which allows
the calling code to call "dump" for them.
Tested: PATCH /redfish/v1/SessionService {"SessionTimeout": 1}
Returns the PropertyValueNotInList error as it did before.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If62909072db1f067ad1f8aa590bb716c84181219
|
|
This code was added into the registries namespace, from event service
manager. It is operating on registries, it belongs in the registry
header.
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I89e830dde185178b1d2e52b18a1a0a2baa4e0fb3
|
|
With delegate expand, the default expand level is -=
`queryCapabilities.canDelegateExpandLevel`. This creates an overlap of
expand process between delegate expand vs. default expand.
With
query.expandLevel = 2 ->
query.expandLevel = 1 and delegated.expandLevel = 1.
Both delegated and default expand will try to only expand of level one
instead of level 2 for the default.
The code in
https://github.com/openbmc/bmcweb/blob/479e899d5f57a67647f83b7f615d2c8565290bcf/redfish-core/include/utils/query_param.hpp#L583-L597
stated that the level with "@odata.id" + other property is treated as a
seperate level. So with `query.expandLevel = 1` it just loop through the
id that was already expanded and is noop.
Tested:
Before:
/redfish/v1/Chassis/BMC/Sensors?$expand=.($levels=2) returns
the same result as level=1. Needs level=3 to expand to the next level.
The RelatedItem in here doesn't get expanded with level=2.
```
wget -qO- 'http://localhost:80/redfish/v1/Chassis/BMC/Sensors?$expand=.($levels=1)'
...
{
"@odata.id": "/redfish/v1/Chassis/BMC/Sensors/temperature_DIMMXX",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "temperature_DIMMXX",
"Name": "DIMMXX",
"Reading": 30.0,
"ReadingRangeMax": 127.0,
"ReadingRangeMin": -128.0,
"ReadingType": "Temperature",
"ReadingUnits": "Cel",
"RelatedItem": [
{
"@odata.id": "/redfish/v1/Systems/system/Memory/dimmXX"
}
],
"Status": {
"Health": "OK",
"State": "Enabled"
},
"Thresholds": {
"LowerCaution": {
"Reading": null
},
"LowerCritical": {
"Reading": null
},
"UpperCaution": {
"Reading": 93.0
},
"UpperCritical": {
"Reading": 95.0
}
}
}
],
"Members@odata.count": 242,
"Name": "Sensors"
}
```
After:
level=2 was able to expand to the next level.
Change-Id: I542177a94a33f8df7afbb68837f3a53b86140c86
Signed-off-by: Willy Tu <wltu@google.com>
|
|
In about half of our code, AsyncResp objects take the name asyncResp,
and in the other half they take the name aResp. While the difference
between them is negligeble and arbitrary, having two naming conventions
makes it more difficult to do automated changes over time via grep.
This commit was generated automtatically with the command:
git grep -l 'aResp' | xargs sed -i 's|aResp|asyncResp|g'
Tested: Code compiles.
Change-Id: Id363437b6a78f51e91cbf60aa0a0c2286f36a037
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
This code has never used strands.
Tested: Code compiles
Change-Id: I59a204fe3f3a26b2a9a8ede990335c58889fb7e6
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
In Redfish Schema (DSP2046) 2022.3 introduces EthernetInterface 1.9.0
that allows creating VLAN interface by POST EthernetInterface [1]
instead of using the deprecated VLanNetworkInterface. This patch
removes all current usage of VLanNetworkInterface.
This patchest (topic:redfish-ethernet-1.9) introduces breaking API
changes to current VLAN management features. All deprecated VLAN APIs
are removed, VLAN interfaces will be managed in the same way as the
EthernetInterface Resource, except they can be created or deleted.
Since webui-vue has not implemented anything related to VLAN yet, it
is not impacted.
Solves the issue mentioned in 188cb6294105 ("ethernet: Bump
EthernetInterface schema 1.4.1 -> 1.6.0")
[1] https://redfishforum.com/thread/619
Tested:
Redfish validator passed on a board with VLAN interface. No VLAN
interface is exposed in Redfish.
Change-Id: I9b243a5bb0f07642aa60bc13a622e862f62ee871
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
|
|
Move Storage to v1.13.0. The Storage schema moved StorageControllers to
its own resource + collection and deprecated the existing
StorageControllers property in Storage. A link to the collection has
been added in Storage instead.
The StorageController and StorageControllerCollection are added based
on the old resource as specified in
https://redfish.dmtf.org/schemas/v1/Storage.v1_14_0.json
Added the new StorageController to remove the deprecated
`Storage/StorageControllers`. This will have the same functionility as
the existing StorageController with the exception that HealthPopulate
is not supported right now.
There will be no customer impact (other than Health resource). The
clients will now need to get the StorageController collection and then
Storagecontroller instead of directly from Storage.
Tested:
RedfishValidator passed for Storage
```
*** /redfish/v1/Systems/system/Storage
INFO - Attempt 1 of /redfish/v1/Systems/system/Storage
INFO - Response Time for GET to /redfish/v1/Systems/system/Storage: 0.04373445897363126 seconds.
INFO - Type (StorageCollection.StorageCollection), GET SUCCESS (time: 0:00:00.044128)
INFO - Attempt 1 of /redfish/v1/Systems/system/Storage/1
INFO - Response Time for GET to /redfish/v1/Systems/system/Storage/1: 0.3353928590659052 seconds.
INFO - PASS
INFO -
*** /redfish/v1/Systems/system/Storage/1
INFO - Type (Storage.v1_13_0.Storage), GET SUCCESS (time: 0:00:00.335720)
*** /redfish/v1/Systems/system/Storage/1/Controllers
INFO - Type (StorageControllerCollection.StorageControllerCollection), GET SUCCESS (time: 0:00:00.046414)
INFO - Attempt 1 of /redfish/v1/Systems/system/Storage/1/Controllers/cpld
INFO - Response Time for GET to /redfish/v1/Systems/system/Storage/1/Controllers/cpld: 0.05196243803948164 seconds.
INFO - Attempt 1 of /redfish/v1/Systems/system/Storage/1/Controllers/morristown
INFO - Response Time for GET to /redfish/v1/Systems/system/Storage/1/Controllers/morristown: 0.05082511808723211 seconds.
INFO - PASS
INFO -
...
*** /redfish/v1/Systems/system/Storage/1/Controllers/controller_0
INFO - Type (StorageController.v1_6_0.StorageController), GET SUCCESS (time: 0:00:00.052223)
INFO - PASS
INFO -
*** /redfish/v1/Systems/system/Storage/1/Controllers/controller_1
INFO - Type (StorageController.v1_6_0.StorageController), GET SUCCESS (time: 0:00:00.051165)
INFO - PASS
INFO -
```
```
wget -qO - http://localhost:80/redfish/v1/Systems/system/Storage/1/Controllers
{
"@odata.id": "/redfish/v1/Systems/system/Storage/1/Controllers",
"@odata.type": "#StorageControllerCollection.StorageControllerCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/Storage/1/Controllers/controller_0"
},
{
"@odata.id": "/redfish/v1/Systems/system/Storage/1/Controllers/controller_1"
}
],
"Members@odata.count": 2,
"Name": "Storage Controller Collection"
}
```
```
wget -qO - http://localhost:80/redfish/v1/Systems/system/Storage/1/Controllers/controller_1
{
"@odata.id":
"/redfish/v1/Systems/system/Storage/1/Controllers/controller_1",
"@odata.type": "#StorageController.v1_6_0.StorageController",
"Id": "cpld",
"Name": "cpld",
"Status": {
"State": "Enabled"
}
}
```
Change-Id: I1c171514d5613f93d283d764ffb69b16dc3ba74d
Signed-off-by: Willy Tu <wltu@google.com>
|
|
Convert all types to uint8_t to not hit the conversion warning.
Change-Id: Ia535ca0a2f4045cbde06a2f8f8eaad9570a0f4a5
Signed-off-by: Willy Tu <wltu@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
This commit adds the SSE style eventservice subscription style event
Using this, end user can subscribe for Redfish event logs using GET
on SSE uris from browser.
Tested:
- From Browser did GET on above SSE URI and
generated some Redfish event logs(power cycle)
and saw redfish event logs streaming on browser.
- After SSE registration, Check Subscription collections
and GET on individual subscription and saw desired
response.
- Ran RedfishValidation and its passed.
Change-Id: I7f4b7a34974080739c4ba968ed570489af0474de
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Currently, getPCIeDeviceList is only used by systems.hpp to obtain the
list of PCIe devices. However, there are plans to use this function in
other parts of the PCIe code as well. To better organize our code and
make the function more reusable, this commit moves getPCIeDeviceList to
pcie_util.hpp, a common location for PCIe-related utilities.
Tested:
'''
curl -k https://$bmc/redfish/v1/Systems/system
{
"@odata.id": "/redfish/v1/Systems/system",
"@odata.type": "#ComputerSystem.v1_16_0.ComputerSystem",
"Actions": {
"#ComputerSystem.Reset": {
"@Redfish.ActionInfo": "/redfish/v1/Systems/system/ResetActionInfo",
"target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset"
}
},
.....
.....
"PCIeDevices": [
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/dp0_drive2"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/dp0_drive3"
},
.....
.....
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card0"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card1"
},
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10"
},
.....
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card9"
}
],
"PCIeDevices@odata.count": 20,
.....
.....
'''
Change-Id: I3aaa5b55e8574929154ffd743db53da6fbaeb75d
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
This prototype got added twice, once with int as a value, and once with
size_t. This builds fine in 64 bit, but in 32 bit, fails.
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie3de779330d768cdd84d5647d242d5fe447d2a85
|
|
User input must be validated to avoid the out-of-memory issue. This
commit adds the size check on input parameters such as Context,
Destination and Header field while create or update the
EventDestination.
Added a generic error message "PropertySizeExceeded" in message registry
which is used as response when size limit is exceeded.
Tested
- Validated using POST on Event Subscription.
- When Context, Destination and Headers were too long,
received a error message denoting the same.
Change-Id: Ibab847ce0c99f445a76e6d3aee8074428bb7d30f
Signed-off-by: AppaRao Puli <apparao.puli@intel.com>
Signed-off-by: Ayushi Smriti <smriti.ayushi@intel.com>
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Update Base registry to 1.16.0, and Resource Event registry to 1.3.0
Patch was generated automatically.
Tested: Code builds.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie9c15a657459cf7ec7fa5b4bf89460049fbce554
|