1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include <crm_internal.h>
21 #include <crm/crm.h>
22
23 #include <crm/msg_xml.h>
24 #include <crm/services.h>
25 #include <crm/common/xml.h>
26 #include <crm/common/mainloop.h>
27
28 #include <crm/cib.h>
29 #include <crm/attrd.h>
30 #include <crm/pengine/rules.h>
31 #include <crm/pengine/status.h>
32 #include <crm/pengine/internal.h>
33 #include "../pengine/pengine.h"
34 #include "fake_transition.h"
35
36 extern bool print_pending;
37
38 extern bool scope_master;
39 extern bool do_force;
40 extern bool BE_QUIET;
41 extern int resource_verbose;
42
43 extern int cib_options;
44 extern int crmd_replies_needed;
45
46 extern char *move_lifetime;
47
48 extern const char *attr_set_type;
49
50
51 int cli_resource_prefer(const char *rsc_id, const char *host, cib_t * cib_conn);
52 int cli_resource_ban(const char *rsc_id, const char *host, GListPtr allnodes, cib_t * cib_conn);
53 int cli_resource_clear(const char *rsc_id, const char *host, GListPtr allnodes, cib_t * cib_conn);
54
55
56 void cli_resource_print_cts(resource_t * rsc);
57 void cli_resource_print_raw(resource_t * rsc);
58 void cli_resource_print_cts_constraints(pe_working_set_t * data_set);
59 void cli_resource_print_location(resource_t * rsc, const char *prefix);
60 void cli_resource_print_colocation(resource_t * rsc, bool dependents, bool recursive, int offset);
61
62 int cli_resource_print(resource_t *rsc, pe_working_set_t *data_set,
63 bool expanded);
64 int cli_resource_print_list(pe_working_set_t * data_set, bool raw);
65 int cli_resource_print_attribute(resource_t *rsc, const char *attr,
66 pe_working_set_t *data_set);
67 int cli_resource_print_property(resource_t *rsc, const char *attr,
68 pe_working_set_t *data_set);
69 int cli_resource_print_operations(const char *rsc_id, const char *host_uname, bool active, pe_working_set_t * data_set);
70
71
72 void cli_resource_check(cib_t * cib, resource_t *rsc);
73 int cli_resource_fail(crm_ipc_t * crmd_channel, const char *host_uname, const char *rsc_id, pe_working_set_t * data_set);
74 int cli_resource_search(resource_t *rsc, const char *requested_name,
75 pe_working_set_t *data_set);
76 int cli_resource_delete(crm_ipc_t *crmd_channel, const char *host_uname,
77 resource_t *rsc, const char *operation,
78 const char *interval, pe_working_set_t *data_set);
79 int cli_resource_restart(resource_t * rsc, const char *host, int timeout_ms, cib_t * cib);
80 int cli_resource_move(resource_t *rsc, const char *rsc_id,
81 const char *host_name, cib_t *cib,
82 pe_working_set_t *data_set);
83 int cli_resource_execute(resource_t *rsc, const char *requested_name,
84 const char *rsc_action, GHashTable *override_hash,
85 int timeout_ms, cib_t *cib,
86 pe_working_set_t *data_set);
87
88 int cli_resource_update_attribute(resource_t *rsc, const char *requested_name,
89 const char *attr_set, const char *attr_id,
90 const char *attr_name, const char *attr_value,
91 bool recursive, cib_t *cib,
92 pe_working_set_t *data_set);
93 int cli_resource_delete_attribute(resource_t *rsc, const char *requested_name,
94 const char *attr_set, const char *attr_id,
95 const char *attr_name, cib_t *cib,
96 pe_working_set_t *data_set);
97
98 int update_working_set_xml(pe_working_set_t *data_set, xmlNode **xml);
99 int wait_till_stable(int timeout_ms, cib_t * cib);
100 void cli_resource_why(cib_t *cib_conn, GListPtr resources, resource_t *rsc,
101 node_t *node);
102
103 extern xmlNode *do_calculations(pe_working_set_t * data_set, xmlNode * xml_input, crm_time_t * now);
104 extern void cleanup_alloc_calculations(pe_working_set_t * data_set);
105
106 #define CMD_ERR(fmt, args...) do { \
107 crm_warn(fmt, ##args); \
108 fprintf(stderr, fmt"\n", ##args); \
109 } while(0)
110