/** * Tencent is pleased to support the open source community by making Tars available. * * Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. * * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * https://opensource.org/licenses/BSD-3-Clause * * Unless required by applicable law or agreed to in writing, software distributed * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ module tars { enum ServerState { Inactive, Activating, Active, Deactivating, Destroying, Destroyed }; struct LoadInfo { //过去1分钟负载 0 require float avg1; //过去5分钟负载 1 require float avg5; //过去15分钟负载 2 require float avg15; //1分钟内cpu使用率均值 3 optional int avgCpu; }; struct PatchInfo { //是否正在发布 0 require bool bPatching = false; //发布百分比 1 require int iPercent; //最近百分比修改时间 2 require int iModifyTime; //版本 3 require string sVersion; //结果描述 4 require string sResult; //发布结果 5 optional bool bSucc = false; }; /** * 预发布的进度信息 */ struct PreparePatchInfo { //是否正在发布 0 require bool bPreparePatching = false; //发布百分比 1 require int iPercent; //最近百分比修改时间 2 require int iModifyTime; //版本 3 require string sVersion; //结果描述 4 require string sResult; //预发布结果, 0:成功,其他失败,失败原因见sResult 5 optional int ret = 0; }; struct NodeInfo { 0 require string nodeName; 1 require string nodeObj; 2 require string endpointIp; 3 require int endpointPort; 4 require short timeOut; 5 require string dataDir; 6 optional string version; //启动tarsnode时,从start.tmp获取,设置的core大小,core file size,因为可能值为unlimited 7 optional string coreFileSize; //启动tarsnode时,从start.tmp获取,设置的open files 8 optional int openFiles; }; struct ServerStateInfo { //present state 0 require ServerState serverState; 1 require int processId; 2 optional string nodeName; 3 optional string application; 4 optional string serverName; //setting states 5 optional ServerState settingState; }; struct PatchRequest { 0 require string appname; 1 require string servername; 2 require string nodename; 3 require string groupname; 4 require string binname; 5 require string version; 6 require string user; 7 require string servertype; 8 require string patchobj; 9 require string md5; //操作系统类型,如:suse、tlinux等 10 optional string ostype; // 带路径的发布包文件名,如果未指定filepath,则node将根据appname、servername、version、ostype等按规则组装发布包文件路径; // 若已指定filepath,则node从filepath下载发布包,node不检查filepath的合法性。 11 optional string filepath; }; struct PreparePatchRequest { 0 require string appname; 1 require string servername; 2 require string groupname; 3 require string version; 4 require string user; 5 require string servertype; 6 require string patchobj; 7 require string md5; //操作系统类型,如:suse、tlinux等 8 require string ostype; //指定的node列表进行预发布。specialNodeList为空表示发布所有节点 9 require vector specialNodeList; // 带路径的发布包文件名,如果未指定filepath,则node将根据appname、servername、version、ostype等按规则组装发布包文件路径; // 若已指定filepath,则node从filepath下载发布包,node不检查filepath的合法性。 10 optional string filepath; }; //定义主键,用于node内队列的去重 key[PreparePatchRequest, appname, servername, version]; };