Age | Commit message (Collapse) | Author | Files | Lines |
|
Added POST method on /redfish/v1/TelemetryService/Triggers uri, which
creates new trigger in telemetry service, by using dbus call AddTrigger.
By DMTF, most of the properties are not required, and as such are
treated as optional. Some values can be deduced from others (like
'MetricType', depending on 'DiscreteTriggers' or 'NumericThresholds').
All properties provided in POST body by user will be verified against
each other, and errors will be raised. Few examples of such situations:
- 'MetricType' is set to 'Discrete' but 'NumericThresholds' was passed.
- 'MetricType' is set to 'Numeric' but "DiscreteTriggers' or
'DiscreteTriggerCondition' were passed
- 'DiscreteTriggerCondition' is set to 'Specified' but
'DiscreteTriggers' is an empty array or was not passed.
- 'DiscreteTriggerCondition' is set to 'Changed' but 'DiscreteTriggers'
is passed and is not an empty array.
Example 1 – Trigger with discrete values:
```
{
"Id": "TestTrigger",
"MetricType": "Discrete",
"TriggerActions": [
"RedfishEvent"
],
"DiscreteTriggerCondition": "Specified",
"DiscreteTriggers": [
{
"Value": "55.88",
"DwellTime": "PT0.001S",
"Severity": "Warning"
},
{
"Name": "My discrete trigger",
"Value": "55.88",
"DwellTime": "PT0.001S",
"Severity": "OK"
},
{
"Value": "55.88",
"DwellTime": "PT0.001S",
"Severity": "Critical"
}
],
"MetricProperties": [
"/redfish/v1/Chassis/AC_Baseboard/Thermal#/Fans/0/Reading"
],
"Links": {
"MetricReportDefinitions": []
}
}
Example 2 – trigger with numeric threshold:
{
"Id": "TestTrigger2",
"Name": "My Numeric Trigger",
"MetricType": "Numeric",
"TriggerActions": [
"RedfishEvent",
"RedfishMetricReport"
],
"NumericThresholds": {
"UpperCritical": {
"Reading": 50,
"Activation": "Increasing",
"DwellTime": "PT0.001S"
},
"UpperWarning": {
"Reading": 48.1,
"Activation": "Increasing",
"DwellTime": "PT0.004S"
}
},
"MetricProperties": [
"/redfish/v1/Chassis/AC_Baseboard/Thermal#/Fans/0/Reading",
"/redfish/v1/Chassis/AC_Baseboard/Thermal#/Fans/17/Reading"
],
"Links": {
"MetricReportDefinitions": [
"/redfish/v1/TelemetryService/MetricReportDefinitions/PowerMetrics",
"/redfish/v1/TelemetryService/MetricReportDefinitions/PowerMetricStats",
"/redfish/v1/TelemetryService/MetricReportDefinitions/PlatformPowerUsage"
]
}
}
```
Tested:
- Triggers were successfully created with above example message bodies.
This can be checked by calling:
'busctl tree xyz.openbmc_project.Telemetry'.
- Expected errors were returned for messages with incorrect or mutually
exclusive properties and incorrect values.
- Redfish service validator is passing.
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: Ief8c76de8aa660ae0d2dbe4610c26a28186a290a
|
|
The task payload object can be null in certain cases. As per the schema
for Task, there is a standard property Hidepayload which can be set to
true at this case. Setting this property as true in the response body
when Payload is nil.
Tested: Created a task without creating the task payload object and able
to see Hidepayload as true in response body.
Change-Id: I370d1eb9b5b96adb56cff2216b467357b0b34b42
Signed-off-by: Arun Thomas Baby <arunx.thomas.baby.baby.mathew@intel.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
There are cases in this method where if CSRF protection is disabled,
this argument will not be used, and will trigger a compile error. This
commit fixes the compile error.
Tested: Code compiles with CSRF disabled option set.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I6daa5193fa162c73c57991600058c198dc38a418
|
|
This commit adds a utility function |sortJsonArrayByKey|. It can sort an
json array by value of a given key of each element.
Use cases includes:
1. sort the MemberCollection by @odata.id
Tested:
1. unit test passed;
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Idc175fab3af5c6102a5a3439b712b659ecb76468
|
|
Per [1] we really shouldn't be using regex. In the cases we do, it's a
HUUUUUGE performance benefit to be compiling the regex ONCE.
The only downside is a slight increase in memory usage.
[1]: https://github.com/openbmc/bmcweb/issues/176
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8644b8a07810349fb60bfa0258a13e815912a38e
|
|
Redfish Sensor schema is based around Edm.Number, which doesn't have an
allowance for things like infinity, -infinity, or NAN. Because these
are theoretically possible in the dbus interfaces, we need to omit the
properties if they are set to anything that Redfish doesn't support.
Because the DBus sensor Value interface relies on NAN to represent
unavailable, this is explicitly set to null in the json response. This
behavior was discussed with DMTF in a forum meeting, and is the
protocol-correct behavior for handling unavailable numbers. All other
number-assigning dbus properties are omitted from the response, to show
that they are "not supported" if they produce out-of-range values.
Tested: Unclear if there are any implementations that do this to test
against. Code inspection only.
Redfish-service-validator passes (on previous patchset).
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ia3dde24cd604b0bb5dc596e7b8a6461a4b339b71
|
|
Currently LDAP configuration D-bus errors are not mapped to Redfish
Errors, so returing internalError irrespective of D-bus error.
This commit handles InvalidArgument D-bus error for LDAP config
Tested By:
Configure LDAP with various invalid arguments.
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
Change-Id: I6adaedd936fb3d9d906750649792a4d414b54b73
|
|
There are some cases that getCollectionMembers can be leveraged
Tested:
GET https://127.0.0.1:443/redfish/v1/UpdateService/FirmwareInventory/
Returns the same result.
Redfish service validator passes.
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I417bc08cffd24c6c95abaf86013002ce705d20a4
|
|
System includes should be included with <>, in-tree includes should be
included with "". This was found manually, with the help of the
following grep statement[1].
git grep -o -h "#include .*" | sort | uniq
Tested:
Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1a6b2a5ba35ccbbb61c67b7c4b036a2d7b3a36a3
|
|
- Moved code around to bring state related code close to each other
- Separated long memory lambda function.
Tested:
- Ran: Compared output of following command before and after change
and it matched.
$ curl -s -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"
}
},
|
|
"Manufacturer": "",
"Memory": {
"@odata.id": "/redfish/v1/Systems/system/Memory"
},
"MemorySummary": {
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"TotalSystemMemoryGiB": 0
},
|
|
"ProcessorSummary": {
"CoreCount": 32,
"Count": 4,
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
},
"Processors": {
"@odata.id": "/redfish/v1/Systems/system/Processors"
},
Change-Id: Ib72f272eca4ff79e26fe29033c989896a5b9154d
Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
|
|
This commit fixes the problem that Redfish Validator has not passed
because of the analytical URL failure
(Redfish/V1/Systems/System/System/Storage/1/Drives/Media0).
Redfish validator error message:
```
*** /redfish/v1/Systems/system/Storage/1
INFO - Type (Storage.v1_7_1.Storage), GET SUCCESS \
(time: 0:00:00.184274)
INFO - Attempt 1 of /redfish/v1/Systems/system/Storage/1/ \
Drives/media0
INFO - Response Time for GET to /redfish/v1/Systems/system/Storage/ \
1/Drives/media0: 0.15951547500117158 seconds.
ERROR - Drives: GET of resource at URI /redfish/v1/Systems/system/ \
Storage/1/Drives/media0 returned HTTP error. Check URI.
INFO - FAIL...
INFO -
*** /redfish/v1/Systems/system/Storage/1/Drives/media0
ERROR - URI did not return resource /redfish/v1/Systems/system/ \
Storage/1/Drives/media0
```
Tested: Redfish validator passes.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I1c7ff0e8103ce2e65cd3d73f6ef20abfe70a01b5
|
|
This drop is a preparation of supporting multiple consoles in bmcweb.
In this drop we will hook up the new DBUS interface to get the unix
socket file descriptor for existing host console. At this time bmcweb
only allows host console.
This drop includes following bmcweb changes:
- The default console leaf node is set to "default" by the obmc-console
- Currently the URL is still maintained to /console0 for GUI
compatibility. In future, it will be changed to /console/<str>
where <str> could be any string which represents the console id.
- In the obmc routing function, query the console DBUS interface for
all available consoles. If the object leaf matches with the target
string, then create socket and assign the file descriptor returned
by the DBUS console.
[INFO "http_connection.hpp":209] Request: 0x1b8c608 HTTP/1.1 GET /console0
::ffff:x.xxx.xx.xxx
|
[DEBUG "routing.hpp":1440] Matched rule (upgrade) '/console0' 1 / 2
|
[DEBUG "obmc_console.hpp":247] Connection 0x13e3c8c opened
[DEBUG "obmc_console.hpp":268] Console Object path = \
/xyz/openbmc_project/console/default Request target = /console0
[DEBUG "obmc_console.hpp":230] Looking up unixFD for Service \
xyz.openbmc_project.Console.default Path /xyz/openbmc_project/console/default
[DEBUG "obmc_console.hpp":157] Console web socket path: /console0 Console\
unix FD: 12 duped FD: 13
Testing:
Make sure that console open is working for /console0 on rainier machine
Related commits:
1) phosphor-dbus-interface: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/61486
2) obmc-console: https://gerrit.openbmc.org/c/openbmc/obmc-console/+/62496
3) bmcweb: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/62525
Change-Id: I476f1bb3e3be384ab09802340a59ffa036ca0278
Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
|
|
- Update Processor Schema to 18.0
- Add processor throttle status and cause
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/63063
Throttled: An indication of whether the processor is throttled.
ThrottledCauses: An array of reasons that the processor is throttled.
Ran validator and no new errors were found.
Change-Id: Ia4a58ae0f26ffc6177f418420ba45063471323da
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
|
|
Following the changes in
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/41870
where `MemorySizeInKB` type changed from `uint32` to `size`.
Tested:
On a 64-bit system, MemorySizeInKB has type `t`, which is uint64.
```
.MemorySizeInKB property t 33554432 emits-change writable
```
Before:
```
[ERROR "dbus_utils.hpp":21] DBUS property error in property: MemorySizeInKB, reason: 1
---
~# curl localhost/redfish/v1/Systems/system -s \
| grep -A7 MemorySummary
"MemorySummary": {
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Disabled"
},
"TotalSystemMemoryGiB": 0
},
```
After:
```
~# curl localhost/redfish/v1/Systems/system -s \
| grep -A7 MemorySummary
"MemorySummary": {
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"TotalSystemMemoryGiB": 64
},
```
Change-Id: Ifc66d4cf78ea81629957091bc4f3b407aa96355a
Signed-off-by: Anthony <anthonyhkf@google.com>
|
|
The current version of nlohmann is not able to compile
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/62278. This is supported
in the latest version of the library.
Tested:
Was able to locally build bmcweb after the bump.
Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: I6820c3678a0ec23854b8db55a39fd802dc461793
|
|
This change is adding Triggers property to Links when GET is called on
MetricReportDefinition. It contains array of @odata.id pointing to
Trigger resource if it is also linking to given MRD.
Testing done:
- Links/Trigger property is returned by GET request on
/redfish/v1/TelemetryService/MetricReportDefinitions/<str>/
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I5accf4b50324437b0b185003200078ad2c7020b0
|
|
The bmc now supports the Quiesced state, which is tracked using systemd
targets. Previously, the bmc startup state was determined by systemd
alone. The old systemd startup behavior is retained, but if the bmc is
found to be started, this commit also check the quiesced target to
determine if we should set that state as well. This allows
phosphor-state-manager users to have a state that works for the quiesced
use case, while avoiding race conditions on startup, or having to impose
a hard dependency on phosphor-state-manager, which we know some users
do not use. The reasons for not using phosphor-state-manager are
outside of the scope of this commit.
In comparison to the alternative:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/50318
This actually seems to have a smaller diff, so while there's some
concern about adding complexity to bmcweb, this seems like this patch
gets us the same behavior with slightly less code.
Tested: Loaded onto a p10bmc and see this new state.
systemctl start obmc-bmc-service-quiesce@0.target
root@xxx:~# obmcutil state
CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Quiesced
curl -k https://$bmc/redfish/v1/Managers/bmc
...
"Status": {
"Health": "Critical",
"State": "Quiesced"
},
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I718b8ad0a43327051cb5fdf0da59a1ccfbde9940
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
Added support for multiple MetricProperties. Added support for new
parameters: CollectionTimeScope, CollectionDuration. ReadingParameters
was not yet changed in telemetry backend, instead temporary property
ReadingParametersFutureVersion was introduced. Once bmcweb is adapted to
use ReadingParametersFutureVersion this property will be renamed in
backend to ReadingParameters. Then bmcweb will change to use
ReadingParameters. Then ReadingParametersFutureVersion will be removed
from backend and everything will be exactly like described in
phosphor-dbus-interfaces without introducing breaking changes.
Related change in phosphor-dbus-interfaces [1], [2]. This change needs
to be bumped together with [3].
Tested:
- It is possible to create MetricReportDefinitions with multiple
MetricProperties.
- Stub values for new parameters are correctly passed to telemetry
service.
- All existing telemetry service functionalities remain unchanged.
[1]: https://github.com/openbmc/phosphor-dbus-interfaces/commit/4f9c09144b60edc015291d2c120fc5b33aa0bec2
[2]: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/60750
[3]: https://gerrit.openbmc.org/c/openbmc/telemetry/+/58229
Change-Id: I2cd17069e3ea015c8f5571c29278f1d50536272a
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Signed-off-by: Lukasz Kazmierczak <lukasz.kazmierczak@intel.com>
|
|
Much like we've done for the other collections, we should be sorting
these such that humans can use them.
This commit reorders the EthernetInterfacesCollection to report in
numerical order. In redfish, these collections are considered sets, so
therefore order is irrelevant to software, but keeping these things
useful for humans is important, therefore it's a pretty trivial change
to order them in a way that humans expect (1, 2, 3, etc).
Tested:
GET /redfish/v1/Managers/bmc/EthernetInterfaces
Returns interfaces in eth0 then eth1.
Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic48f9be5366afee49fc9fec77a3bb194ab25577d
|
|
Redfish just released 2023.1, pull it in and update the packs.
This commit was generated automatically using update_schemas.py
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8faad8392af88aa7fc3a4fd73c8e0ec3bede56e5
|
|
The new pre-defined usergroup named "hostconsole" is added to
differentiate access between host console and manager console.
The only users allowed to interact with host console are part of the
"hostconsole" group and they are in an administrator role.
Note: The changes are spread across multiple repositories listed under
"Related commits:"
The bmcweb changes to incorporate new group are as follows:
- The new user is added in the hostconsole group only if it has an
administrative role.
- The ssh usergroup is only translated to ManagerConsole redfish group
and hostconsole usergroup is translated to HostConsole redfish group.
- The following changes are made to check the privileges for host console
access
- The new OEM privilege "OpenBMCHostConsole" added for host console
access. This privilege is not shared externally hence it is not
documented.
- Updated obmc_console BMCWEB_ROUTE to use the new privilege.
- Router functions now save user role and user groups in the session
- getUserPrivileges() function now takes session reference instead
of user role. This function now also checks for the user group
"hostconsole" and add the new privilege if user is member of this
group.
- Updated all callers of the getUserPrivileges to pass session
reference.
- Added test to validate that new privilege is set correctly.
Tested:
Loaded code on the system and validated that;
- New user gets added in hostconsole group. NOTE: Prior to this commit
all groups are assigned to new user. This drop does not change that
behavior.
- Access from the web gui is only available for users in hostconsole
group. Used IBM internal simulator called simics to test this. This
simulator allows accessing openbmc from GUI.
- Checked the role collection and there is no change.
$ curl -k -H "X-Auth-Token: $TOKEN" -X GET \
https://${bmc}/redfish/v1/AccountService/Roles
$ curl -k -H "X-Auth-Token: $TOKEN" -X GET \
https://${bmc}/redfish/v1/AccountService/Roles/Administrator
$ curl -k -H "X-Auth-Token: $TOKEN" -X GET \
https://${bmc}/redfish/v1/AccountService/Roles/ReadOnly
$ curl -k -H "X-Auth-Token: $TOKEN" -X GET \
https://${bmc}/redfish/v1/AccountService/Roles/Operator
- HostConsole is in AccountType when hostconsole group is present in
UserGroups D-Bus property
$ id user99
uid=1006(user99) gid=100(users) groups=1000(priv-admin),1005(web),\
1006(redfish),1013(hostconsole),100(users)
$ curl -k https://${bmc}/redfish/v1/AccountService/Accounts/user99
{
"@odata.id": "/redfish/v1/AccountService/Accounts/user99",
"@odata.type": "#ManagerAccount.v1_4_0.ManagerAccount",
"AccountTypes": [
"HostConsole",
"Redfish",
"WebUI",
"ManagerConsole"
],
"Description": "User Account",
"Enabled": true,
"Id": "user99",
"Links": {
"Role": {
"@odata.id": "/redfish/v1/AccountService/Roles/Administrator"
}
},
"Locked": false,
"Locked@Redfish.AllowableValues": [
"false"
],
"Name": "User Account",
"Password": null,
"PasswordChangeRequired": false,
"RoleId": "Administrator",
"UserName": "user99"
- The hostconsole group is not present for readonly or operator users
and also made sure that console access is not provided. This testing
is done one the system and console access was tried by modifying the
https://github.com/openbmc/bmcweb/blob/master/scripts/websocket_test.py
+ curl -k https://${bmc}/redfish/v1/AccountService/Accounts/user99
{
"@odata.id": "/redfish/v1/AccountService/Accounts/user99",
"@odata.type": "#ManagerAccount.v1_4_0.ManagerAccount",
"AccountTypes": [
"IPMI",
"Redfish",
"WebUI",
"ManagerConsole"
],
"Description": "User Account",
"Enabled": true,
"Id": "user99",
"Links": {
"Role": {
"@odata.id": "/redfish/v1/AccountService/Roles/ReadOnly"
}
},
"Locked": false,
"Locked@Redfish.AllowableValues": [
"false"
],
"Name": "User Account",
"Password": null,
"PasswordChangeRequired": false,
"RoleId": "ReadOnly",
"UserName": "user99"
[INFO "http_connection.hpp":209] Request: 0x150ac38 HTTP/1.1 GET /console0 ::ffff:x.x.xx.xxx
[DEBUG "routing.hpp":1265] Matched rule (upgrade) '/console0' 1 / 2
[DEBUG "routing.hpp":1084] userName = user99 userRole = priv-user
[DEBUG "routing.hpp":1123] IsUserPrivileged: group=ipmi
[DEBUG "routing.hpp":1123] IsUserPrivileged: group=redfish
[DEBUG "routing.hpp":1123] IsUserPrivileged: group=ssh
[DEBUG "routing.hpp":1123] IsUserPrivileged: group=web
[DEBUG "routing.hpp":93] checkPrivileges: BASE USER: Login
[DEBUG "routing.hpp":93] checkPrivileges: BASE USER: ConfigureSelf
[DEBUG "routing.hpp":113] checkPrivileges: OEM REQUIRED: OpenBMCHostConsole
[ERROR "routing.hpp":1192] Insufficient Privilege
+ curl -k https://${bmc}/redfish/v1/AccountService/Accounts/user99
{
"@odata.id": "/redfish/v1/AccountService/Accounts/user99",
"@odata.type": "#ManagerAccount.v1_4_0.ManagerAccount",
"AccountTypes": [
"IPMI",
"Redfish",
"WebUI",
"ManagerConsole"
],
"Description": "User Account",
"Enabled": true,
"Id": "user99",
"Links": {
"Role": {
"@odata.id": "/redfish/v1/AccountService/Roles/Operator"
}
},
"Locked": false,
"Locked@Redfish.AllowableValues": [
"false"
],
"Name": "User Account",
"Password": null,
"PasswordChangeRequired": false,
"RoleId": "Operator",
"UserName": "user99"
[INFO "http_connection.hpp":209] Request: 0x21c7c38 HTTP/1.1 GET /console0 ::ffff:x.x.xx.xxx
[DEBUG "routing.hpp":1265] Matched rule (upgrade) '/console0' 1 / 2
[DEBUG "routing.hpp":1084] userName = user99 userRole = priv-operator
[DEBUG "routing.hpp":1123] IsUserPrivileged: group=ipmi
[DEBUG "routing.hpp":1123] IsUserPrivileged: group=redfish
[DEBUG "routing.hpp":1123] IsUserPrivileged: group=ssh
[DEBUG "routing.hpp":1123] IsUserPrivileged: group=web
[DEBUG "routing.hpp":93] checkPrivileges: BASE USER: Login
[DEBUG "routing.hpp":93] checkPrivileges: BASE USER: ConfigureComponents
[DEBUG "routing.hpp":93] checkPrivileges: BASE USER: ConfigureSelf
[DEBUG "routing.hpp":113] checkPrivileges: OEM REQUIRED: OpenBMCHostConsole
[ERROR "routing.hpp":1192] Insufficient Privilege
Related commits:
NOTE: docs, openbmc, obmc-console changes are already merged. bmcweb
and phosphor-user-manager will be merged together.
docs: https://gerrit.openbmc.org/c/openbmc/docs/+/60968
phosphor-user-manager: https://gerrit.openbmc.org/c/openbmc/phosphor-user-manager/+/61583
openbmc: https://gerrit.openbmc.org/c/openbmc/openbmc/+/61582
obmc-console: https://gerrit.openbmc.org/c/openbmc/obmc-console/+/61581
bmcweb: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/61580
Change-Id: Ia5a33dafc9a76444e6a8e74e752f0f90cb0a31c8
Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
|
|
This commit is to fix the faliures seen when redfish validator script is
run on the following URLs
/redfish/v1/Systems/system/LogServices/Crashdump
Error:
The Id property does not match the last segment of the URI
/redfish/v1/Managers/bmc/VirtualMedia/Slot_x
Error:
OpenBMC: EntityType resource does not contain required @odata.id
property, attempting default /OpenBMC
Tested:
Build successful.
Redfish validator passed for Virual Media URI.
Change-Id: I0b84a84140e8404babbf60ce4dba098ec5f05e73
Signed-off-by: V-Sanjana <sanjana.v@intel.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
This change takes the locked, and EncryptionStatus properties from
Drives interfaces, and creates the redfish property EncryptionStatus.
Tested:
$ wget -qO- \
http://localhost:80/redfish/v1/Chassis/AgoraV2/Drives/mmcblk0
{
"@odata.context": "/redfish/v1/$metadata#Drive.Drive",
"@odata.id": "/redfish/v1/Chassis/Drives/mmcblk0",
"@odata.type": "#Drive.v1_7_0.Drive",
"CapacityBytes": 15634268160,
"EncryptionStatus": "Unencrypted",
"Id": "mmcblk0",
"Links": {
"Chassis": "Enabled"
},
"Name": "mmcblk0",
"Status": {
"State": "Enabled"
}
}
Running the redfish Validator did not show any errors from this change.
Change-Id: Ic7b58614466535b3fd6b8c097050d3e9c8de8203
Signed-off-by: John Edward Broadbent <jebr@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
The code logic currently calls the systemd 'ListUnits' interface and
then compares the returned services and sockets with a predefined map
that associates the systemd units with specific protocols. The
appropriate 'Port' and 'ProtocolEnabled' properties are then filled into
the Redfish response to a redfish/v1/Managers/bmc/NetworkProtocol query.
The issue is that when certain services like IPMI or SSH are disabled,
the systemd unit will no longer be returned by the 'ListUnits' d-bus
interface. This results in the IPMI and SSH protocols not showing up in
the Redfish query. This commit ensures if a feature like IPMI or SSH is
disabled, the user will still see it in the Redfish query and it will
shows false for 'ProtocolEnabled'.
Looked into calling 'ListUnitFiles' which sounds like it returns all
possible units in the system, but that consistently timed out when
calling in a witherspoon qemu session (vs. the instant response to
`ListUnits` in the same session).
Prior to commit 5c3e927 the code operated differently and would look up
each individual protocol. If it didn't find it, then it would fill in
defaults. The change caused us to no longer put a default in for the
protocols when they are disabled.
Tested:
- Confirmed when IPMI was disabled that a query to NetworkProtocol
returned with IPMI in its response and 'ProtocolEnabled' was false
- Basic testing to ensure IPMI could be enabled/disabled and Redfish
responses were as expected
- Ran redfish validator when NetworkProtocol was returning IPMI disabled
Change-Id: I476361413fdb508c93aea88ca6142bc649562c56
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
|
|
Capturing these possibly overloaded values by reference can avoid a copy
in some cases, and it's good to be consistent.
This change was made automatically by grep/sed.
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iafeaca2a5dc52f39753b5a3880419d6bc943f81b
|
|
It is now Q2 2023, and this option has been deprecated. Maintainers
have not had any reports of this behavior breaking people.
Tested: Code delete only. Code compiles.
Change-Id: I9c1fe26e497806c6bc602fb019bafe0fc80d7619
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
Some OpenBMC systems may have multiple ethernet interfaces available but
choose to only enable a subset of them. In these situations, the bmcweb
code needs to ensure it has the proper logic to determine if a
particular protocol is enabled under the redfish API:
redfish/v1/Managers/bmc/NetworkProtocol
For example, to determine if the IPMI service is enabled, bmcweb looks
at systemd units (phosphor-ipmi-net@<eth>.socket) that are instantiated
based on the ethernet interfaces in the system.
This commit changes the logic which determines if a particular protocol
is enabled to look to see if the systemd service is enabled on _any_
network interface. If it is found on any interface then it is considered
to be enabled. For example, if the netipmid application is running
against any of the available network interfaces then it should be
returned to the user that the IPMI protocol is enabled.
The current behavior of the code is somewhat undefined in that it just
uses the state of the last phosphor-ipmi-net@ethX.socket to determine
what it returns to the user.
Tested:
- Confirmed on system with netipmid running on eth0 and not on eth1 that
response was IPMI enabled
- Confirmed on same system that a POST to disable IPMI worked, netipmid
was stopped, and the NetworkProtocol response indicated IPMI disabled*
- Confirmed on same system that a POST to enable IPMI worked, netipmid
was running on eth0, and the NetworkProtocol response indicated IPMI
enabled
- Confirmed on system with both eth0 and eth1 enabled that we got
expected behavior
- No issues in Redfish Validator
* Testing showed an issue introduced with 5c3e927 where a default of
"Disabled" is no longer returned when services like IPMI and SSH are
disabled. The protocol is simply not shown in the NetworkProtocol
response. It can still be enabled via a PATCH operation. As this issue
is unrelated to this patch, I'll submit a separate commit to discuss
whether we should go back to a default when protocols are disabled.
Change-Id: Ib55914b1403ca96ed7ace450f79af3b47b5c8e59
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
|
|
nlohmann::json::clear() has different behavior dependent on what the
underlying object is, rather than doing the expected behavior of
completely clearing the json object. This didn't matter because of a
similar bug in http_connection that relied on nlohmann:json::empty()
which is ALSO type dependent, so these worked.
Unfortunately, in 02e01b5108d46720a0b438c0d79952464320d954 we wanted to
allow empty objects, and this bug was exposed.
There are two places where clear() is used, once in Response, which is
clearly not the intent, which is to reset the object to the original
constructed state. The other place we call clear is in Manager, where
we use it to clear incremental results. That was a previous best practice that has been eliminated everywhere else (now we return as
many results with the error as we are able). It has been removed.
Tested: Logging into the webui in firefox no longer core dumps.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic89a037b30fb40c0e6eaeb939cae6e006dd0ffac
|
|
Currently http_connection will produce empty body in the response if the
res.jsonValue is empty, including empty array, object.
This makes the output confusing in case a response does contain an empty
object or array.
Change the code to print the json object even if it's empty object or
array.
This patchset was previously reverted because of a regression, but this
regression is fixed in 63529.
Tested on previous commit: With an OEM URL that returns empty array
depending on the system config, the response becomes `[]` instead of
empty.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I1d1bf01a5277ff1bc953b15d9fc410e10f941e70
|
|
boost::beast::http::message::prepare_payload [1] can throw, which isn't
really the behavior we want (as it throws to the io_context). Luckily,
every part of that function is using public methods, and we can simplify
it.
In past commits, we've worked around this issue:
6295becabb9edba2edb53a3c0dddc13d2ffac8dd
This is an attempt to fix it properly.
[1] https://github.com/boostorg/beast/blob/ae01f0201dbf940cbc32d96d7a78dc584a02ab26/include/boost/beast/http/impl/message.hpp#L398
Redfish service validator passes
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie88ddeecfd226bba75a7659cfb7ddddd38eb27cb
|
|
This is a pretty simple test, but should be able to catch the regression
injected in the previous commit.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I67de097059a6e0dd8d2c02c1aa6c69954a6d7be3
|
|
When displaying an integer in HTML, the number of characters is off by 1
causing the numbers to display without the last digit.
This is because the pointer into numberbuffer gets initially advanced by
the number of characters which ends up being one too many.
For example, the buffer pointer is pointing at numberbuffer[0]. If we
display a 4 digit number, we advance by 4, so it ends up pointing at
numberbuffer[4] for the last digit. In the end, we return only the
number of characters which is numberbuffer[0-3] cutting off the last
digit.
This changes the pointer to advance by one less than the number of
digits, so the buffer fills from numberbuffer[3] and returns all 4
digits.
Tested:
Read redfish/v1/SessionService and confirmed that the "SessionTimeout"
value displays the full value of 1800.
Change-Id: Iaa974d7a41352fd9a15024ccf04c5926a4efe7a2
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
|
|
We have no unit tests for this. This isn't very extensive, but we
should have at least one.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I212ee528b354f2ed47f88076be009fd6e16fb760
|
|
Previously, when the SlotType field of a PCIeSlot object in D-Bus was
set to xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.Unknown,
pcie_slots was returning an internal service error. This commit
updates the code to not return the SlotType if it is unknown.
Tested: Validator passed
'''
busctl get-property -j xyz.openbmc_project.Inventory.Manager \
/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane1/nvme5 \
xyz.openbmc_project.Inventory.Item.PCIeSlot SlotType
{
"type" : "s",
"data" : "xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.Unknown"
}
curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots
{
"@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots",
"@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots",
"Id": "1",
"Name": "PCIe Slot Information",
"Slots": [
{
"HotPluggable": false,
"Lanes": 0
},
.....
}
busctl get-property -j xyz.openbmc_project.Inventory.Manager \
/xyz/openbmc_project/inventory/system/chassis/motherboard/pcieslot9 \
xyz.openbmc_project.Inventory.Item.PCIeSlot SlotType
{
"type" : "s",
"data" : "xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.FullLength"
}
curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots
{
"@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots",
"@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots",
"Id": "1",
"Name": "PCIe Slot Information",
"Slots": [
{
"HotPluggable": false,
"Lanes": 0
"SlotType": "FullLength"
},
.....
}
'''
Change-Id: Ib7399cebcb8dd4f9f19014d4d2154bc77e9dc999
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
The GetAllGroups lambda is very long and need to add somemore stuff for
hostconsole work hence moving it in the separate function.
Tested: Created user.
+ curl -k -X POST https://${bmc}/redfish/v1/AccountService/Accounts \
-d '{"UserName": "user99", "Password": "0penBmc0", "RoleId": "Operator"}'
{
"@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."
}
]
}
Change-Id: If62fa803217e43bdecca7965d16c98d852f0b5be
Signed-off-by: Ninad Palsule <ninadpalsule@us.ibm.com>
|
|
This commit implements the Redfish PowerSupply schema and populates
the PowerSupplyCollection members. The PowerSupply is a grandchild
of the PowerSubsystem. PowerSupply is part of the new
PowerSubsystme/ThermalSubsystem schemas, released in Redfish Version
2020.4.
This commit only displays the PowerSupplies in the chassis with
common fields like odata.id, odata.type, Id, and Name. Future commits
will add PowerSupply properties like FirmwareVersion,
LocationIndicatorActive, Status, and Asset information like
SerialNumber, PartNumber, Model.
This commit looks at the powered_by association from
Inventory.Item.Chassis to Inventory.Item.PowerSupply to find a
PowerSupply [1].
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/58609
Tested: Validator passes
1. curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/
PowerSupplies/powersupply0
{
"@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/
PowerSupplies/powersupply0",
"@odata.type": "#PowerSupply.v1_5_0.PowerSupply",
"Id": "powersupply0",
"Name": "powersupply0"
}
2. Bad power supply name
curl -k -H "X-Auth-Token: $token" -X GET
https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/
PowerSupplies/ERROR
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type PowerSupply named 'ERROR'
was not found.",
"MessageArgs": [
"PowerSupply",
"ERROR"
],
"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 PowerSupply named 'ERROR'
was not found."
}
}
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I7b7c0e40c090a3f253f1a778edbe36be9b4317b0
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Previously, we had a pattern where we would call the HEAD handler for a
route in the GET handler. Unfortunately, this leads to the error from
setupRedfishRoute to not be handled, which means that for these routes,
400 isn't processed properly.
This is same fix as https://gerrit.openbmc.org/c/openbmc/bmcweb/+/63526/
Tested: TODO will test the top commit.
Change-Id: I1ab51e397072cb0d60bddffcfbe8df71b56a4f42
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
Previously, we had a pattern where we would call the HEAD handler for a
route in the GET handler. Unfortunately, this leads to the error from
setupRedfishRoute to not be handled, which means that for these routes,
400 isn't processed properly.
Fix the code.
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I324cc9582f2368a08265e1defee5b6c56ded3267
|
|
Neither of these files make use of io_context, so they shouldn't be here
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I86c195a5881a50a275e977aa73b9d7144b53844b
|
|
When passing arrays of json objects around, we should be using the
native nlohmann::json::array_t, rather than using an nlohmann::json, and
interpreting it as an array. This improves our type safety.
Tested:
EthernetInterfaces returns the same value as before. Redfish service
validator shows no new failures on those interfaces.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I609205832a6e99a23b4764be30045a456021fe44
|
|
None of these are actually used as a set, we should avoid taking the
overhead of using these as a set.
Tested in next commit.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I7a7f2c9761a2adc70f6c6ab127facc9d801a2209
|
|
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/44438/ merged and looks
for obmc-console-ssh and fills the port info out.
Tested: None.
Change-Id: Ie9129af37e8b44bd52c462d9f1e4ff7d54dc0e14
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
Boost 1.82 dropped a lovely new toy, boost::urls::format, which is a lot
like our urlFromPieces method, but better in that it makes the resulting
uris more readable, and allows doing things like fragments in a single
line instead of multiple. We should prefer it in some cases.
Tested:
Redfish service validator passes.
Spot checks of URLs work as expected.
Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ia7b38f0a95771c862507e7d5b4aa68aa1c98403c
|
|
We get 500 Internal Server Error when we try to replace certificate
without providing certificate but expected response is 400 Bad Request.
So fixed the issue by removal of overriding the error code.
Tested:
Response for attempt to replace certificate without certificate or
without required json key
Before changes:
500 Internal Server Error
After changes:
400 Bad Request
Change-Id: I7f672d40f73f8cd1491625ba6714bd3ad2594faf
Signed-off-by: vijayabharathi shetty <vijayabharathix.shetty@intel.com>
|
|
This commit addresses the incorrect placement and missing documentation
of PCIeDevice properties. The properties have been moved to the correct
location and all missing details have been added.
913e7732 added the asset properties in the wrong spot.
62cd45af added the pcietype property.
f5c9f8bd added the deviceType.
No testing has been performed for this change.
Tested: None
Change-Id: I3574a67c4d1cdb22d6f3dc748b80b6266ed2164c
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Fixes this warning:
WARNING: Running the setup command as `meson [options]` instead of
`meson setup [options]` is ambiguous and deprecated.
Seen a few other repos do this like:
https://github.com/openbmc/phosphor-hwmon/commit/46a29b7f21c03fbe7230abc6feff3991efd9f76b
Tested: The following work:
meson setup builddir
ninja -C builddir
Change-Id: I3176fbf0df064c17473f5fc6ad723ca03ed0d04f
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
When the Generation field of a PCIeSlot object in D-Bus is set to
"xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown",
pcie_slots was returning an invalid PCIeType of "false". This caused
the Redfish validator to fail. To resolve this, the code has been
updated to not return the PCIeType if the Generation field is empty
or unknown.
Tested: Validator passed
'''
busctl get-property -j xyz.openbmc_project.Inventory.Manager \
/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/nvme0 \
xyz.openbmc_project.Inventory.Item.PCIeSlot Generation
{
"type" : "s",
"data" : "xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Unknown"
}
curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots
{
"@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots",
"@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots",
"Id": "1",
"Name": "PCIe Slot Information",
"Slots": [
{
"HotPluggable": false,
"Lanes": 0,
"SlotType": "U2"
},
.....
}
busctl set-property xyz.openbmc_project.Inventory.Manager \
/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/nvme0 \
xyz.openbmc_project.Inventory.Item.PCIeSlot Generation s \
xyz.openbmc_project.Inventory.Item.PCIeSlot.Generations.Gen1
curl -k https://$bmc/redfish/v1/Chassis/chassis/PCIeSlots
{
"@odata.id": "/redfish/v1/Chassis/chassis/PCIeSlots",
"@odata.type": "#PCIeSlots.v1_4_1.PCIeSlots",
"Id": "1",
"Name": "PCIe Slot Information",
"Slots": [
{
"HotPluggable": false,
"Lanes": 0,
"PCIeType": "Gen1",
"SlotType": "U2"
},
....
}
'''
Change-Id: I143ce7e90cf24447a667a09d946e42f00c091a64
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
This commit is to add state information according to the Redfish
PCIeDevice schema. Default state is "Enabled".
ref: https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_9_0.json
Tested: Validator passed
'''
curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card8
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "pcie_card8",
"Manufacturer": "",
"Model": "6B87",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card8/PCIeFunctions"
},
"PCIeInterface": {
"LanesInUse": -1
},
"PartNumber": "03FL194",
"SerialNumber": "Y131UF09S00J",
"Slot": {
"Location": {
"PartLocation": {
"ServiceLabel": "U78DB.ND0.WZS0018-P0-C8"
}
}
},
"SparePartNumber": "03FL195",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
'''
Change-Id: Ibee01345c81c2e824fc2387c4f27e421b3f4c507
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
Remove Manufacturer from the PCIeDevice's PCIeInterface and fix the
following Redfish validator error:
ERROR - Manufacturer not defined in Complex PCIeInterface
PCIeDevice.v1_3_0.PCIeInterface (check version, spelling and casing)
This error is because there is no ["PCIeInterface"]["Manufacturer"] at
https://redfish.dmtf.org/schemas/v1/PCIeDevice.v1_11_0.json.
"Manufacturer" is already part of the root PCIeDevice and is
implemented on line 219.
On the backend "Manufacturer" is already part of Asset interface so
remove it from PCIeDevice interface in peci-pcie and
phosphor-dbus-interface.
phosphor-dbus-interfaces commit:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/61738
peci-pcie commit:
https://gerrit.openbmc.org/c/openbmc/peci-pcie/+/62256
Tested:
```
curl -k https://$bmc/redfish/v1/Systems/system/PCIeDevices/pcie_card10
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "pcie_card10",
"Manufacturer": "",
"Model": "6B87",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card10/PCIeFunctions"
},
"PCIeInterface": {
"LanesInUse": 16,
"PCIeType": "Gen4"
},
"PartNumber": "03FL204",
"SerialNumber": "YA31UF07200Z",
"Slot": {
"Location": {
"PartLocation": {
"ServiceLabel": "U78DA.ND0.WZS003T-P0-C10"
}
}
},
"SparePartNumber": "03FL205"
}
```
Change-Id: I860bf60f6fa3cc5d6b57f945d781e7dcafc17d7f
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
|
|
This reverts commit 02e01b5108d46720a0b438c0d79952464320d954.
This commit is being reverted because it causes login failures on
Firefox browsers. This commit originally was added with the idea that
it did not fix anything on upstream, but made some peoples forks better.
It appears to have broken some upstream things, so the right thing to do
is to revert it until those breakages can be understood.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I04de84fca1a8de657f6941653f2a3e595ee725d5
|