History log of /openbmc/bmcweb/features/redfish/lib/managers.hpp (Results 101 – 125 of 189)
Revision Date Author Comments
# ed398213 09-Jun-2021 Ed Tanous <edtanous@google.com>

Automate PrivilegeRegistry to code

This commit attempts to automate the creation of our privileges
structures from the redfish privilege registry. It accomplishes this by
updating parse_registries.

Automate PrivilegeRegistry to code

This commit attempts to automate the creation of our privileges
structures from the redfish privilege registry. It accomplishes this by
updating parse_registries.py to also pull down the privilege registry
from DMTF.
The script then generates privilege_registry.hpp, which include const
defines for all the privilege registry entries in the same format that
the Privileges struct accepts. This allows new clients to simply
reference the variable to these privilege structures, instead of having
to manually (ie error pronely) put the privileges in themselves.

This commit updates all the routes.

For the moment, override and OEM schemas are not considered. Today we
don't have any OEM-specific Redfish routes, so the existing ones inherit
their parents schema. Overrides have other issues, and are already
incorrect as Redfish defines them.

Binary size remains unchanged after this patchset.

Tested:
Ran redfish service validator

Ran test case from f9a6708c4c6490257e2eb6a8c04458f500902476 to ensure
that the new privileges constructor didn't cause us to regress the brace
construction initializer.

Checked binary size with:
gzip -c
$BBPATH/tmp/work/s7106-openbmc-linux-gnueabi/obmc-phosphor-image/1.0-r0/rootfs/usr/bin/bmcweb
| wc -c
1244048

(tested on previous patchset)

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

show more ...


# 7c8c4058 04-Jun-2021 Tejas Patil <tejaspp@ami.com>

Add DateTime & Offset in Managers & LogServices

This commit adds the support for "DateTimeLocalOffset" property under
"/redfish/v1/Managers/bmc/" Redfish URI.
And it also adds the support for "DateT

Add DateTime & Offset in Managers & LogServices

This commit adds the support for "DateTimeLocalOffset" property under
"/redfish/v1/Managers/bmc/" Redfish URI.
And it also adds the support for "DateTime" & "DateTimeLocalOffset"
properties under "/redfish/v1/Systems/system/LogServices/<id>/" &
"/redfish/v1/Managers/bmc/LogServices/<id>/" Redfish URI's.

These properties shows the current Date, Time & the UTC offset that the
current DateTime property value contains.

Tested:

- Redfish Validator Test passed.

curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X GET https://${bmc}/redfish/v1/Managers/bmc/
{
"@odata.id": "/redfish/v1/Managers/bmc",
"@odata.type": "#Manager.v1_11_0.Manager",
"Actions": {
"#Manager.Reset": {
"@Redfish.ActionInfo": "/redfish/v1/Managers/bmc/ResetActionInfo",
"target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset"
},
"#Manager.ResetToDefaults": {
"ResetType@Redfish.AllowableValues": [
"ResetAll"
],
"target": "/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults"
}
},
"DateTime": "2021-06-04T12:18:28+00:00",
"DateTimeLocalOffset": "+00:00",
"Description": "Baseboard Management Controller",
"EthernetInterfaces": {
"@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces"
},
"FirmwareVersion": "2.11.0-dev-114-gc1989599d",
"GraphicalConsole": {
"ConnectTypesSupported": [
"KVMIP"
],
"MaxConcurrentSessions": 4,
"ServiceEnabled": true
},
"Id": "bmc",
"LastResetTime": "2021-06-04T12:07:02+00:00",
"Links": {
"ActiveSoftwareImage": {
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/419c86fb"
},
"ManagerForServers": [
{
"@odata.id": "/redfish/v1/Systems/system"
}
],
"ManagerForServers@odata.count": 1,
"SoftwareImages": [
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/419c86fb"
}
],
"SoftwareImages@odata.count": 1
},
"LogServices": {
"@odata.id": "/redfish/v1/Managers/bmc/LogServices"
},
"ManagerType": "BMC",
"Model": "OpenBmc",
"Name": "OpenBmc Manager",
"NetworkProtocol": {
"@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol"
},
"Oem": {
"@odata.id": "/redfish/v1/Managers/bmc#/Oem",
"@odata.type": "#OemManager.Oem",
"OpenBmc": {
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc",
"@odata.type": "#OemManager.OpenBmc",
"Certificates": {
"@odata.id": "/redfish/v1/Managers/bmc/Truststore/Certificates"
}
}
},
"PowerState": "On",
"SerialConsole": {
"ConnectTypesSupported": [
"IPMI",
"SSH"
],
"MaxConcurrentSessions": 15,
"ServiceEnabled": true
},
"ServiceEntryPointUUID": "1832ebbb-0b54-44e9-90d7-b49108f6863c",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"UUID": "7fe3d13d-4ae7-4a4f-add1-2d60308124b4"
}

