syntax = "proto3";

import "types.proto";
import "types/enums.proto";
package SyssdmMsg;

// 系统上下电控制代理的请求/响应定义
message PowerCtrlReq {  // method request message
    int32 SystemId = 1;
    int32 FruId = 2;
    SyssdmEnums.PowerCtrlType PowerCtrlType = 3;
    SyssdmEnums.RestartCause RestartCause = 4;
}

message PowerCtrlRsp {  // method response message
    int32 CmdResult = 1;
}

// 升级控制代理的请求/响应定义
message UpgradePrepareReq { // method request message
    int32 SystemId = 1;
    string FirmwareType = 2;
}

message UpgradePrepareReplyReq { // method request message
    int32 SystemId = 1;
    string FirmwareType = 2;
    int32 PrepareResult = 3;
}

message UpgradeProcessReq { // method request message
    int32 SystemId = 1;
    string FirmwareType = 2;
    string FirmwarePath = 3 [(max_len) = 256];
}

message UpgradeProcessReplyReq { // method request message
    int32 SystemId = 1;
    string FirmwareType = 2;
    int32 ProcessResult = 3;
}

message UpgradeStatusReplyReq { // method request message
    int32 SystemId = 1;
    string FirmwareType = 2;
    int32 Status = 3;
    int32 Progress = 4 [(validate) = "ranges(0, 100)"];
    string ResultDescription = 5 [(max_len) = 512];
}

message UpgradeFinishReq { // method request message
    int32 SystemId = 1;
    string FirmwareType = 2;
}

message UpgradeFinishReplyReq { // method request message
    int32 SystemId = 1;
    string FirmwareType = 2;
    int32 FinishResult = 3;
}

message UpgradeCtrlRsp { // method response message
    int32 CmdResult = 1;
}