MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / main

Function main

tools/cibadmin.c:214–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214int
215main(int argc, char **argv)
216{
217 int argerr = 0;
218 int flag;
219 const char *source = NULL;
220 char *admin_input_xml = NULL;
221 char *admin_input_file = NULL;
222 gboolean dangerous_cmd = FALSE;
223 gboolean admin_input_stdin = FALSE;
224 xmlNode *output = NULL;
225 xmlNode *input = NULL;
226
227 int option_index = 0;
228
229 crm_log_init(NULL, LOG_CRIT, FALSE, FALSE, argc, argv, FALSE);
230 crm_set_options(NULL, "command [options] [data]", long_options,
231 "Provides direct access to the cluster configuration."
232 "\n\nAllows the configuration, or sections of it, to be queried, modified, replaced and deleted."
233 "\n\nWhere necessary, XML data will be obtained using the -X, -x, or -p options\n");
234
235 if (argc < 2) {
236 crm_help('?', EX_USAGE);
237 }
238
239 while (1) {
240 flag = crm_get_option(argc, argv, &option_index);
241 if (flag == -1)
242 break;
243
244 switch (flag) {
245 case 't':
246 message_timeout_ms = atoi(optarg);
247 if (message_timeout_ms < 1) {
248 message_timeout_ms = 30;
249 }
250 break;
251 case 'A':
252 obj_type = strdup(optarg);
253 command_options |= cib_xpath;
254 break;
255 case 'e':
256 command_options |= cib_xpath_address;
257 break;
258 case 'u':
259 cib_action = CIB_OP_UPGRADE;
260 dangerous_cmd = TRUE;
261 break;
262 case 'E':
263 cib_action = CIB_OP_ERASE;
264 dangerous_cmd = TRUE;
265 break;
266 case 'Q':
267 cib_action = CIB_OP_QUERY;
268 break;
269 case 'P':
270 cib_action = CIB_OP_APPLY_DIFF;
271 break;

Callers

nothing calls this directly

Calls 15

crm_log_initFunction · 0.85
crm_set_optionsFunction · 0.85
crm_helpFunction · 0.85
crm_get_optionFunction · 0.85
crm_bump_log_levelFunction · 0.85
createEmptyCibFunction · 0.85
crm_xml_addFunction · 0.85
crm_xml_add_intFunction · 0.85
dump_xml_formattedFunction · 0.85
filename2xmlFunction · 0.85
string2xmlFunction · 0.85
stdin2xmlFunction · 0.85

Tested by

no test coverage detected