curl -k -H "X-Auth-Token: $token" -H "Content-Type: application/json" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/EventLog/
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog",
"@odata.type": "#LogService.v1_1_0.LogService",
"Actions": {
"#LogService.ClearLog": {
"target": "/redfish/v1/Systems/system/LogServices/EventLog/Actions/LogService.ClearLog"
}
},
"DateTime": "2021-06-04T12:11:10+00:00",
"DateTimeLocalOffset": "+00:00",
"Description": "System Event Log Service",
"Entries": {
"@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries"
},
"Id": "EventLog",
"Name": "Event Log Service",
"OverWritePolicy": "WrapsWhenFull"
}

Signed-off-by: Tejas Patil <tejaspp@ami.com>
Change-Id: I416d13ae11e236cf4552f817a9bd69b48f9b5afb

show more ...


# 0e8ac5e7 06-Nov-2020 Gunnar Mills <gmills@us.ibm.com>

Move Consoles to ComputerSystem

2020.3 moved SerialConsole and GraphicalConsole to ComputerSystem.

More information can be found on:
http://www.dmtf.org/sites/default/files/Redfish_Release_2020.3_O

Move Consoles to ComputerSystem

2020.3 moved SerialConsole and GraphicalConsole to ComputerSystem.

More information can be found on:
http://www.dmtf.org/sites/default/files/Redfish_Release_2020.3_Overview.pdf

These Consoles are readonly properties and were recently added.
Figured no clients are looking for them, but the OCP profile does
require SerialConsole so left them in Manager.

The OCP profile has not released a new version in 18 months.
Filed the following issue with the profile:
https://github.com/opencomputeproject/OCP-Profiles/issues/23

After we remove from manager the following validator warning
will go away:
"SerialConsole: The given property is deprecated by revision:
This property has been deprecated in favor of the SerialConsole
property in the ComputerSystem resource."

Tested: Passes Validator.
"GraphicalConsole": {
"ConnectTypesSupported": [
"KVMIP"
],
"MaxConcurrentSessions": 4,
"ServiceEnabled": true
},

"SerialConsole": {
"IPMI": {
"ServiceEnabled": true
},
"MaxConcurrentSessions": 15,
"SSH": {
"HotKeySequenceDisplay": "Press ~. to exit console",
"Port": 2200,
"ServiceEnabled": true
}
},

Change-Id: I1cc41c0da67e0d4123678f645828dfe1856d7a8f
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com>

show more ...


# 432a890c 14-Jun-2021 Ed Tanous <edtanous@google.com>

Remove ambiguous privileges constructor

There are a number of endpoints that assume that a given routes
privileges are governed by a single set of privileges, instead of
multiple sets ORed together.

Remove ambiguous privileges constructor

There are a number of endpoints that assume that a given routes
privileges are governed by a single set of privileges, instead of
multiple sets ORed together. To handle this, there were two overloads
of the privileges() method, one that took a vector of Privileges, and
one that took an initializer_list of const char*. Unfortunately, this
leads some code in AccountService to pick the wrong overload when it's
called like this
.privileges( {{"ConfigureUsers"}, {"ConfigureManager"},
{"ConfigureSelf"}})

This is supposed to be "User must have ConfigureUsers, or
ConfigureManager, or ConfigureSelf". Currently, because it selects the
wrong overload, it computes to "User must have ConfigureUsers AND
ConfigureManager AND ConfigureSelf.

The double braces are supposed to cause this to form a vector of
Privileges, but it appears that the initializer list gets consumed, and
the single invocation of initializer list is called. Interestingly,
trying to put in a privileges overload of
intializer_list<initializer_list<const char*>> causes the compilation to
fail with an ambiguous call error, which is what I would've expected to
see previously in this case, but alas, I'm only a novice when it comes
to how the C++ standard works in these edge cases. This is likely due
in part to the fact that they were templates of an unused template param
(seemingly copied from the previous method) and SFINAE rules around
templates.

