2017-06-16 17:00:49 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
struct req_t
|
|
|
|
{
|
|
|
|
acl::string cmd;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct res_t
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
acl::string msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-07-24 16:06:29 +08:00
|
|
|
struct proc_info_t
|
|
|
|
{
|
|
|
|
int pid;
|
|
|
|
long start;
|
|
|
|
|
|
|
|
proc_info_t()
|
|
|
|
{
|
|
|
|
pid = -1;
|
|
|
|
start = 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-06-16 17:00:49 +08:00
|
|
|
struct serv_info_t
|
|
|
|
{
|
2017-07-24 16:06:29 +08:00
|
|
|
int status;
|
2017-06-16 17:00:49 +08:00
|
|
|
acl::string name;
|
2017-07-24 16:06:29 +08:00
|
|
|
int type;
|
|
|
|
long start;
|
2017-06-16 17:00:49 +08:00
|
|
|
// Gson@optional
|
|
|
|
acl::string owner;
|
|
|
|
acl::string path;
|
2017-07-17 15:30:52 +08:00
|
|
|
acl::string conf;
|
2017-07-24 16:06:29 +08:00
|
|
|
int proc_max;
|
|
|
|
int proc_prefork;
|
|
|
|
int proc_total;
|
|
|
|
int proc_avail;
|
|
|
|
int throttle_delay;
|
|
|
|
int listen_fd_count;
|
2017-06-16 17:00:49 +08:00
|
|
|
// Gson@optional
|
|
|
|
acl::string notify_addr;
|
|
|
|
// Gson@optional
|
|
|
|
acl::string notify_recipients;
|
|
|
|
std::map<acl::string, acl::string> env;
|
2017-07-24 16:06:29 +08:00
|
|
|
// Gson@optional
|
|
|
|
std::list<proc_info_t> procs;
|
2017-07-17 16:19:46 +08:00
|
|
|
|
|
|
|
serv_info_t()
|
|
|
|
{
|
|
|
|
status = 0;
|
2017-07-24 16:06:29 +08:00
|
|
|
type = 0;
|
|
|
|
start = 0;
|
2017-07-17 16:19:46 +08:00
|
|
|
}
|
2017-06-16 17:00:49 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
struct list_req_t : req_t
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
struct list_res_t : res_t
|
|
|
|
{
|
2017-07-17 16:19:46 +08:00
|
|
|
// Gson@optional
|
2017-07-21 11:57:23 +08:00
|
|
|
std::vector<serv_info_t> data;
|
2017-06-16 17:00:49 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-06-26 12:34:23 +08:00
|
|
|
struct stat_req_data_t
|
|
|
|
{
|
2017-06-27 17:11:04 +08:00
|
|
|
acl::string path;
|
2017-06-26 12:34:23 +08:00
|
|
|
};
|
|
|
|
|
2017-06-16 17:00:49 +08:00
|
|
|
struct stat_req_t : req_t
|
|
|
|
{
|
2017-06-26 12:34:23 +08:00
|
|
|
std::vector<stat_req_data_t> data;
|
2017-06-16 17:00:49 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct stat_res_t : res_t
|
|
|
|
{
|
|
|
|
std::vector<serv_info_t> data;
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-06-27 17:11:04 +08:00
|
|
|
struct start_req_data_t
|
|
|
|
{
|
|
|
|
acl::string path;
|
|
|
|
};
|
|
|
|
|
2017-06-16 17:00:49 +08:00
|
|
|
struct start_req_t : req_t
|
|
|
|
{
|
2017-10-27 00:00:41 +08:00
|
|
|
// Gson@optional
|
|
|
|
long long timeout;
|
2017-06-27 17:11:04 +08:00
|
|
|
std::vector<start_req_data_t> data;
|
|
|
|
|
2017-10-27 00:00:41 +08:00
|
|
|
start_req_t(void) : timeout(-1) {}
|
2017-06-16 17:00:49 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct start_res_data_t
|
|
|
|
{
|
2017-10-27 00:00:41 +08:00
|
|
|
start_res_data_t(void)
|
|
|
|
{
|
|
|
|
status = 0;
|
|
|
|
proc_count = 0;
|
|
|
|
proc_signaled = 0;
|
|
|
|
proc_ok = 0;
|
|
|
|
proc_err = 0;
|
|
|
|
}
|
|
|
|
|
2017-06-16 17:00:49 +08:00
|
|
|
int status;
|
2017-10-27 00:00:41 +08:00
|
|
|
int proc_count;
|
|
|
|
int proc_signaled;
|
|
|
|
int proc_ok;
|
|
|
|
int proc_err;
|
|
|
|
|
2017-06-16 17:00:49 +08:00
|
|
|
acl::string name;
|
|
|
|
// Gson@optional
|
|
|
|
acl::string path;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct start_res_t : res_t
|
|
|
|
{
|
|
|
|
std::vector<start_res_data_t> data;
|
|
|
|
};
|
|
|
|
|
2017-07-21 12:17:02 +08:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
struct restart_req_data_t
|
|
|
|
{
|
|
|
|
acl::string path;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct restart_req_t : req_t
|
|
|
|
{
|
|
|
|
std::vector<restart_req_data_t> data;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct restart_res_data_t
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
acl::string name;
|
|
|
|
// Gson@optional
|
|
|
|
acl::string path;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct restart_res_t : res_t
|
|
|
|
{
|
|
|
|
std::vector<restart_res_data_t> data;
|
|
|
|
};
|
|
|
|
|
2017-06-16 17:00:49 +08:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-06-26 12:34:23 +08:00
|
|
|
struct stop_req_data_t
|
|
|
|
{
|
2017-06-27 17:11:04 +08:00
|
|
|
acl::string path;
|
2017-06-26 12:34:23 +08:00
|
|
|
};
|
|
|
|
|
2017-06-16 17:00:49 +08:00
|
|
|
struct stop_req_t : req_t
|
|
|
|
{
|
2017-06-26 12:34:23 +08:00
|
|
|
std::vector<stop_req_data_t> data;
|
2017-06-16 17:00:49 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct stop_res_data_t
|
|
|
|
{
|
|
|
|
int status;
|
2017-06-27 17:11:04 +08:00
|
|
|
acl::string path;
|
2017-06-16 17:00:49 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct stop_res_t : res_t
|
|
|
|
{
|
|
|
|
std::vector<stop_res_data_t> data;
|
|
|
|
};
|
2017-06-27 17:11:04 +08:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-07-07 15:36:40 +08:00
|
|
|
struct kill_req_data_t
|
|
|
|
{
|
|
|
|
acl::string path;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct kill_req_t : req_t
|
|
|
|
{
|
|
|
|
std::vector<kill_req_data_t> data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct kill_res_data_t
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
acl::string path;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct kill_res_t : res_t
|
|
|
|
{
|
|
|
|
std::vector<kill_res_data_t> data;
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-06-27 17:11:04 +08:00
|
|
|
struct reload_req_data_t
|
|
|
|
{
|
|
|
|
acl::string path;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct reload_req_t : req_t
|
|
|
|
{
|
2017-09-09 23:05:33 +08:00
|
|
|
// Gson@optional
|
|
|
|
long long timeout;
|
2017-06-27 17:11:04 +08:00
|
|
|
std::vector<reload_req_data_t> data;
|
2017-09-09 23:05:33 +08:00
|
|
|
|
|
|
|
reload_req_t(void) : timeout(-1) {}
|
2017-06-27 17:11:04 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct reload_res_data_t
|
|
|
|
{
|
2017-09-22 18:05:34 +08:00
|
|
|
reload_res_data_t(void)
|
|
|
|
{
|
|
|
|
status = 0;
|
|
|
|
proc_count = 0;
|
|
|
|
proc_signaled = 0;
|
|
|
|
proc_ok = 0;
|
|
|
|
proc_err = 0;
|
|
|
|
}
|
|
|
|
|
2017-06-27 17:11:04 +08:00
|
|
|
int status;
|
|
|
|
int proc_count;
|
|
|
|
int proc_signaled;
|
2017-09-09 23:05:33 +08:00
|
|
|
int proc_ok;
|
|
|
|
int proc_err;
|
2017-10-27 00:00:41 +08:00
|
|
|
|
2017-06-27 17:11:04 +08:00
|
|
|
acl::string path;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct reload_res_t : res_t
|
|
|
|
{
|
|
|
|
std::vector<reload_res_data_t> data;
|
|
|
|
};
|
2017-11-21 12:43:34 +08:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
struct master_config_req_t : req_t
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
struct master_config_res_t : res_t
|
|
|
|
{
|
|
|
|
std::map<acl::string, acl::string> data;
|
|
|
|
};
|