Enable destruction of servers
The servers can now be destroyed which removes them from the list of active servers. If the server was not created at runtime, a warning is logged.
This commit is contained in:
@ -233,4 +233,11 @@ connect_result_t mon_connect_to_db(MONITOR* mon, MONITOR_SERVERS *database);
|
||||
void mon_log_connect_error(MONITOR_SERVERS* database, connect_result_t rval);
|
||||
void mon_log_state_change(MONITOR_SERVERS *ptr);
|
||||
|
||||
/**
|
||||
* Check if a monitor uses @c servers
|
||||
* @param server Server that is queried
|
||||
* @return True if server is used by at least one monitor
|
||||
*/
|
||||
bool monitor_server_in_use(const SERVER *server);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
@ -243,4 +243,13 @@ extern void server_update_ssl(SERVER *server, const char *key, const char *value
|
||||
*/
|
||||
bool server_serialize(SERVER *server);
|
||||
|
||||
/**
|
||||
* @brief Destroy a server
|
||||
*
|
||||
* This removes any created server configuration files and marks the server removed
|
||||
* If the server is not in use.
|
||||
* @param server Server to destroy
|
||||
*/
|
||||
void server_destroy(SERVER *server);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
@ -257,4 +257,11 @@ static inline uint64_t service_get_capabilities(const SERVICE *service)
|
||||
return service->capabilities;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a service uses @c servers
|
||||
* @param server Server that is queried
|
||||
* @return True if server is used by at least one service
|
||||
*/
|
||||
bool service_server_in_use(const SERVER *server);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
Reference in New Issue
Block a user