【已评审】新增redfish接口支持能效调速算法的可替换性

背景

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

关联ISSUE

新增redfish接口支持能效调速算法的可替换性

评审点

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

详细描述

评审点1:在/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine下新增属性AlgorithmsList,用于显示全部能效智能调速算法配置生效状态

资源URI:/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine
资源版本:AlgorithmsEngine.v1_0_0
操作权限:ReadOnly
响应参数

属性名 类型 示例/取值约束 readonly 易变属性 实现patch 操作权限 描述
AlgorithmsList[{ array 可以为 ReadOnly 全部能效智能调速算法配置生效状态
AlgorithmType string 枚举值:
MPC 模型预测控制算法
ReadOnly 智能调速算法类型
AlgorithmStatus string 枚举值:
MPC算法状态取值范围:
Disabled:功能已关闭
Initialized:功能已完成初始化
Training:模型正在训练
Available:模型可用
Unavailable:模型不可用
ReadOnly 该字段需要根据AlgorithmType显示,表示对应算法的训练状态
CustomConfigurations{ object / ReadOnly 对应算法类型的配置生效状态对象
TrainSet}}] string,null 枚举值:
Default 未导入用户训练集,使用默认值
Pending 用户训练集待生效
Effective用户训练集已生效
该字段需要根据算法类型显示,如果后续增加其他算法不支持该配置,则为null
ReadOnly MPC导入训练集生效状态

注:当前CustomConfigurations字段中仅支持TrainSet字段,后续可进行扩展,后续扩展时需对应刷新schema文件;
Schema定义

"AlgorithmsList": {
    "type": "object",
    "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."
        }
    },
    "additionalProperties": true,
    "properties": {
        "AlgorithmType": {
            "type": "string",
            "readonly": true,
            "description": "Type of intelligent speed control algorithm.",
            "longDescription": "This property indicates the type of intelligent speed control algorithm."
        },
        "AlgorithmStatus": {
            "type": "string",
            "readonly": true,
            "description": "Running status of intelligent speed control algorithm.",
            "longDescription": "This property indicates the running status of intelligent speed control algorithm."
        },
        "CustomConfigurations": {
            "$ref": "#/definitions/CustomConfigurations",
            "description": "Effective status of customized configuration for the intelligent speed control algorithm.",
            "longDescription": "This property indicates the effective status of customized configuration for the intelligent speed control algorithm."
        }
    }
},
"CustomConfigurations": {
    "type": "object",
    "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."
        }
    },
    "properties": {
        "TrainSet": {
            "type": "string",
            "readonly": true,
            "description": "Effective status of customized training set for the intelligent speed control algorithm.",
            "longDescription": "This property indicates the effective status of customized training set for the intelligent speed control algorithm."
        }
    }
}

评审点2:/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine/Actions/下新增POST接⼝AlgorithmsEngine.Import,用于能效智能调速算法相关配置导入

资源URI:/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine/Actions/AlgorithmsEngine.Import
资源版本:AlgorithmsEngine.v1_0_0
操作权限:BasicSetting
输入参数

参数名 类型 必填 示例/取值约束 描述
AlgorithmType string 枚举值:MPC 模型预测控制算法 导入的算法类型
ConfigType string 枚举值:TrainSet 模型训练数据 导入的配置类型
ConfigURI string 1. 本地导入:配置文件首先通过/redfish/v1/UpdateService/FirmwareInventory接口上传至/tmp/web
2. 远程导入:“文件传输协议://用户名:密码@ip地址/目录/文件名”,文件传输协议包括五种:sftp、https、nfs、cifs、scp
注:导入TrainSet 训练集, 导入文件必须为csv格式, 所有训练数据必须一次性导入,训练数据打包为 单个 ZIP 压缩包,示例:“xxx.zip”
导入配置文件路径

ActionInfo:“/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine/ImportActionInfo”

Schema定义

