diff options
author | Shantappa Teekappanavar <sbteeks@yahoo.com> | 2022-01-18 21:29:28 +0300 |
---|---|---|
committer | Shantappa Teekappanavar <sbteeks@yahoo.com> | 2022-01-18 21:29:28 +0300 |
commit | 5df6eda23a0407ad2047fdb1b6ef2770155ff7f9 (patch) | |
tree | 2ad6ea4baaee8f96dde587edbf0a72ae20ba2a33 /include/dbus_utility.hpp | |
parent | 2d31491b8b57a47ea25d8a596cc41f5186bb33bc (diff) | |
download | bmcweb-5df6eda23a0407ad2047fdb1b6ef2770155ff7f9.tar.xz |
bmcweb: Add/Move common typedefs to dbus utility
The following typedefs that are commonly used by redfish services
to get dbus subtree objects:
MapperServiceMap =
std::vector<std::pair<std::string, std::vector<std::string>>>
MapperGetSubTreeResponse =
std::vector<std::pair<std::string, MapperServiceMap>>
This commit adds the above mentioned typedefs to dbus utility namespace
and removes locally defined typedefs in processor.hpp.
Testing:
Validator: No errors
Few sample outputs from curl command:
$ curl -k -X GET https://{$bmc}/redfish/v1/Systems/system/Processors
{
"@odata.id": "/redfish/v1/Systems/system/Processors",
"@odata.type": "#ProcessorCollection.ProcessorCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/Processors/dcm0-cpu0"
},
{
"@odata.id": "/redfish/v1/Systems/system/Processors/dcm0-cpu1"
},
{
"@odata.id": "/redfish/v1/Systems/system/Processors/dcm1-cpu0"
},
{
"@odata.id": "/redfish/v1/Systems/system/Processors/dcm1-cpu1"
}
],
"Members@odata.count": 4,
"Name": "Processor Collection"
}
$ curl -k -X GET
https://{$bmc}/redfish/v1/Systems/system/Processors/dcm0-cpu0
{
"@odata.id": "/redfish/v1/Systems/system/Processors/dcm0-cpu0",
"@odata.type": "#Processor.v1_12_0.Processor",
"Id": "dcm0-cpu0",
"Location": {
"PartLocation": {
"ServiceLabel": "U78DA.ND0.WZS004K-P0-C15"
}
},
"LocationIndicatorActive": false,
"Manufacturer": "",
"MaxSpeedMHz": 0,
"Model": "5C67",
"Name": "PROCESSOR MODULE",
"PartNumber": "03JM290",
"ProcessorId": {
"EffectiveFamily": ""
},
"ProcessorType": "CPU",
"SerialNumber": "YA3936061828",
"Socket": "",
"SparePartNumber": "F210110",
"Status": {
"Health": "OK",
"State": "Enabled"
},
"SubProcessors": {
"@odata.id":
"/redfish/v1/Systems/system/Processors/dcm0-cpu0/SubProcessors"
},
"TotalCores": 8,
"TotalThreads": 0
}
$ curl -k -X GET
https://{$bmc}/redfish/v1/Systems/system/Processors/dcm0-cpu0/SubProcessors
{
"@odata.id":
"/redfish/v1/Systems/system/Processors/dcm0-cpu0/SubProcessors",
"@odata.type": "#ProcessorCollection.ProcessorCollection",
"Members": [],
"Members@odata.count": 0,
"Name": "SubProcessor Collection"
}
Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com>
Change-Id: I297c763af38fa5b13ef297e911b338f406b7c6e6
Diffstat (limited to 'include/dbus_utility.hpp')
-rw-r--r-- | include/dbus_utility.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/dbus_utility.hpp b/include/dbus_utility.hpp index 872ca614e4..75bda0832f 100644 --- a/include/dbus_utility.hpp +++ b/include/dbus_utility.hpp @@ -66,6 +66,14 @@ using ManagedItem = std::pair< boost::container::flat_map< std::string, boost::container::flat_map<std::string, DbusVariantType>>>; +// Map of service name to list of interfaces +using MapperServiceMap = + std::vector<std::pair<std::string, std::vector<std::string>>>; + +// Map of object paths to MapperServiceMaps +using MapperGetSubTreeResponse = + std::vector<std::pair<std::string, MapperServiceMap>>; + inline void escapePathForDbus(std::string& path) { const std::regex reg("[^A-Za-z0-9_/]"); |