56 lines
1.6 KiB
Protocol Buffer
56 lines
1.6 KiB
Protocol Buffer
syntax="proto2";
|
||
package iot_idl;
|
||
|
||
//消息总线中的消息类型
|
||
enum ENodeMngMsgType
|
||
{
|
||
MT_NodeInfoInvalid = 0; //无效的消息类型
|
||
MT_IntraDomainNodeInfo = 1; //域内心跳
|
||
MT_InterDomainNodeInfo = 2; //域间心跳
|
||
MT_RedundancyCommand = 3; //冗余切换命令
|
||
}
|
||
|
||
//一个节点中某应用的心跳信息
|
||
message SAppHeartbeatMsg
|
||
{
|
||
required int32 nAppId = 1; //应用ID
|
||
required int32 nPriority = 2; //节点优先级
|
||
required bool bIP1Active = 3; //IP1是否可用
|
||
required bool bIP2Active = 4; //IP2是否可用
|
||
required bool bActive = 5; //是否可用
|
||
required bool bMaster = 6; //是否为主
|
||
required bool bSlave = 7; //是否为备
|
||
required bool bHasMaster = 8; //是否有主
|
||
required bool bSwitchFailed = 9; //是否切换失败
|
||
}
|
||
|
||
//一个节点中所有应用的冗余信息
|
||
message SNodeHeartbeatMsg
|
||
{
|
||
required int32 nDomainId = 1; //域ID
|
||
required string strNodeName = 2; //节点名
|
||
required string strIP1 = 3; //节点IP1
|
||
required string strIP2 = 4; //节点IP2
|
||
repeated SAppHeartbeatMsg vecAppHeartbeat = 5; //本节点应用的状态集合
|
||
}
|
||
|
||
//多个节点的应用冗余信息
|
||
message SMultiNodeHeartbeatMsg
|
||
{
|
||
repeated SNodeHeartbeatMsg vecNodeHeartBeat = 1;
|
||
}
|
||
|
||
//冗余切换命令
|
||
message SRedundancyCmdMsg
|
||
{
|
||
required int32 nDomainId = 1; //域ID
|
||
required int32 nAppId = 2; //应用ID
|
||
required string strSwitchNodeName = 3; //要进行切换的节点名
|
||
required string strArbiterNodeName = 4; //裁决节点名
|
||
required string strArbiterNodeIP1 = 5; //裁决节点IP1
|
||
required string strArbiterNodeIP2 = 6; //裁决节点IP2
|
||
required bool bActive = 7; //是否可用,都是赋值为true,暂时保留
|
||
required bool bMaster = 8; //是否为主
|
||
required bool bSlave = 9; //是否为备
|
||
}
|