【待评审】redfish Thermal资源新增Action和属性

背景

当前能效智能调速算法涉及使用机器学习相关算法,而算法所需要的训练数据和超参数均内置在BMC中,无法进行修改,为满足不同客户的诉求,需提供替换和恢复训练数据的能力。

关联ISSUE

导入模型训练数据issue

评审点

(1)在/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmEngine下新增属性AlgorithmStatusList,用于显示全部能效智能调速算法配置生效状态;
(2) 在 /redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmEngine/Actions/下新增POST接⼝AlgorithmEngine.ImportConfig,用于能效智能调速算法相关配置导入;
(3) 在 /redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmEngine/Actions/下新增POST接口AlgorithmEngine.RestoreDefaultConfig,用于散热相关算法配置恢复;

详细描述

评审点1:ThermalSubsystem资源新增OEM属性AlgorithmStatusList

资源URI:/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmEngine/AlgorithmStatusList
资源版本:ThermalSubsystem.v1_3_2
操作权限:ReadOnly
属性列表

属性名 类型 示例/取值约束 readonly 易变属性 实现patch 操作权限 描述
AlgorithmStatusList[{ array 可以为[] ReadOnly 全部能效智能调速算法配置生效状态
AlgorithmType string 枚举值:
MPC 模型预测控制算法
ReadOnly 智能调速算法类型
ConfigStatus{ object / ReadOnly 对应算法类型的配置生效状态对象
TrainingData}}] string,null 枚举值:
NoCustomData 未导入自定义数据,使用默认值
CustomDataPending 自定义数据待生效
CustomDataEffective自定义数据已生效
该字段需要根据算法类型显示,如果后续增加其他算法不支持该配置,则为null
ReadOnly MPC导入训练数据生效状态

Schema定义

"AlgorithmStatusList": {
	"description": "The OEM extension property.",
	"items": {
		"$ref": "#/definitions/AlgorithmConfigStatus"
	},
	"longDescription": "This property shall contain the OEM extensions.  All values for properties that this object contains shall conform to the Redfish Specification-described requirements.",
	"type": "array",
	"versionAdded": "v1_3_2"
},
"definitions": {
      "AlgorithmConfigStatus": {
          "type": "object",
          "properties": {
          "AlgorithmType": {
              "type": "string",
              "enum": [
                  "MPC"
          	],
               "readonly": true
      	  },
      	 "ConfigStatus": {
          	"type": "object",
          	"$ref": "#/definitions/ConfigStatus"
      	  }
        },
      "additionalProperties": false
    },
    "ConfigStatus": {
        "type": "object",
        "properties": {
      	"TrainingData": {
                "type": [
                  	"string",
                  	"null"
                  ],
                  "enum": [
                  	"NoCustomData",
                  	"CustomDataPending",
                  	"CustomDataEffective"
                  ],
                  "description": "Training data import status for MPC algorithm.",
                  "readonly": true
        	}
             }
	}
}

评审点2:ThermalSubsystem资源新增OEM的POST接口AlgorithmEngine.ImportConfig

资源URI:/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmEngine/Actions/AlgorithmEngine.ImportConfig
资源版本:ThermalSubsystem.v1_3_2
操作权限:UserMgmt
输入参数

参数名 类型 必填 示例/取值约束 描述
AlgorithmType string 枚举值:MPC 模型预测控制算法 导入的算法类型
ConfigType string 枚举值:
MPC支持模型训练数据导入类型:
TrainingData 模型训练数据
导入的配置类型
Content string 配置文件首先通过/redfish/v1/UpdateService/FirmwareInventory接口上传至/tmp/web
MPC算法导入TrainingData类型, 导入文件必须为csv格式,所有训练数据一次性上传,不支持分开上传,因此必须打包为 单个 ZIP 压缩包,示例:“/tmp/web/xxx.zip”
导入配置文件路径

ActionInfo:“/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Actions/Oem/{OemIdentifier}/AlgorithmEngineImportConfigActionInfo”
Schema定义

"AlgorithmStatusList": {
	"description": "The OEM extension property.",
	"items": {
		"$ref": "#/definitions/AlgorithmConfigStatus"
	},
	"longDescription": "This property shall contain the OEM extensions.  All values for properties that this object contains shall conform to the Redfish Specification-described requirements.",
	"type": "array",
	"versionAdded": "v1_3_2"
},
"definitions": {
	"AlgorithmConfigStatus": {
        "type": "object",
        "properties": {
            "AlgorithmType": {
            	"type": "string",
                "enum": [
                    "MPC"
            	],
            "readonly": true
        	},
        	"ConfigStatus": {
            	"type": "object",
            	"$ref": "#/definitions/ConfigStatus"
        	}
        },
        "additionalProperties": false
	},
    "ConfigStatus": {
        "type": "object",
        "properties": {
        	"TrainingData": {
                "type": [
                	"string",
                	"null"
                ],
                "enum": [
                	"NoCustomData",
                	"CustomDataPending",
                	"CustomDataEffective"
                ],
                "description": "Training data import status for MPC algorithm.",
            	"readonly": true
        	}
        }
	}
}

评审点3:ThermalSubsystem资源新增OEM的POST接口AlgorithmEngine. RestoreDefaultConfig

资源URI:/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmEngine/Actions/AlgorithmEngine.RestoreDefaultConfig
资源版本:ThermalSubsystem.v1_3_2
操作权限:UserMgmt
输入参数

参数名 类型 必填 示例/取值约束 描述
AlgorithmType string 枚举值:
MPC 模型预测控制算法
恢复算法类型
ConfigType string 枚举值:
MPC支持恢复配置类型:
TrainingData 模型训练数据
恢复配置类型

ActionInfo:“/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Actions/Oem/{OemIdentifier}/AlgorithmEngineRestorDefaultConfigActionInfo”

Schema定义

"AlgorithmEngineRestorDefaultConfig": {
           "patternProperties": {
                   "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$": {
                    "type": [
                        "array",
                        "boolean",
                        "number",
                        "null",
                        "object",
                        "string"
                    ],
                    "description": "This property shall specify a valid odata or Redfish property."
                }
            },
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "title": {
                    "type": "string",
                    "description": "Friendly action name"
                },
                "target": {
                    "type": "string",
                    "format": "uri",
                    "description": "Link to invoke action"
                },
                "@Redfish.ActionInfo": {
                    "description": "The term can be applied to an action to action to specific a URI to an ActionInfo resource that describes the parameters supported by this instance of the action.",
                    "type": "string",
                    "format": "uri-reference",
                    "readonly": true
                }
            },
            "parameters": {
                "AlgorithmType": {
                    "requiredParameter": true,
                    "type": "string",
                    "description": "Restoring the algorithm type.",
                    "longDescription": "This parameter indicates the type of the algorithm to be restored."
                },
                "ConfigType": {
                    "requiredParameter": true,
                    "type": "string",
                    "description": "Restoring the configuration type.",
                    "longDescription": "This parameter indicates the type of the configuration to be restored."
                }
            },
            "description": "Restoring the fan algorithm configuration data.",
            "longDescription": "This action is to the fan algorithm configuration data."
}

评审结论

遗留问题