This commit functionally removes one of the privileges overloads, and
adds a second set of braces to every privileges call that previously had
a single set of braces. Previous code will not compile now, which is
IMO a good thing.

This likely popped up in the Node class removal, because the Node class
explicitly constructs a vector of Privilege objects, ensuing it can hit
the right overload

Tested:
Ran Redfish service validator

Tested the specific use case outlined on discord with:
Creating a new user with operator privilege:
```
redfishtool -S Always -u root -p 0penBmc -vvvvvvvvv -r 192.168.7.2
AccountService adduser foo mysuperPass1 Operator
```

Then attempting to list accounts:
```
curl -vvvv --insecure --user foo:mysuperPass1
https://192.168.7.2/redfish/v1/AccountService/Accounts/foo
```

Which succeeded and returned the account in question.

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

show more ...


# 7e860f15 08-Apr-2021 John Edward Broadbent <jebr@google.com>

Remove Redfish Node class

Reduces the total number of lines and will allow for easier testing of
the redfish responses.

A main purpose of the node class was to set app.routeDynamic(). However
now a

Remove Redfish Node class

Reduces the total number of lines and will allow for easier testing of
the redfish responses.

A main purpose of the node class was to set app.routeDynamic(). However
now app.routeDynamic can handle the complexity that was once in critical
to node. The macro app.routeDynamic() provides a shorter cleaner
interface to the unerlying app.routeDyanic call. The old pattern set
permissions for 6 interfaces (get, head, patch, put, delete_, and post)
even if only one interface is created. That pattern creates unneeded
code that can be safely removed with no effect.
Unit test for the responses would have to mock the node the class in
order to fully test responses.

see https://github.com/openbmc/bmcweb/issues/181

The following files still need node to be extracted.

virtual_media.hpp
account_service.hpp
redfish_sessions.hpp
ethernet.hpp

The files above use a pattern that is not trivial to address. Often their
responses call an async lambda capturing the inherited class. ie
(https://github.com/openbmc/bmcweb/blob/ffed87b5ad1797ca966d030e7f979770
28d258fa/redfish-core/lib/account_service.hpp#L1393)
At a later point I plan to remove node from the files above.

Tested:
I ran the docker unit test with the following command.
WORKSPACE=$(pwd) UNIT_TEST_PKG=bmcweb
./openbmc-build-scripts/run-unit-test-docker.sh

I ran the validator and this change did not create any issues.
python3 RedfishServiceValidator.py -c config.ini

Signed-off-by: John Edward Broadbent <jebr@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I147a0289c52cb4198345b1ad9bfe6fdddf57f3df

show more ...


# 601af5ed 15-Apr-2021 Chicago Duan <duanzhijia01@inspur.com>

Redfish : Return after InternalError instead of Continue

"After setting response to internal error you should stop adding more content to response. Try to return instead of continuing a loop"

https

Redfish : Return after InternalError instead of Continue

"After setting response to internal error you should stop adding more content to response. Try to return instead of continuing a loop"

https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/39970/9/redfish-core/lib/pcie_slots.hpp#169

Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
Change-Id: Iadd3062ba7fef31ba61eea1e79eb3a903716b9e9

show more ...


# 8d1b46d7 31-Mar-2021 zhanghch05 <zhanghch05@inspur.com>

Using AsyncResp everywhere

Get the core using AsyncResp everywhere, and not have each individual handler
creating its own object.We can call app.handle() without fear of the response
getting ended a

Using AsyncResp everywhere

Get the core using AsyncResp everywhere, and not have each individual handler
creating its own object.We can call app.handle() without fear of the response
getting ended after the first tree is done populating.
Don't use res.end() anymore.

Tested:
1. Validator passed.

Signed-off-by: zhanghaicheng <zhanghch05@inspur.com>
Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8

show more ...


# 71f52d96 19-Feb-2021 Ed Tanous <edtanous@google.com>

Fix nlohmann::json::dump calls

The nlohmann::json::dump call needs to be called with specific arguments
to avoid throwing in failure cases. http connection already does this
properly, but a bunch o

Fix nlohmann::json::dump calls

The nlohmann::json::dump call needs to be called with specific arguments
to avoid throwing in failure cases. http connection already does this
properly, but a bunch of code has snuck in (mostly in redfish) that
ignores this, and calls it incorrectly. This can potentially lead to a
crash if the wrong thing throws on invalid UTF8 characters.

This audits the whole codebase, and replaces every dump() call with the
correct dump(2, ' ', true, nlohmann::json::error_handler_t::replace)
call. For correct output, the callers should expect no change, and in
practice, this would require injecting non-utf8 characters into the
BMC.

Tested:
Ran several of the endpoints/error conditions in question, including
some of the error cases. Observed correct responses. I don't know of a
security issue that would allow injecting invalid utf8 into the BMC, but
in theory if it were possible, this would prevent a crash.

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

show more ...


# 071d8fdf 28-Oct-2020 SunnySrivastava1984 <sunnsr25@in.ibm.com>

Add additional Redfish Manager properties

This commit adds the following inventory properties for the
BMC resource:

a) LocationCode, a free form, implementation-defined string
to provide the locati

