summaryrefslogtreecommitdiffstats
path: root/include/crm/common/ipc_schedulerd.h
blob: 096e2d8f232d518ace1e0a2e0c222f3e8553e358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * Copyright 2021-2024 the Pacemaker project contributors
 *
 * The version control history for this file may have further details.
 *
 * This source code is licensed under the GNU Lesser General Public License
 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
 */

#ifndef PCMK__CRM_COMMON_IPC_SCHEDULERD__H
#define PCMK__CRM_COMMON_IPC_SCHEDULERD__H

#include <crm/common/ipc.h>  // pcmk_ipc_api_t

#ifdef __cplusplus
extern "C" {
#endif

/**
 * \file
 * \brief IPC commands for Schedulerd
 *
 * \ingroup core
 */


//! Possible types of schedulerd replies
enum pcmk_schedulerd_api_reply {
    pcmk_schedulerd_reply_unknown,
    pcmk_schedulerd_reply_graph,
};

/*!
 * Schedulerd reply passed to event callback
 */
typedef struct {
    enum pcmk_schedulerd_api_reply reply_type;

    union {
        // pcmk__schedulerd_reply_graph
        struct {
            xmlNode *tgraph;
            const char *reference;
            const char *input;
        } graph;
    } data;
} pcmk_schedulerd_api_reply_t;

/*!
 * \brief Make an IPC request to the scheduler for the transition graph
 *
 * \param[in,out] api  IPC API connection
 * \param[in]     cib  The CIB to create a transition graph for
 * \param[out]    ref  The reference ID a response will have
 *
 * \return Standard Pacemaker return code
 */
int pcmk_schedulerd_api_graph(pcmk_ipc_api_t *api, xmlNode *cib, char **ref);

#ifdef __cplusplus
}
#endif

#endif // PCMK__CRM_COMMON_IPC_SCHEDULERD__H