Add SerialConsole to Manager node
This commit adds SerialConsole property to the
response JSON when doing a GET on the manager resource.
The supported connection types are hard-coded.
Tested:
Performed a GET on the manager object to see the newly added
properties:
curl -k -H "X-Auth-Token: $bmc_token" -X GET
https://${bmc}:${port}/redfish/v1/Managers/bmc
{
"@odata.context": "/redfish/v1/$metadata#Manager.Manager",
"@odata.id": "/redfish/v1/Managers/bmc",
"@odata.type": "#Manager.v1_3_0.Manager",
....
....
"SerialConsole": {
"ConnectTypesSupported": [
"IPMI",
"SSH"
],
"ServiceEnabled": "true"
},
....
....
}
Ran Redfish service validator and ensured no new errors. The newly
added properties PASS validation. Snippet of the verbose output
from the validator:
....
....
Manager.v1_0_0.Manager:SerialConsole
value: OrderedDict([('ConnectTypesSupported', ['IPMI', 'SSH']),
('ServiceEnabled', True)]) <class 'collections.OrderedDict'>
has Type: Manager.v1_0_0.SerialConsole complex
is Optional
***going into Complex
Manager.v1_0_0.SerialConsole:ConnectTypesSupported
value: ['IPMI', 'SSH'] <class 'list'>
has Type: Collection(Manager.v1_0_0.SerialConnectTypesSupported) enum
is Optional
permission OData.Permission/Read
is Collection
Success
Success
Manager.v1_0_0.ManagerService:ServiceEnabled
value: True <class 'bool'>
has Type: Edm.Boolean Edm.Boolean
is Optional
permission OData.Permission/ReadWrite
Success
Manager.v1_0_0.ManagerService:MaxConcurrentSessions
value: n/a <class 'str'>
has Type: Edm.Int64 Edm.Int64
is Optional
prop Does not exist, skip...
***out of Complex
....
....
Change-Id: I659501d5537bfb3eedc8cd2204be98fee742324d
Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index e6e80a8..c73a218 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -972,6 +972,16 @@
"GracefulRestart"};
res.jsonValue["DateTime"] = crow::utility::dateTimeNow();
+
+ // Fill in GraphicalConsole and SerialConsole info
+ res.jsonValue["SerialConsole"]["ServiceEnabled"] = true;
+ res.jsonValue["SerialConsole"]["ConnectTypesSupported"] = {"IPMI",
+ "SSH"};
+ // TODO (Santosh) : Uncomment when KVM support is in.
+ // res.jsonValue["GraphicalConsole"]["ServiceEnabled"] = true;
+ // res.jsonValue["GraphicalConsole"]["ConnectTypesSupported"] =
+ // {"KVMIP"};
+
res.jsonValue["Links"]["ManagerForServers@odata.count"] = 1;
res.jsonValue["Links"]["ManagerForServers"] = {
{{"@odata.id", "/redfish/v1/Systems/system"}}};