Add additional Redfish Manager properties

This commit adds the following inventory properties for the
BMC resource:

a) LocationCode, a free form, implementation-defined string
to provide the location of the BMC. This is needed so an
implementation can identify the BMC via system diagrams and such.

b) Model, maps to a CCIN/Card ID for IBM's implementation,
is a string for the manufacturer's part model. For IBM's
implementation, it is a four-digit value assigned for each
possible FRU.

c) SparePartNumber, also field-replaceable unit (FRU) Part Number,
is a part number that identifies the FRU for replacement
specifically ordering of a new part.

For some manufacturers the BMC is soldered down, this is not the
case for all manufacturers. For our systems, the BMC can be
replaced and these properties are essential to locate and replace
the BMC.

Redfish validator has been executed on this change and no new
error was found.

Sample Output:
{
"@odata.id": "/redfish/v1/Managers/bmc",
"@odata.type": "#Manager.v1_11_0.Manager",
"Actions": {
"#Manager.Reset": {
"@Redfish.ActionInfo": "/redfish/v1/Managers/bmc/ResetActionInfo",
"target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset"
},
"#Manager.ResetToDefaults": {
"ResetType@Redfish.AllowableValues": [
"ResetAll"
],
"target": "/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults"
}
},
"DateTime": "2020-12-18T07:37:34+00:00",
"Description": "Baseboard Management Controller",
"EthernetInterfaces": {
"@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces"
},
"FirmwareVersion": "fw1020.00-12.1-10-g60fee5936",
"GraphicalConsole": {
"ConnectTypesSupported": [
"KVMIP"
],
"MaxConcurrentSessions": 4,
"ServiceEnabled": true
},
"Id": "bmc",
"LastResetTime": "2020-12-09T17:21:20+00:00",
"Links": {
"ActiveSoftwareImage": {
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/e7522a84"
},
"ManagerForChassis": [
{
"@odata.id": "/redfish/v1/Chassis/Nisqually_Backplane"
}
],
"ManagerForChassis@odata.count": 1,
"ManagerForServers": [
{
"@odata.id": "/redfish/v1/Systems/system"
}
],
"ManagerForServers@odata.count": 1,
"ManagerInChassis": {
"@odata.id": "/redfish/v1/Chassis/Nisqually_Backplane"
},
"SoftwareImages": [
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/e7522a84"
}
],
"SoftwareImages@odata.count": 1
},
"Location": {
"PartLocation": {
"ServiceLabel": "U78DA.ND1.1234567-P0-C5"
}
},
"LogServices": {
"@odata.id": "/redfish/v1/Managers/bmc/LogServices"
},
"ManagerType": "BMC",
"Manufacturer": "",
"Model": "",
"Name": "OpenBmc Manager",
"NetworkProtocol": {
"@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol"
},
"Oem": {
"@odata.id": "/redfish/v1/Managers/bmc#/Oem",
"@odata.type": "#OemManager.Oem",
"OpenBmc": {
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc",
"@odata.type": "#OemManager.OpenBmc",
"Certificates": {
"@odata.id": "/redfish/v1/Managers/bmc/Truststore/Certificates"
}
}
},
"PartNumber": "PN12345",
"PowerState": "On",
"SerialConsole": {
"ConnectTypesSupported": [
"IPMI",
"SSH"
],
"MaxConcurrentSessions": 15,
"ServiceEnabled": true
},
"SerialNumber": "YL6B58010000",
"ServiceEntryPointUUID": "280c3750-fa95-42cd-96aa-7834853bd922",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"UUID": "35d98d20-cf67-4575-8aaa-0c40c398efdf"
}

Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: I53044fb0173be8fce7a13aadc2cf5c2903529486

