# Functions
BuildCommandSeqByID build command sequence with id.
No description provided by the author
No description provided by the author
GetCommandIDFromSeq get command id from a command sequence.
IsCommandSeqValid check whether commandSeq is a valid command sequence.Note: "0000000000000000000" considered as a not valid command sequence return true if commandSeq is a valid command sequence otherwise return faluse.
* 检查代码是否是合法的命令状态代码,如果是合法的状态代码则返回true, 否则返回false
*/.
* IsNodeIdentiferStrValid check whether nodeIdentifierStr is a valid node identifer string
* nodeIdentifierStr should be a combination of "IP", "HOSTNAME" or "MAC"
*/.
* MarshalCommandData marshal CommandData to json encode.
* MarshalCommandReq try to marshal commandReq to json encoded.
* MarshalCommandStatus marshal CommandStatus to json encode.
* MarshalCommandStatusReq marshal commandStatusReq to json encode.
* MarshalLogData marshal LogData to json encode.
* MarshalLogReq marshal LogReq to json encode.
* MarshalRepStatus marshal RepStatus to json encode.
* UnMarshalCommandData unmarshal json encoded data to *CommandData
* return *CommandData and nil if successful, otherwise return nil and error
*/.
* UnmarshalCommandReq parsing the body to *CommandReq.
* UnMarshalCommandStatus unmarshal json encoded data to *CommandStatus
* return *CommandStatus and nil if successful, otherwise return nil and error
*/.
* UnMarshalCommandStatusReq unmarshal json encoded data to *CommandStatusReq
* return *CommandStatusReq and nil if successful, otherwise return nil and error
*/.
* UnMarshalCommandStatus unmarshal json encoded data to *LogData
* return *LogData and nil if successful, otherwise return nil and error
*/.
* UnMarshallLogReq unmarshal json encoded data to *LogReq
* return *LogReq and nil if successful, otherwise return nil and error
*/.
* UnMarshalRepStatus unmarshal json encoded data to *RepStatus
* return *RepStatus and nil if successful, otherwise return nil and error
*/.
# Constants
表示客户端已成功接收了命令.
表示命令下发出错,且超过重试次数;或者命令创建成功后,超过指定时间未能成功下发,通常此时本状态是由定时任务设置的;或者客户端虽然接收到命令,但是命令未通过合法性检查。.
表示apiServer 已经创建好命令,等待下发给客户端执行.
表示apiServer创建命令出错(包括执行收集创建命令所需要数据或准备工作出错),创建出错的命令不能被执行,且由定时任务组件定时清除.
表示apiServer正在收集某个命令所需要的数据或执行命令创建的一些准备工作.
表示apiServer已经接收到命令已经执行完成,但是命令执行错误.
表示apiServer已经接收到命令已经执行完成,且命令已经正常成功执行.
表示命令已经成功下发,且apiServer已经收到关于本命令的至少一条状态信息.
表示apiServer正在下发命令给客户端执行。包括apiServer正与客户端通信,下发命令但是未收到成功接收的结果;下发出错,但是未超过重试次数.
表示命令已经成功下发,但是apiServer尚未收到任何关于本命令的状态信息.
表示命令已经成功下发,但是指定时间未能收到命令执行成功或错误的状态报告,通常此时本状态是由定时任务设置的.
表示状态是一个未知状态,这通常表示发生了一个未知错误.
不认识的命令。这通常表示agent收到了一个不认识的命名,或者apiserver收到了一个自己无法识别命令序列号的命令状态信息或命令日志信息.
# Variables
当添加或减少了上面定义的命令状态码的值,则下面这个切片的内容也需要相应的调整.
specifies a identifer of the node which agent running on it.
max lenght of customize node identifier.
# Structs
记录命令的数据.
记录服务端和客户发送具体的命令数据的数据结构.
当运行于被动模式时,客户端向服务端发送的用于获取要执行的命令时,所发请求的数据结构.
用于记录客户端主动上报或者接收查询时,客户端返回给服务端关于命令执行状态的数据结构。.
当apiServer以主动模式运行时,apiServer向客户发送的获取命令的执行状态的数据结构。.
用户记录发送日志信息的数据结构.
记录客户端向服务端发送日志的数据结构,这包括当apiServer运行于主动模式时,客户端响应服务端的请求向服务端发送的日志数据;
这包括当apiServer运行于被动模式时,客户端主动向服务端发送的日志数据.
当apiServer以主动模式运行时,apiServer向客户发送的获取客户执行某条命令日志信息的请求数据结构。.
用于记录客户端根据配置或者apiServer的要求埴写的,用于标识自身的标识符。.
通用的,用户响应一般请求的响应数据的数据结构.
# Type aliases
下面定义的是命令生命周期的各个状态常量.