Post by johannes on Feb 23, 2023 13:07:33 GMT
Hi,
I am currently working on an redfish API for a PDU product line. Therefore i have to display many sensor values.
To save on the SensorCollection under "RackPDUs/{id}/Sensors" or with ne new spec under "Chassis/PDU/Sensors" i decided just to include the thresholds in
To save on the SensorCollection under "RackPDUs/{id}/Sensors" or with ne new spec under "Chassis/PDU/Sensors" i decided just to include the thresholds in
Outlets, Branches or Metrics themself. So besides the value, there are also the the thresholds of the sensors schema.
Redfish-Service-Validator seems to be happy with it. I even provide the possibility to change threshold through these resources.
These ressources get kind of large, but in my opinion still manageable.
{
"@odata.type": "#Outlet.v1_4_0.Outlet",
"Id": "{outletID}",
"Name": "PDU Outlet",
"UserLabel": "Socket 01",
"VoltageType": "AC",
"PowerState": "On",
"PowerEnabled": true,
"CurrentAmps": {
"Reading": 0,
"Thresholds": {
"UpperCautionUser": {
"Reading": 0,
"Activation": "Decreasing"
},
"LowerCautionUser": {
"Reading": 0,
"Activation": "Decreasing"
},
"UpperCriticalUser": {
"Reading": 0,
"Activation": "Decreasing"
},
"LowerCriticalUser": {
"Reading": 0,
"Activation": "Decreasing"
}
}
},
"PowerWatts": {
"Reading": 0,
"Thresholds": {
"UpperCautionUser": {
"Reading": 0,
"Activation": "Decreasing"
},
"LowerCautionUser": {
"Reading": 0,
"Activation": "Decreasing"
},
"UpperCriticalUser": {
"Reading": 0,
"Activation": "Decreasing"
},
"LowerCriticalUser": {
"Reading": 0,
"Activation": "Decreasing"
}
},
"ApparentVA": 0,
"ReactiveVAR": 0,
"PowerFactor": 0
},
"EnergykWh": {
"Reading": 0
},
"Actions": {
"#Outlet.PowerControl": {
"target": "/redfish/v1/PowerEquipment/RackPDUs/{PDUid}/Outlets/{outletID}/Actions/Outlet.PowerControl"
}
},
"Links": {
"BranchCircuit": {
"@odata.id": "/redfish/v1/PowerEquipment/RackPDUs/{PDUid}/Branches/{branchID}"
}
},
"@odata.id": "/redfish/v1/PowerEquipment/RackPDUs/{PDUid}/Outlets/{outletID}"
}
A PATCH-request on all the thresholds (and the userLabel) could look like this:
{
"UserLabel": "coffee pot",
"CurrentAmps": {
"Thresholds": {
"UpperCautionUser": {
"Reading": 0
},
"LowerCautionUser": {
"Reading": 0
},
"UpperCriticalUser": {
"Reading": 0
},
"LowerCriticalUser": {
"Reading": 0
}
}
},
"PowerWatts": {
"Thresholds": {
"UpperCautionUser": {
"Reading": 0
},
"LowerCautionUser": {
"Reading": 0
},
"UpperCriticalUser": {
"Reading": 0
},
"LowerCriticalUser": {
"Reading": 0
}
}
}
}
Is it allowed to embedd properties of the sensors schema in such a way?
The next thing is that most of our thresholds are disabled, if they are set to 0. I did not find a way in sensors schema to display this behavior. I would have expected another enum value in activation but there is no "disabled".
best regards
Johannes
best regards
Johannes