network_protocol: Fix for SSH port
Issue: As per the OCP Redfish Profile v1.0 specification, SSH read only
parameter. By default SSH is disable, but ProtocolEnabled and Port
attributes are mandatory to display in Redfish. But Port property is not
displayed in Redfish URI.
Fix: As Port attribute is mandatory for SSH property, initialized with
null.
Tested:
1. Verified redfish validator passed
2. Verified details from Redfish
GET: https://<BMC-IP>/redfish/v1/Managers/bmc/NetworkProtocol
Before:
Response:
"SSH": {
"ProtocolEnabled": false
},
After:
"SSH": {
"Port": null,
"ProtocolEnabled": false
},
Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I203b321c3b41bab2017e7c6b5e55aa3463ea6e83
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index e5448f1..b32fde1 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -230,6 +230,8 @@
for (auto& protocol : protocolToDBus)
{
+ asyncResp->res.jsonValue[protocol.first]["Port"] =
+ nlohmann::detail::value_t::null;
asyncResp->res.jsonValue[protocol.first]["ProtocolEnabled"] = false;
}