]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: lua: add uuid to the Class Proxy
authorBaptiste Assmann <bedis9@gmail.com>
Thu, 26 Oct 2017 19:51:58 +0000 (21:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 Oct 2017 08:26:41 +0000 (10:26 +0200)
the proxy UUID parameter is not set in the Lua Proxy Class.
This patches adds it.

doc/lua-api/index.rst
src/hlua_fcn.c

index 822f8bc978375501c26f7cf6538284f62cdbb64c..96367f601b22ce643689f47c87e0bc15e79dd909 100644 (file)
@@ -823,6 +823,10 @@ Proxy class
 
   Contain the name of the proxy.
 
+.. js:attribute:: Proxy.uuid
+
+  Contain the unique identifier of the proxy.
+
 .. js:attribute:: Proxy.servers
 
   Contain an array with the attached servers. Each server entry is an object of
index 2ae1bbb29e9a6e89672094aa6c7ec2c282476c19..9a7e65722b0ef6411a0211143ddd1e89bab63c60 100644 (file)
@@ -781,6 +781,12 @@ int hlua_fcn_new_proxy(lua_State *L, struct proxy *px)
        lua_pushstring(L, px->id);
        lua_settable(L, -3);
 
+       /* Add proxy uuid. */
+       lua_pushstring(L, "uuid");
+       snprintf(buffer, sizeof(buffer), "%d", px->uuid);
+       lua_pushstring(L, buffer);
+       lua_settable(L, -3);
+
        /* Browse and register servers. */
        lua_pushstring(L, "servers");
        lua_newtable(L);