eventscript: expost call names and enum
[metze/ctdb/wip.git] / include / ctdb.h
index 6721841aaffcff05c1abe9e70e1af0f641eab7a1..a17abca4fe82a786e888d53b47e3f2febc77c9cf 100644 (file)
@@ -667,6 +667,24 @@ struct ctdb_scripts_wire {
        struct ctdb_script_wire scripts[1];
 };
 
+/* different calls to event scripts. */
+enum ctdb_eventscript_call {
+       CTDB_EVENT_STARTUP,             /* CTDB starting up: no args. */
+       CTDB_EVENT_START_RECOVERY,      /* CTDB recovery starting: no args. */
+       CTDB_EVENT_RECOVERED,           /* CTDB recovery finished: no args. */
+       CTDB_EVENT_TAKE_IP,             /* IP taken: interface, IP address, netmask bits. */
+       CTDB_EVENT_RELEASE_IP,          /* IP released: interface, IP address, netmask bits. */
+       CTDB_EVENT_STOPPED,             /* This node is stopped: no args. */
+       CTDB_EVENT_MONITOR,             /* Please check if service is healthy: no args. */
+       CTDB_EVENT_STATUS,              /* Report service status: no args. */
+       CTDB_EVENT_SHUTDOWN,            /* CTDB shutting down: no args. */
+       CTDB_EVENT_RELOAD,              /* magic */
+       CTDB_EVENT_MAX
+};
+
+/* Mapping from enum to names. */
+extern const char *ctdb_eventscript_call_names[];
+
 int ctdb_ctrl_getscriptstatus(struct ctdb_context *ctdb, 
                    struct timeval timeout, uint32_t destnode, 
                    TALLOC_CTX *mem_ctx, struct ctdb_scripts_wire **script_status);