Implement Cable schema
This commit implements Cable and Cable collection schema
on bmcweb.
Testing:
Validator:
@odata.id /redfish/v1/Cables odata Exists PASS
@odata.type #CableCollection.CableCollection odata Exists
PASS
Members@odata.count 2 odata Exists PASS
Members Array (size: 2) links: Cable Yes ...
Members[0] Link: /redfish/v1/Cables/dp0_cable0 link: Cable
Yes PASS
Members[1] Link: /redfish/v1/Cables/dp0_cable1 link: Cable
Yes PASS
Description Collection of Cable Entries none Yes PASS
Name Cable Collection none Yes PASS
Oem - Resource.Oem No Optional
Property Name Value Type Exists Result
@odata.id /redfish/v1/Cables/dp0_cable0 odata Exists PASS
@odata.type #Cable.v1_0_0.Cable odata Exists PASS
CableType string Yes PASS
LengthMeters - number No Optional
Id dp0_cable0 none Yes PASS
Name Cable none Yes PASS
Property Name Value Type Exists Result
@odata.id /redfish/v1/Cables/dp0_cable1 odata Exists PASS
@odata.type #Cable.v1_0_0.Cable odata Exists PASS
CableType string Yes PASS
LengthMeters - number No Optional
Id dp0_cable1 none Yes PASS
Name Cable none Yes PASS
Note: Removed some of the fields that are optional to reduce commit msg
Tesing with Curl commands:
$ curl -k -X GET https://{$bmc}/redfish/v1/Cables
{
"@odata.id": "/redfish/v1/Cables",
"@odata.type": "#CableCollection.CableCollection",
"Description": "Collection of Cable Entries",
"Members": [
{
"@odata.id": "/redfish/v1/Cables/dp0_cable0"
},
{
"@odata.id": "/redfish/v1/Cables/dp0_cable1"
}
],
"Members@odata.count": 2,
"Name": "Cable Collection"
}
$ curl -k -X GET https://{$bmc}/redfish/v1/Cables/dp0_cable0
{
"@odata.id": "/redfish/v1/Cables/dp0_cable0",
"@odata.type": "#Cable.v1_0_0.Cable",
"CableType": "",
"Id": "dp0_cable0",
"Name": "Cable"
}
$ curl -k -X GET https://{$bmc}/redfish/v1/Cables/dp0_cable1
{
"@odata.id": "/redfish/v1/Cables/dp0_cable1",
"@odata.type": "#Cable.v1_0_0.Cable",
"CableType": "",
"Id": "dp0_cable1",
"Name": "Cable"
}
Set Length property to 1.5 meters using busctl, and check the properties
busctl set-property xyz.openbmc_project.Inventory.Manager \
/xyz/openbmc_project/inventory/cables/dp0_cable0 \
xyz.openbmc_project.Inventory.Item.Cable Length d 1.5
$ curl -k -X GET https://{$bmc}/redfish/v1/Cables/dp0_cable0
{
"@odata.id": "/redfish/v1/Cables/dp0_cable0",
"@odata.type": "#Cable.v1_0_0.Cable",
"CableType": "",
"Id": "dp0_cable0",
"LengthMeters": 1.5,
"Name": "Cable"
}
Signed-off-by: Shantappa Teekappanavar <sbteeks@yahoo.com>
Change-Id: I832ff1c1053f4d8100d04a42cc8046a61e8c1613
diff --git a/scripts/update_schemas.py b/scripts/update_schemas.py
index 3f0f57c..f5f5e0e 100755
--- a/scripts/update_schemas.py
+++ b/scripts/update_schemas.py
@@ -18,6 +18,8 @@
'Assembly',
'AttributeRegistry',
'Bios',
+ 'Cable',
+ 'CableCollection',
'Certificate',
'CertificateCollection',
'CertificateLocations',