1 /* 2 * Copyright 2021-2022 the Pacemaker project contributors 3 * 4 * The version control history for this file may have further details. 5 * 6 * This source code is licensed under the GNU Lesser General Public License 7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY. 8 */ 9 10 #ifndef PCMK__CRM_COMMON_IPC_SCHEDULERD__H 11 # define PCMK__CRM_COMMON_IPC_SCHEDULERD__H 12 13 #include <crm/common/ipc.h> // pcmk_ipc_api_t 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 /** 20 * \file 21 * \brief IPC commands for Schedulerd 22 * 23 * \ingroup core 24 */ 25 26 27 //! Possible types of schedulerd replies 28 enum pcmk_schedulerd_api_reply { 29 pcmk_schedulerd_reply_unknown, 30 pcmk_schedulerd_reply_graph, 31 }; 32 33 /*! 34 * Schedulerd reply passed to event callback 35 */ 36 typedef struct { 37 enum pcmk_schedulerd_api_reply reply_type; 38 39 union { 40 // pcmk__schedulerd_reply_graph 41 struct { 42 xmlNode *tgraph; 43 const char *reference; 44 const char *input; 45 } graph; 46 } data; 47 } pcmk_schedulerd_api_reply_t; 48 49 /*! 50 * \brief Make an IPC request to the scheduler for the transition graph 51 * 52 * \param[in,out] api IPC API connection 53 * \param[in] cib The CIB to create a transition graph for 54 * \param[out] ref The reference ID a response will have 55 * 56 * \return Standard Pacemaker return code 57 */ 58 int pcmk_schedulerd_api_graph(pcmk_ipc_api_t *api, xmlNode *cib, char **ref); 59 60 #ifdef __cplusplus 61 } 62 #endif 63 64 #endif // PCMK__CRM_COMMON_IPC_SCHEDULERD__H