116370d8 | 08-Oct-2024 |
Ed Tanous <etanous@nvidia.com> |
Break out lambdas in http server
These lambdas originally came from crow[1] and are a lot harder to maintain than normal methods. Move to normal methods.
Tested: Unit tests pass. Good coverage on
Break out lambdas in http server
These lambdas originally came from crow[1] and are a lot harder to maintain than normal methods. Move to normal methods.
Tested: Unit tests pass. Good coverage on connection class.
[1] https://github.com/CrowCpp/Crow/blob/master/include/crow/http_connection.h#L485
Change-Id: I9b177a0c456e44a261ea335f68354ad857739662 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
56ba386d | 10-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Fix Persistent Subscription PATCH
The `RedfishEvent` subscription is expected to be persistent over bmc reboot or bmcweb restart. However, the properties on PATCH are currently not persistent after
Fix Persistent Subscription PATCH
The `RedfishEvent` subscription is expected to be persistent over bmc reboot or bmcweb restart. However, the properties on PATCH are currently not persistent after reboot or bmcweb restart.
This commit is to sync those properties to the persistent store after PATCH.
In addition, this commit fixes a missing `id` copy when a new UserSubscription is created in [1] (introduced by [2]). As a result, it may cause the following messages during bmcweb start after subscription POST or PATCH like ``` Oct 16 14:37:34 p10bmc systemd[1]: Started Start bmcwebd server. Oct 16 14:37:34 p10bmc bmcwebd[15320]: [ERROR event_service_store.hpp:253] Subscription missing required field information, refusing to restore Oct 16 14:37:34 p10bmc bmcwebd[15320]: [ERROR persistent_data.hpp:166] Problem reading subscription from persistent store ``` After this, those subscriptions become lost.
Tested:
1. Subscription PATCH
- Create a subscription (e.g. use Redfish-Service-Validator).
- GET subscription and check the properties ``` SUBID=<id> curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions/${SUBID} ```
- PATCH subscription with a different value. ``` curl -k -X PATCH https://${bmc}/redfish/v1/EventService/Subscriptions/${SUBID} \ -H "Content-Type: application/json" -d '{"DeliveryRetryPolicy":"RetryForever"}' ```
- Reboot BMC or restart bmcweb
- GET subscription and check the properties ``` curl -k -X GET https://${bmc}/redfish/v1/EventService/Subscriptions/${SUBID} ````
Before the fix, the property values are the same as before PATCH. After the fix, the last patched property values will be kept.
2. Redfish Service Validator passes
[1] https://github.com/openbmc/bmcweb/blob/21a94d5cd4be74a85c978c0cd63e4c633093c531/redfish-core/include/event_service_manager.hpp#L812 [2] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/65720
Change-Id: If5d2f622cc945faa6999d1e3e70211e881e19a79 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
7585b760 | 17-Oct-2024 |
Jishnu CM <jishnunambiarcm@duck.com> |
Adds redfish error for GenerateSecretKeyRequired
This commit contains the redfish error to be returned when it finds that MFA is enabled and the user has to generate secret key to proceed further.
Adds redfish error for GenerateSecretKeyRequired
This commit contains the redfish error to be returned when it finds that MFA is enabled and the user has to generate secret key to proceed further.
Used and tested in https://gerrit.openbmc.org/c/openbmc/bmcweb/+/74938.
Change-Id: If13b96729510fc7b165aa792f1e1d23a811ca733 Signed-off-by: Jishnu CM <jishnunambiarcm@duck.com>
show more ...
|
340d74c8 | 12-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Handling of OutOfRange in ReadJson
Currently readJsonPatch returns `PropertValueNotInList` in case when an input integer is out of range. This change is to return `PropertyValueOutOfRange` for the
Handling of OutOfRange in ReadJson
Currently readJsonPatch returns `PropertValueNotInList` in case when an input integer is out of range. This change is to return `PropertyValueOutOfRange` for the case out-of-range integer input.
Tested:
- Verify PATCH with an out-of-value integer. e.g. ``` $ curl -k -X PATCH https://${bmc}/redfish/v1/EventService/ -H "Content-Type: application/json" -d '{ "DeliveryRetryIntervalSeconds" : 4294967296}' ```
Before the change, its `MessageId` is `PropertyValueNotInList`. ``` "Message": "The value '4294967296' for the property DeliveryRetryIntervalSeconds is not in the list of acceptable values.", "MessageId": "Base.1.19.0.PropertyValueNotInList", "MessageSeverity": "Warning", "Resolution": "Choose a value from the enumeration list that the implementation can support and resubmit the request if the operation failed." ```
After the change, its `MessageId` will be `PropertyValueOutOfRange`.
``` "Message": "The value '4294967296' for the property DeliveryRetryIntervalSeconds is not in the supported range of acceptable values.", "MessageId": "Base.1.19.0.PropertyValueOutOfRange", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." ```
- Redfish Service Validator passes
Change-Id: I0d0c5ecbc9f416b68fa7c0e81a0ea896ec2e50af Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
788b091b | 14-Oct-2024 |
Igor Kanyuka <ifelmail@gmail.com> |
Event: Change MemberId type to string
The type of the MemberId according to the schema https://redfish.dmtf.org/schemas/v1/Event.v1_4_0.json is string and not int. This prevents the request from be
Event: Change MemberId type to string
The type of the MemberId according to the schema https://redfish.dmtf.org/schemas/v1/Event.v1_4_0.json is string and not int. This prevents the request from being deserialized by clients written in typed languages.
Change-Id: Ic1a00044fdb71e20cb96d4256e935f59bf79da8f Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
show more ...
|
0183e476 | 10-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
meson: nlohmann-json: update to 3.11.3
Update the version reference in meson.build to match the subproject wrap file: 3.11.3.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I15f0d69
meson: nlohmann-json: update to 3.11.3
Update the version reference in meson.build to match the subproject wrap file: 3.11.3.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I15f0d697eaae8cfd48c638909dbb35b129bce910
show more ...
|
5900d4c3 | 10-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-tidy: add misc-include-cleaner fixes
Fix the following clang-tidy errors: ``` ../redfish-core/src/filter_expr_executor.cpp:102:21: error: no header providing "nlohmann::json" is directly inclu
clang-tidy: add misc-include-cleaner fixes
Fix the following clang-tidy errors: ``` ../redfish-core/src/filter_expr_executor.cpp:102:21: error: no header providing "nlohmann::json" is directly included [misc-include-cleaner,-warnings-as-errors] 7 | const nlohmann::json& body; ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I2e0d66bb35c1010607b9795d00b3321dc20d6d65
show more ...
|
21a94d5c | 14-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Fix coredump during subscription
Commit 4b712a29debc1a0860cc04850b262203cad402a5 [1] a bug on missing the subscription copy from user persistent data when subscription object is created, and it may
Fix coredump during subscription
Commit 4b712a29debc1a0860cc04850b262203cad402a5 [1] a bug on missing the subscription copy from user persistent data when subscription object is created, and it may cause a bmcweb crash.
Tested:
- Create subscription (e.g. Redfish Event Listener)
- Create a dump ``` curl -k -X POST "https://${bmc}/redfish/v1/Managers/bmc/LogServices/Dump/Actions/LogService.CollectDiagnosticData" \ -H "Content-Type: application/json" -d '{"DiagnosticDataType": "Manager"}'
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0 ```
BMC journal will contain like ``` Oct 14 21:49:20 p10bmc bmcwebd[287]: terminate called after throwing an instance of 'std::bad_weak_ptr' Oct 14 21:49:20 p10bmc bmcwebd[287]: what(): bad_weak_ptr Oct 14 21:49:21 p10bmc systemd[1]: bmcweb.service: Main process exited, code=dumped, status=6/ABRT Oct 14 21:49:21 p10bmc systemd[1]: bmcweb.service: Failed with result 'core-dump'
``` [1] 4b712a29debc1a0860cc04850b262203cad402a5
Change-Id: I58479bb5e1f203fec60ad0971f0c750ab5695f14 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
afc474ae | 09-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Format readjson
clang-format may potentially reformat the readJson calls if they may have more keys or key names are longer. This makes formatting in a way that's readable by forcing to break a line
Format readjson
clang-format may potentially reformat the readJson calls if they may have more keys or key names are longer. This makes formatting in a way that's readable by forcing to break a line for each key using an empty-comment (`//`) each line.
It also allows trivially alphabetizing the list such that new additions are less likely to have merge conflicts.
Tested: - Check whitespace only. - Code compiles. - Redfish Service Validator with the same results before this
Change-Id: I3824a8c4faa9fa7c820d5d2fab6b565404926e2c Signed-off-by: Ed Tanous <etanous@nvidia.com> Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
6fe8751c | 20-Jul-2023 |
George Liu <liuxiwei@inspur.com> |
Implement TemperatureReadingsCelsius property for ThermalMetrics
The ThermalMetrics schema[1] provides for efficient thermal metric gathering for thermal sensors. The schema allows retrieving just t
Implement TemperatureReadingsCelsius property for ThermalMetrics
The ThermalMetrics schema[1] provides for efficient thermal metric gathering for thermal sensors. The schema allows retrieving just the thermal metrics with one Redfish URI. This prevents the additional work required when returning all the sensor data, or multiple Redfish URI calls to retrieve the properties for all of the thermal sensors.
This commit implements the TemperatureReadingsCelsius property of ThermalMetrics[1]. ThermalMetrics is a property of ThermalSubsystem[2]. TemperatureReadingsCelsius is a SensorArrayExcerpt[3].
[1] https://redfish.dmtf.org/schemas/v1/ThermalMetrics.v1_0_1.json [2] https://redfish.dmtf.org/schemas/v1/ThermalSubsystem.v1_3_2.json [3] http://redfish.dmtf.org/schemas/v1/Sensor.v1_9_0.json#/definitions/SensorArrayExcerpt
The temperature sensors are found by finding 'all_sensors' endpoints for specific chassis of D-Bus service /xyz/openbmc_project/sensors/temperature. An entry of SensorArrayExcerpt is built for each temperature sensor retrieved.
Implementation Notes: - Common function sensor_utils::objectPropertiesToJson() is used to fill in sensor excerpt properties. Currently the only excerpt ChassisSubNode is ThermalMetrics. However there are others excerpts defined by Redfish. Right now mostly this is just skipping things, but I'm expecting when other sensor excerpts are implemented that some of the other properties may be added for excerpts as well. I'm expecting the combination of the chassisSubNode and the sensorType will be used to determine which properties are included for a particular call to build a sensor Json representation. - New sensor_utils::objectExcerptToJson() function created. This wraps sensor_utils::objectPropertiesToJson() and builds DataSourceUri for a sensor excerpt. - New sensor_utils::getAllSensorObjects() function created. This builds list of 'all_sensors' association endpoints for specified D-Bus path with specified D-Bus interfaces. Callback function is called with list for handling sensors.
Tested: 1. Redfish Service Validator passed. 2. doGet method: ``` curl -k -H "X-Auth-Token: ${token}" -X GET https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/ThermalMetrics { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/ThermalMetrics", "@odata.type": "#ThermalMetrics.v1_0_1.ThermalMetrics", "Id": "ThermalMetrics", "Name": "Thermal Metrics", "TemperatureReadingsCelsius": [ { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps0_temp0", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps0_temp1", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps0_temp2", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp0", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp1", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp2", "Reading": -131072000.0 } ], "TemperatureReadingsCelsius@odata.count": 6 } ```
3. Verification of DataSourceUri: ``` curl -k -H "X-Auth-Token: ${token}" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp0 { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp0", "@odata.type": "#Sensor.v1_2_0.Sensor", "Id": "temperature_ps1_temp0", "Name": "ps1 temp0", "Reading": -131072000.0, "ReadingType": "Temperature", "ReadingUnits": "Cel", "Status": { "Health": "OK", "State": "Enabled" } } ```
4. A bad chassis ID: ``` curl -k -H "X-Auth-Token: ${token}" -X GET https://${bmc}/redfish/v1/Chassis/chassisBAD/ThermalSubsystem/ThermalMetrics { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Chassis named 'chassisBAD' was not found.", "MessageArgs": [ "Chassis", "chassisBAD" ], "MessageId": "Base.1.18.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.18.1.ResourceNotFound", "message": "The requested resource of type Chassis named 'chassisBAD' was not found." } } ```
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I6e4ed1f281fd5371c978983b6cc5666badd3752c Signed-off-by: Janet Adkins <janeta@us.ibm.com>
show more ...
|
d3a48a14 | 25-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Refactor eventMatchesFilter
eventMatchesFilter no longer needs to be a member of the Subscription class, because it no longer uses subscription data. Refactor so it can be in its own file, with its
Refactor eventMatchesFilter
eventMatchesFilter no longer needs to be a member of the Subscription class, because it no longer uses subscription data. Refactor so it can be in its own file, with its own set of unit tests.
Tested: Unit Tests pass.
Change-Id: I718fa36021078973609591c704cb717d31079df7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
4b712a29 | 02-Aug-2023 |
Ed Tanous <edtanous@google.com> |
Move UserSubscription to composition
This allows for two very important simplifying changes. First, we can use the default copy operators on the UserSubscription class, which is far less error pron
Move UserSubscription to composition
This allows for two very important simplifying changes. First, we can use the default copy operators on the UserSubscription class, which is far less error prone than writing it manually, which we have two copies of in code already.
Second, it allows the Subscription class to move to using values rather than shared_ptr everywhere, which cleans up a significant amount of code.
Tested: Ran Redfish-Event-Listener, subscription created and destroyed correctly. Calling POST SubmitTestEvent showed events propagating to server.
Change-Id: I6d258cfe3594edddf3960ae2d4559d70acca1bf8 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
41868c66 | 09-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Reformat with Never-AlignTrailingComments style
clang-format currently formats the codes to align the trailing comments of the consecutive lines via `AlignTrailingComments/Kind` as `Always` in `.cla
Reformat with Never-AlignTrailingComments style
clang-format currently formats the codes to align the trailing comments of the consecutive lines via `AlignTrailingComments/Kind` as `Always` in `.clang-format` file.
This could shift the comment lines by the neighboring code changes and also potentially mislead the `diff` of code changes.
This commit is to keep the existing trailing comments as they were.
Tested: - Check whitespace only - Code compiles & CI passes.
Change-Id: I1c64d53572a81d5012aa748fe44478f80c271c5f Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
a9d7fe10 | 10-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
subprojects: nlohmann-json: update to 3.11.3
3.11.2 has a bug where it does not generate `json_fwd.hpp`, which is required by sdbusplus. This is fixed in 3.11.3. Use `meson wrap update nlohmann_js
subprojects: nlohmann-json: update to 3.11.3
3.11.2 has a bug where it does not generate `json_fwd.hpp`, which is required by sdbusplus. This is fixed in 3.11.3. Use `meson wrap update nlohmann_json` to get the latest WrapDB version.
Tested:
Using the base Docker container from openbmc-build-scripts, previously there was the following compile issue:
``` In file included from ../subprojects/sdbusplus/include/sdbusplus/bus.hpp:6, from ../subprojects/sdbusplus/src/bus.cpp:1: ../subprojects/sdbusplus/include/sdbusplus/exception.hpp:5:10: fatal error: nlohmann/json_fwd.hpp: No such file or directory 5 | #include <nlohmann/json_fwd.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~ ```
This is resolved now.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6e30bf10f1b5ef4b0424b39314c9dcfb718cd890
show more ...
|
d8e2b618 | 08-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Fix PowerSupply GET error
The commit 3e42a3290ae35f05b30fa1863f44e95845577420[1] mistakenly handled a check of then given powersupply id, and caused Redfish Service Validator error.
Tested: - Verif
Fix PowerSupply GET error
The commit 3e42a3290ae35f05b30fa1863f44e95845577420[1] mistakenly handled a check of then given powersupply id, and caused Redfish Service Validator error.
Tested: - Verify GET ``` curl -k https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply0 ```
- Redfish Service Validator on PowerSupplies passes ``` python3 RedfishServiceValidator.py --auth Session -i https://${bmc} -u ${user} -p ${password} \ --payload Tree /redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies ```
[1] https://github.com/openbmc/bmcweb/commit/3e42a3290ae35f05b30fa1863f44e95845577420
Change-Id: I9abfadc5f1ad5a0fd05e596190678aa804259045 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
89449bbe | 12-Aug-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
update service: update the updateable BMC
Update the updateable BMC rather than functional BMC because for dual image systems functional BMC is not updated in place.
Tested: ``` > curl -k -H "X-Aut
update service: update the updateable BMC
Update the updateable BMC rather than functional BMC because for dual image systems functional BMC is not updated in place.
Tested: ``` > curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/octet-stream" -X POST -T obmc-phosphor-image-romulus-20240529184214.static.mtd.tar https://${bmc}/redfish/v1/UpdateService/update { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "Id": "0", "TaskState": "Running", "TaskStatus": "OK" } ```
Change-Id: Ia11bd276ba5ac1d849942b33a7b6c50e74335024 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
e9f12014 | 08-Oct-2024 |
Ed Tanous <etanous@nvidia.com> |
Add unit test for trailing slashes
Common error #9 requires that most urls end in a trailing slash. Given the redfish standard, we know that all redfish routes need to end in a trailing slash, so w
Add unit test for trailing slashes
Common error #9 requires that most urls end in a trailing slash. Given the redfish standard, we know that all redfish routes need to end in a trailing slash, so write a unit test that verifies that is true.
Despite code review, this appears to have snuck into the codebase in 4 different handlers. Fix those at the same time so the tests pass.
Tested: Unit tests pass.
Change-Id: I0299a7231662725a7100d5308b3977a549b49253 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
b5190062 | 10-Jul-2024 |
Hieu Huynh <hieuh@os.amperecomputing.com> |
Support ProductionDate report
DSP0268 Redfish Data Model Specification provides ProductionDate property for various schema. phosphor-dbus-interface [1] also supports BuildDate property which we can
Support ProductionDate report
DSP0268 Redfish Data Model Specification provides ProductionDate property for various schema. phosphor-dbus-interface [1] also supports BuildDate property which we can map from FRU data, like `Board Manufacturer Date`. This adds code to support which gets the date from BuildDate property and report via Redfish.
[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Inventory/Decorator/Asset.interface.yaml#L16
Tested: Redfish Validator passes
Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com> Change-Id: Ie4ae564fa00218e7896f04ec61941fa92b23b912
show more ...
|
15b6f9f9 | 30-May-2024 |
Ed Tanous <ed@tanous.net> |
Write test to ensure that redfish validates
Dependent on configuration options, we might have overlapping paths, as what had to be fixed in: 36a59eafed32c0063d444fc0722f899c0024092d and 5ffd11f248f1
Write test to ensure that redfish validates
Dependent on configuration options, we might have overlapping paths, as what had to be fixed in: 36a59eafed32c0063d444fc0722f899c0024092d and 5ffd11f248f155614bf30b498cb01a4e2065094d
We should be able to catch these in a unit test, so this commit adds a test that initializes the Redfish tree, and ensures that the router validates. In theory this will catch any misconfigurations we might have.
Tested: Unit tests pass.
Change-Id: I8721380c96301b57e40819f5ae2e725057ea1bb7 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
352e3b78 | 04-Oct-2024 |
Hieu Huynh <hieuh@os.amperecomputing.com> |
dateStringToEpoch: add the additional format
This adds the additional format for ISO 8601, such as YYYYMMDD or YYYYMMDDThhmmssZ.
Tested:
Test case 1: The input ISO 8601 timestamp: 20230531T000000Z
dateStringToEpoch: add the additional format
This adds the additional format for ISO 8601, such as YYYYMMDD or YYYYMMDDThhmmssZ.
Tested:
Test case 1: The input ISO 8601 timestamp: 20230531T000000Z The output Epoch timestamp: 1685491200000000
Test case 2: The input ISO 8601 timestamp: 20230531 The output Epoch timestamp: 1685491200000000
Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com> Change-Id: I23080a466b2edeecb5d8a4fb7ec0b00739454056
show more ...
|
3e42a329 | 26-Jun-2024 |
Lakshmi Yadlapati <lakshmiy@us.ibm.com> |
Refactor mapper calls to use getAssociatedSubTreePathsById
This commit refactors power_supply to use the new ObjectMapper method `getAssociatedSubTreePathsById`. Replaced the two separate mapper cal
Refactor mapper calls to use getAssociatedSubTreePathsById
This commit refactors power_supply to use the new ObjectMapper method `getAssociatedSubTreePathsById`. Replaced the two separate mapper calls `getValidChassisPath` and `getAssociatedSubTreePaths` with one call to `getAssociatedSubTreePathsById`.
Tested: Validator passed 1. List Powersupplies in the system
``` curl -k https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies", "@odata.type": "#PowerSupplyCollection.PowerSupplyCollection", "Description": "The collection of PowerSupply resource instances.", "Members": [ { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply0" }, { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply1" }, { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply2" }, { "@odata.id": "/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply3" } ], "Members@odata.count": 4, "Name": "Power Supply Collection" } ```
2. List powersupply0 properties
``` curl -k 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", "EfficiencyRatings": [ { "EfficiencyPercent": 90 } ], "FirmwareVersion": "030303030303", "Id": "powersupply0", "Location": { "PartLocation": { "ServiceLabel": "U78DB.ND0.WZS002U-E0" } }, "LocationIndicatorActive": false, "Manufacturer": "", "Model": "2B1E", "Name": "Power Supply", "PartNumber": "03FP729", "SerialNumber": "YL30NH1BN229", "SparePartNumber": "03FP728", "Status": { "Health": "OK", "State": "Enabled" } } ```
3. Error condition, list unknown powersupply
``` curl -k https://${bmc}/redfish/v1/Chassis/chassis/PowerSubsystem/PowerSupplies/powersupply8 { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type PowerSupplies named 'powersupply8' was not found.", "MessageArgs": [ "PowerSupplies", "powersupply8" ], "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 PowerSupplies named 'powersupply8' was not found." } } ```
4. Error condition, list unknown invalid chassis ``` curl -k https://${bmc}/redfish/v1/Chassis/InvalidChassis/PowerSubsystem/PowerSupplies/powersupply0 { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Chassis named 'InvalidChassis' was not found.", "MessageArgs": [ "Chassis", "InvalidChassis" ], "MessageId": "Base.1.18.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.18.1.ResourceNotFound", "message": "The requested resource of type Chassis named 'InvalidChassis' was not found." } } ```
Change-Id: I07043b15cbfa0ac9a44cbf155fad3315eeacc859 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com> Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
1f1fb4f5 | 02-Oct-2024 |
Gunnar Mills <gmills@us.ibm.com> |
Extend multi system date
There was interest in discord on this. [1]. Extend the date until March 1st since we are already past Sept 1st by a month.
Don't feel keeping this causes us much harm.
[1]
Extend multi system date
There was interest in discord on this. [1]. Extend the date until March 1st since we are already past Sept 1st by a month.
Don't feel keeping this causes us much harm.
[1]: https://discord.com/channels/775381525260664832/1291015132851212330/1291070549128253501
Tested: None. Inspection only.
Change-Id: Ie318b57f60c68325a3be9707a5de869d73f69966 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
4e196b9a | 27-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
json utility: Update sort algorithms
Modified sort utility to be able to sort on a specified key. New utility function sortJsonArrayByKey() added.
Note: - Function odataObjectCmp() renamed to obje
json utility: Update sort algorithms
Modified sort utility to be able to sort on a specified key. New utility function sortJsonArrayByKey() added.
Note: - Function odataObjectCmp() renamed to objectKeyCmp() - New function odataObjectCmp() created which calls objectKeyCmp() with @odata.id key specified. - Comments for odataObjectCmp() didn't match behavior for object without key. These objects are sorted as less than objects with the key. - sortJSONResponse() modified to use the new sortJsonArrayByKey().
Tested: - Added new unit tests. These tests are in addition to the existing tests. So they focus on testing comparing by different keys. The existing tests already cover the different permutations of the basic comparisons. - Redfish Service validator passes
Change-Id: I949b7cb868c59a8eeda3798e6a82a1572bbc5792 Signed-off-by: Ed Tanous <etanous@nvidia.com> Signed-off-by: Janet Adkins <janeta@us.ibm.com>
show more ...
|
c5bcf35f | 25-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Add searchable macros
Now that we consistently match our options to our macros, we can add some comments into the meson.options to make it so that when that macro is searched, it will pop up correct
Add searchable macros
Now that we consistently match our options to our macros, we can add some comments into the meson.options to make it so that when that macro is searched, it will pop up correctly.
Tested: No functional change.
Change-Id: I0cf26cac084b845229b9e39993fbc566a3bb6532 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
b575caef | 01-Oct-2024 |
Jishnu CM <jishnunambiarcm@duck.com> |
Bump base registry to 1.19.0
Adds GenerateSecretKeyRequired registry to the Base for MFA
Change-Id: Ia690639b4bebbbd265b223bd626b0eb814103f99 Signed-off-by: Jishnu CM <jishnunambiarcm@duck.com> |