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/static/redfish/v1/$metadata/index.xml b/static/redfish/v1/$metadata/index.xml
index 60e3ede..f2d30ca 100644
--- a/static/redfish/v1/$metadata/index.xml
+++ b/static/redfish/v1/$metadata/index.xml
@@ -174,6 +174,14 @@
<edmx:Include Namespace="Bios.v1_1_2"/>
<edmx:Include Namespace="Bios.v1_2_0"/>
</edmx:Reference>
+ <edmx:Reference Uri="/redfish/v1/schema/Cable_v1.xml">
+ <edmx:Include Namespace="Cable"/>
+ <edmx:Include Namespace="Cable.v1_0_0"/>
+ <edmx:Include Namespace="Cable.v1_1_0"/>
+ </edmx:Reference>
+ <edmx:Reference Uri="/redfish/v1/schema/CableCollection_v1.xml">
+ <edmx:Include Namespace="CableCollection"/>
+ </edmx:Reference>
<edmx:Reference Uri="/redfish/v1/schema/Certificate_v1.xml">
<edmx:Include Namespace="Certificate"/>
<edmx:Include Namespace="Certificate.v1_0_0"/>