From: Aurelien DARRAGON Date: Wed, 22 Mar 2023 16:49:04 +0000 (+0100) Subject: MINOR: hlua/event_hdl: expose proxy_uuid variable in server events X-Git-Tag: v2.8-dev8~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55f84c7cabca6c5a26100204fcd81b454c737ed1;p=thirdparty%2Fhaproxy.git MINOR: hlua/event_hdl: expose proxy_uuid variable in server events Adding proxy_uuid to ServerEvent class. proxy_uuid contains the uuid of the proxy to which the server belongs --- diff --git a/doc/lua-api/index.rst b/doc/lua-api/index.rst index f25f9dce18..1bb49978dc 100644 --- a/doc/lua-api/index.rst +++ b/doc/lua-api/index.rst @@ -1405,6 +1405,10 @@ ServerEvent class Contains the name of the proxy to which the server belongs +.. js:attribute:: ServerEvent.proxy_uuid + + Contains the uuid of the proxy to which the server belongs + .. js:attribute:: ServerEvent.reference Reference to the live server (A :ref:`server_class`). diff --git a/src/hlua.c b/src/hlua.c index e6856c8223..747e6e8658 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -9059,6 +9059,10 @@ __LJMP static int hlua_event_hdl_cb_data_push_args(struct hlua_event_sub *hlua_s lua_pushstring(hlua->T, "proxy_name"); lua_pushstring(hlua->T, e_server->safe.proxy_name); lua_settable(hlua->T, -3); + /* Add server proxy uuid */ + lua_pushstring(hlua->T, "proxy_uuid"); + lua_pushinteger(hlua->T, e_server->safe.proxy_uuid); + lua_settable(hlua->T, -3); /* attempt to provide reference server object * (if it wasn't removed yet, SERVER_DEL will never succeed here)