"AlgorithmsEngine": {
    "properties": {
        "Actions": {
            "type": "object",
            "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."
                }
            },
            "additionalProperties": false,
            "properties": {
                "#AlgorithmsEngine.Import": {
                    "$ref": "#/definitions/Import"
                },
                "#AlgorithmsEngine.ResetToDefaults": {
                    "$ref": "#/definitions/ResetToDefaults"
                }
            },
            "readonly": true,
            "description": "The available actions for this resource.",
            "longDescription": "The Actions property shall contain the available actions for this resource."
        }
    },
    "Import": {
        "type": "object",
        "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."
            }
        },
        "parameters": {
            "AlgorithmType": {
                "requiredParameter": true,
                "type": "string",
                "description": "Type of the imported algorithm.",
                "longDescription": "This parameter indicates the type of the imported algorithm."
            },
            "ConfigType": {
                "requiredParameter": true,
                "type": "string",
                "description": "Type of the imported configuration.",
                "longDescription": "This parameter indicates the type of the imported configuration."
            },
            "ConfigURI": {
                "requiredParameter": true,
                "type": "string",
                "description": "Path of the imported configuration.",
                "longDescription": "This parameter indicates the path of the imported configuration."
            }
        },
        "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 specify a URI to an ActionInfo resource that describes the parameters supported by this instance of the action.",
                "type": "string",
                "format": "uri-reference",
                "readonly": true
            }
        },
        "description": "Importing the intelligent algorithm configurations.",
        "longDescription": "This action is used to import the intelligent algorithm configurations."
    }
}

评审点3:在/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine/Actions/下新增POST接口AlgorithmsEngine.ResetToDefaults,用于散热相关算法配置恢复

资源URI:/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine/Actions/AlgorithmsEngine.ResetToDefaults
资源版本:AlgorithmsEngine.v1_0_0
操作权限:BasicSetting
输入参数

参数名 类型 必填 示例/取值约束 描述
AlgorithmType string 枚举值:
MPC 模型预测控制算法
恢复算法类型
ResetType string 枚举值:
ResetAll 恢复所有配置到默认值
恢复配置类型

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

"AlgorithmsEngine": {
    "properties": {
        "Actions": {
            "type": "object",
            "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."
                }
            },
            "additionalProperties": false,
            "properties": {
                "#AlgorithmsEngine.Import": {
                    "$ref": "#/definitions/Import"
                },
                "#AlgorithmsEngine.ResetToDefaults": {
                    "$ref": "#/definitions/ResetToDefaults"
                }
            },
            "readonly": true,
            "description": "The available actions for this resource.",
            "longDescription": "The Actions property shall contain the available actions for this resource."
        }
    }
    "ResetToDefaults": {
        "type": "object",
        "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."
            }
        },
        "parameters": {
            "AlgorithmType": {
                "requiredParameter": true,
                "type": "string",
                "description": "Type of the reset algorithm.",
                "longDescription": "This parameter indicates the type of the reset algorithm."
            },
            "ResetType": {
                "requiredParameter": true,
                "type": "string",
                "description": "Type of the reset configuration.",
                "longDescription": "This parameter indicates the type of the reset configuration."
            }
        },
        "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 specify a URI to an ActionInfo resource that describes the parameters supported by this instance of the action.",
                "type": "string",
                "format": "uri-reference",
                "readonly": true
            }
        },
        "description": "Reseting the intelligent algorithm configurations.",
        "longDescription": "This action is to reset the intelligent algorithm configurations."
    }
}

评审结论

1、同意在/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine下新增属性AlgorithmsList,用于显示全部能效智能调速算法配置生效状态
2、同意在/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine/Actions/下新增POST接⼝AlgorithmsEngine.Import,用于能效智能调速算法相关配置导入
3、同意在/redfish/v1/Chassis/{chassis_id}/ThermalSubsystem/Oem/{OemIdentifier}/AlgorithmsEngine/Actions/下新增POST接口AlgorithmsEngine.ResetToDefaults,用于散热相关算法配置恢复