show more ...


# ef6ca6e4 27-Nov-2020 Chicago Duan <duanzhijia01@inspur.com>

Redfish: Manager: Implement Manufacturer,PartNumber and SerialNumber

Implement Manufacturer,PartNumber and SerialNumber in /redfish/v1/Managers/bmc

The Redfish manager defines these new properties:

Redfish: Manager: Implement Manufacturer,PartNumber and SerialNumber

Implement Manufacturer,PartNumber and SerialNumber in /redfish/v1/Managers/bmc

The Redfish manager defines these new properties:
https://redfish.dmtf.org/schemas/v1/Manager.v1_10_0.json

Tested:
Validator passes
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Managers/bmc
{
"@odata.id": "/redfish/v1/Managers/bmc",
"@odata.type": "#Manager.v1_9_0.Manager",
"Actions": {
"#Manager.Reset": {
"@Redfish.ActionInfo": "/redfish/v1/Managers/bmc/ResetActionInfo",
"target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset"
},
"#Manager.ResetToDefaults": {
"ResetType@Redfish.AllowableValues": [
"ResetAll"
],
"target": "/redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults"
}
},
... ...
"Manufacturer": "testManufacturer",
... ...
"PartNumber": "testPartNumber",
... ...
"SerialNumber": "testSerialNumber",
... ...
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"UUID": "d80b997e-d7eb-4773-b375-ed18e87a4ed4"
}

Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
Change-Id: Id3765cfb8d80b5958fb0f82ecd7f5d89f90f893a

show more ...


# a0744d38 09-Nov-2020 Gunnar Mills <gmills@us.ibm.com>

Manager: LOG: Remove __LINE__

Already in the log macro.

Change-Id: Ia4d2c801d8ec7dcef5141db1ef6a6eda1df24183
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>


# 17a897df 12-Sep-2020 Manojkiran Eda <manojkiran.eda@gmail.com>

Improve loops & fix cpp check warning

- This commit improves certain while loops to range based for loops.

- This commit also fixes the cppcheck warning that mentions about
performance issues whe

Improve loops & fix cpp check warning

- This commit improves certain while loops to range based for loops.

- This commit also fixes the cppcheck warning that mentions about
performance issues when using postfix operators on non-primitive
types.

Tested By:
- A function is unittested.
- GET on both EthernetInterfaces & certificate service
looks good without any issues.

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I85420f7bf9af45a97e1a93b916f292c2516f5802

show more ...


# f23b7296 15-Oct-2020 Ed Tanous <ed@tanous.net>

Turn on ALL perf checks

1st, alphabetize the tidy-list for good housekeeping.

Next, enable all the clang-tidy performance checks, and resolve all the
issues. most of the issues boil down to:
1. Us

Turn on ALL perf checks

1st, alphabetize the tidy-list for good housekeeping.

Next, enable all the clang-tidy performance checks, and resolve all the
issues. most of the issues boil down to:
1. Using std::move on const variables. This does nothing.
2. Passing big variables (like std::string) by value.
3. Using double quotes on a find call, which constructs an intermediate
string, rather than using the character overload.

Tested
Loaded on system, logged in successfully and pulled down webui-vue. No
new errors.

Walked the Redfish tree a bit, and observed no new problems.

Ran redfish service validator. Got no new failures (although there are
a lot of log service deprecation warnings that we should look at).

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I2238958c4b22c1e554e09a0a1787c744bdbca43e

show more ...


# b5a76932 29-Sep-2020 Ed Tanous <ed@tanous.net>

Lots of performance improvements

(In the voice of the kid from sixth sense) I see string copies...

Apparently there are a lot of places we make unnecessary copies. This
fixes all of them.

Not sure

Lots of performance improvements

(In the voice of the kid from sixth sense) I see string copies...

Apparently there are a lot of places we make unnecessary copies. This
fixes all of them.

Not sure how to split this up into smaller patches, or if it even needs
split up. It seems pretty easy to review to me, because basically every
diff is identical.

