* Added: stats RPC for clixon XML and memory statistics.
  * Added: restart-plugin RPC for restarting individual plugins without restarting backend.
* xml-stats moved from clixon-config.yang as state data to an rpc `datastats` in clixon-lib.yang
* Experimental: restart_plugin
* Two new plugin callbacks added
  * ca_daemon: Called just after a server has "daemonized", ie put in background.
  * ca_trans_commit_done: Called when all plugin commits have been done.
    * Note: If you have used "end" callback and usign transaction data, you should probably use this instead.
This commit is contained in:
Olof hagsand 2020-04-28 22:10:06 +02:00
parent 1c99bd6a9b
commit 9a8c6cf3e6
25 changed files with 926 additions and 308 deletions

View file

@ -159,6 +159,15 @@ main_commit(clicon_handle h,
return 0;
}
int
main_commit_done(clicon_handle h,
transaction_data td)
{
if (_transaction_log)
transaction_log(h, td, LOG_NOTICE, __FUNCTION__);
return 0;
}
int
main_revert(clicon_handle h,
transaction_data td)
@ -802,6 +811,18 @@ example_start(clicon_handle h)
return 0;
}
/*! Plugin daemon.
* @param[in] h Clicon handle
*
* plugin_daemon is called once after damonization has been made but before lowering of privileges
* the main event loop is entered.
*/
int
example_daemon(clicon_handle h)
{
return 0;
}
int
example_exit(clicon_handle h)
{
@ -816,12 +837,14 @@ static clixon_plugin_api api = {
example_start, /* start */
example_exit, /* exit */
.ca_extension=example_extension, /* yang extensions */
.ca_daemon=example_daemon, /* daemon */
.ca_reset=example_reset, /* reset */
.ca_statedata=example_statedata, /* statedata */
.ca_trans_begin=main_begin, /* trans begin */
.ca_trans_validate=main_validate, /* trans validate */
.ca_trans_complete=main_complete, /* trans complete */
.ca_trans_commit=main_commit, /* trans commit */
.ca_trans_commit_done=main_commit_done, /* trans commit done */
.ca_trans_revert=main_revert, /* trans revert */
.ca_trans_end=main_end, /* trans end */
.ca_trans_abort=main_abort, /* trans abort */