Change-Id: I22b4ae4f96f7e4082d2bc701098a04f7bed95369
Signed-off-by: Ed Tanous <ed@tanous.net>
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>

show more ...


# 3174e4df 07-Oct-2020 Ed Tanous <ed@tanous.net>

Write the clang-tidy file OpenBMC needs

Now that CI can handle clang-tidy, and a lot of the individual fixes
have landed for the various static analysis checks, lets see how close
we are.

This incl

Write the clang-tidy file OpenBMC needs

Now that CI can handle clang-tidy, and a lot of the individual fixes
have landed for the various static analysis checks, lets see how close
we are.

This includes bringing a bunch of the code up to par with the checks
that require. Most of them fall into the category of extraneous else
statements, const correctness problems, or extra copies.

Tested:
CI only. Unit tests pass.

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I9fbd346560a75fdd3901fa40c57932486275e912

show more ...


# 1536473f 11-Sep-2020 Ed Tanous <ed@tanous.net>

Add missing inline

Tested:
Code compiles in clang

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ib7377d05441328197e1de59fabc0ca9bfa0b703b


# f97ddba7 20-Aug-2020 Gunnar Mills <gmills@us.ibm.com>

Add "Links""SoftwareImages"

SoftwareImages was added in Manager in 1_6_0 and Bios in 1_1_0.

Use the existing getActiveFwVersion function but rename to
populateFirmwareInformation. Changed the mappe

Add "Links""SoftwareImages"

SoftwareImages was added in Manager in 1_6_0 and Bios in 1_1_0.

Use the existing getActiveFwVersion function but rename to
populateFirmwareInformation. Changed the mapper call from a GetObject to a
GetSubTree. Added some debug to the function.

Tested: Validator passes.

curl -k https://$bmc/redfish/v1/Managers/bmc
....
"Links": {
"ActiveSoftwareImage": {
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/e4e1c69d"
},
"ManagerForChassis": [
....
"@odata.id": "/redfish/v1/Chassis/chassis"
},
"SoftwareImages": [
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/730944ed"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/e4e1c69d"
}
],
"SoftwareImages@odata.count": 2
},
...

Change-Id: I20798852a2f62575854820bff36175dda38c7dbc
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# f92af389 16-Jun-2020 Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>

Manager:Add ForceRestart to ResetType

Add ForceRestart in Action/#Manager.Reset/ResetType@AllowableValues,
as it is a mandatory parameter in the OCP Redfish Profile v1.0.

Tested:
1. Verified redfis

Manager:Add ForceRestart to ResetType

Add ForceRestart in Action/#Manager.Reset/ResetType@AllowableValues,
as it is a mandatory parameter in the OCP Redfish Profile v1.0.

Tested:
1. Verified redfish validator passed
2. Verified details from Redfish
GET: https://<BMC-IP>/redfish/v1/Managers/bmc/ResetActionInfo
Response:
{
"@odata.id": "/redfish/v1/Managers/bmc/ResetActionInfo",
"@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
"Id": "ResetActionInfo",
"Name": "Reset Action Info",
"Parameters": [
{
"AllowableValues": [
"GracefulRestart",
"ForceRestart"
],
"DataType": "String",
"Name": "ResetType",
"Required": true
}
]
}

Case 1: ForceRestart:
POST: https://<BMC-IP>/redfish/v1/Managers/bmc/Actions/Manager.Reset
Body:
{
"ResetType": "ForceRestart"
}
Response:
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"Message": "Successfully Completed Request",
"MessageArgs": [],
"MessageId": "Base.1.4.0.Success",
"Resolution": "None",
"Severity": "OK"
}
]
}
Case 2: GracefulRestart:
POST: https://<BMC-IP>/redfish/v1/Managers/bmc/Actions/Manager.Reset
Body:
{
"ResetType": "GracefulRestart"
}
Response: Success

Case 3: Negative test case
POST: https://<BMC-IP>/redfish/v1/Managers/bmc/Actions/Manager.Reset
Body:
{
"ResetType": "Test1"
}
Response:
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"Message": "The parameter Test1 for the action ResetType is not
supported on the target resource.",
"MessageArgs": [
"Test1",
"ResetType"
],
"MessageId": "Base.1.4.0.ActionParameterNotSupported",
"Resolution": "Remove the parameter supplied and resubmit the
request if the operation failed.",
"Severity": "Warning"
}
"code": "Base.1.4.0.ActionParameterNotSupported",
"message": "The parameter Test1 for the action ResetType is not
supported on the target resource."
}
}

Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I84f4942ddabc564a267d7db8e582ad8c11b5399b

show more ...


# cb13a392 25-Jul-2020 Ed Tanous <ed@tanous.net>

Enable unused variable warnings and resolve

This commit enables the "unused variables" warning in clang. Throughout
this, it did point out several issues that would've been functional
bugs, so I th

Enable unused variable warnings and resolve

This commit enables the "unused variables" warning in clang. Throughout
this, it did point out several issues that would've been functional
bugs, so I think it was worthwhile. It also cleaned up several unused
variable from old constructs that no longer exist.

Tested:
Built with clang. Code no longer emits warnings.

Downloaded bmcweb to system and pulled up the webui, observed webui
loads and logs in properly.

Change-Id: I51505f4222cc147d6f2b87b14d7e2ac4a74cafa8
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 23a21a1c 24-Jul-2020 Ed Tanous <ed@tanous.net>

Enable clang warnings

This commit enables clang warnings, and fixes all warnings that were
found. Most of these fall into a couple categories:

Variable shadow issues were fixed by renaming variabl

Enable clang warnings

This commit enables clang warnings, and fixes all warnings that were
found. Most of these fall into a couple categories:

Variable shadow issues were fixed by renaming variables

unused parameter warnings were resolved by either checking error codes
that had been ignored, or removing the name of the variable from the
scope.

Other various warnings were fixed in the best way I was able to come up
with.

Note, the redfish Node class is especially insidious, as it causes all
imlementers to have variables for parameters, regardless of whether or
not they are used. Deprecating the Node class is on my list of things
to do, as it adds extra overhead, and in general isn't a useful
abstraction. For now, I have simply fixed all the handlers.

Tested:
Added the current meta-clang meta layer into bblayers.conf, and added
TOOLCHAIN_pn-bmcweb = "clang" to my local.conf

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ia75b94010359170159c703e535d1c1af182fe700

show more ...


# 52cc112d 18-Jul-2020 Ed Tanous <ed@tanous.net>

Remove middlewares

Middlewares, while kinda cool from an academic standpoint, make our
build times even worse than they already are. Given that we only really
use 1 real middleware today (token aut

Remove middlewares

Middlewares, while kinda cool from an academic standpoint, make our
build times even worse than they already are. Given that we only really
use 1 real middleware today (token auth) and it needs to move into the
parser mode anyway (for security limiting buffer sizes), we might as well
use this as an opportunity to delete some code.

Some other things that happen:
1. Persistent data now moves out of the crow namespace
2. App is no longer a template
3. All request_routes implementations no longer become templates. This
should be a decent (unmeasured) win on compile times.

This commit was part of a commit previously called "various cleanups".
This separates ONLY the middleware deletion part of that.

Note, this also deletes about 400 lines of hard to understand code.

Change-Id: I4c19e25491a153a2aa2e4ef46fc797bcb5b3581a
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 4bfefa74 30-Jul-2020 Gunnar Mills <gmills@us.ibm.com>

Manager: Support for switching running image

ActiveSoftwareImage was added to Manager in v1_6_0.
It is a Readwrite property.

This supports only switching the BMC running image.
This assumes the BMC

Manager: Support for switching running image

ActiveSoftwareImage was added to Manager in v1_6_0.
It is a Readwrite property.

This supports only switching the BMC running image.
This assumes the BMC updater is
xyz.openbmc_project.Software.BMC.Updater.

This assumes the switch is Immediate and calls a BMC
reboot after setting the priority to 0.

Patch set 1 had a new Redfish.Settings for the Manager at
/redfish/v1/Managers/bmc/Settings and a new setting,
ActiveSoftwareImageApplyTime.

This was removed due to complexity.

A future commit could add support to allow this Setting to be
exposed and PATCHed.

From https://redfish.dmtf.org/schemas/v1/Manager.v1_9_0.json

"ActiveSoftwareImage": {
...
"description": "The link to the software inventory resource that
represents the active firmware image for this manager.",
"longDescription": "This property shall contain a link to a resource
of type SoftwareInventory that represents the active firmware image for
this manager.",
"readonly": false,
"versionAdded": "v1_6_0"

Tested: Validator passes

curl -k -X PATCH -d \
'{ "Links": { "ActiveSoftwareImage": { "@odata.id":"/redfish/v1/UpdateService/FirmwareInventory/82d3ec86"}}}' \
https://$bmc/redfish/v1/Managers/bmc
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_0_0.Message",
"Message": "Successfully Completed Request",

Change-Id: Id9d29af5332f9e76ec172e1e4351980a6772477c
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# 72d566d9 21-Jul-2020 Gunnar Mills <gmills@us.ibm.com>

Firmware: Add ActiveSoftwareImage for the running image

ActiveSoftwareImage was added to Bios in v1_1_0 and Manager in v1_6_0.

What Redfish calls active is the functional or running image in
OpenBM

Firmware: Add ActiveSoftwareImage for the running image

ActiveSoftwareImage was added to Bios in v1_1_0 and Manager in v1_6_0.

What Redfish calls active is the functional or running image in
OpenBMC.

Reused getActiveFwVersion which means less D-Bus calls when
calling from Manager.

From https://redfish.dmtf.org/schemas/v1/Manager.v1_9_0.json

"ActiveSoftwareImage": {
...
"description": "The link to the software inventory resource that
represents the active firmware image for this manager.",
"longDescription": "This property shall contain a link to a resource
of type SoftwareInventory that represents the active firmware image for
this manager.",
"readonly": false,
"versionAdded": "v1_6_0"

PATCH support will come later.

Tested: Validator passes
Manager:
...
"FirmwareVersion": "2.9.0-dev-515-g92efac612-dirty",
...
"Links": {
"ActiveSoftwareImage": {
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/82d3ec86"
},
"ManagerForChassis": [
{
"@odata.id": "/redfish/v1/Chassis/chassis"
}
],
...
System:
"BiosVersion": "IBM-witherspoon-OP9-v2.3-rc2-3.28",

Bios:
"ActiveSoftwareImage": {
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/9f75c5ad"
}
},

Change-Id: Ia3583b4cb513bf36942a9dcbc4588615275bb2ad
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# 1cb1a9e6 17-Jul-2020 AppaRao Puli <apparao.puli@linux.intel.com>

Add ResetActionInfo for ResetType

OCP mandate the ResetActionInfo for convey the
parameter requirements and allowable values on
parameters for actions. So add ResetActionInfo
uri for below URI's.
/r

Add ResetActionInfo for ResetType

OCP mandate the ResetActionInfo for convey the
parameter requirements and allowable values on
parameters for actions. So add ResetActionInfo
uri for below URI's.
/redfish/v1/Systems/system/ResetActionInfo
/redfish/v1/Managers/bmc/ResetActionInfo
/redfish/v1/Chassis/<id>/ResetActionInfo

Tested:
- All action uri's show correct @Redfish.ActionInfo
"Actions": {
"#ComputerSystem.Reset": {
"@Redfish.ActionInfo": "/redfish/v1/Systems/system/ResetActionInfo",
"target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset"
}
}

- All /ResetActionInfo uri's show correct allowable
values.
{
"@odata.id": "/redfish/v1/Systems/system/ResetActionInfo",
"@odata.type": "#ActionInfo.v1_1_2.ActionInfo",
"Id": "ResetActionInfo",
"Name": "Reset Action Info",
"Parameters": {
"AllowableValues": [
"On",
"ForceOff",
"ForceOn",
"ForceRestart",
"GracefulRestart",
"GracefulShutdown",
"PowerCycle",
"Nmi"
],
"DataType": "String",
"Name": "ResetType",
"Required": true
}
}

- Ran redfish validator and its successful.

Change-Id: I656163dde300d97fe1923f1d58fa6d104c702d27
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>

show more ...


# 4e0453b1 08-Jul-2020 Gunnar Mills <gmills@us.ibm.com>

Codespell redfish-core spelling fixes

These spelling errors were found using
https://github.com/codespell-project/codespell
Tested: Top commit (along with this) was built and ran against
val

Codespell redfish-core spelling fixes

These spelling errors were found using
https://github.com/codespell-project/codespell
Tested: Top commit (along with this) was built and ran against
validator.
Change-Id: Ic9dce27b1de8567eedf7753164ef564d3aedf8ca
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


12345678