root/tools/crm_resource.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright 2004-2020 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 #include <crm_internal.h>
  11 #include <crm/crm.h>
  12 
  13 #include <crm/msg_xml.h>
  14 #include <crm/services.h>
  15 #include <crm/common/xml.h>
  16 #include <crm/common/mainloop.h>
  17 
  18 #include <crm/cib.h>
  19 #include <crm/common/attrd_internal.h>
  20 #include <crm/pengine/rules.h>
  21 #include <crm/pengine/status.h>
  22 #include <crm/pengine/internal.h>
  23 #include <pacemaker-internal.h>
  24 
  25 extern bool BE_QUIET;
  26 
  27 /* ban */
  28 int cli_resource_prefer(const char *rsc_id, const char *host, const char *move_lifetime,
  29                         cib_t * cib_conn, int cib_options, gboolean promoted_role_only);
  30 int cli_resource_ban(const char *rsc_id, const char *host, const char *move_lifetime,
  31                      GListPtr allnodes, cib_t * cib_conn, int cib_options,
  32                      gboolean promoted_role_only);
  33 int cli_resource_clear(const char *rsc_id, const char *host, GListPtr allnodes,
  34                        cib_t * cib_conn, int cib_options, bool clear_ban_constraints, gboolean force);
  35 int cli_resource_clear_all_expired(xmlNode *root, cib_t *cib_conn, int cib_options,
  36                                    const char *rsc, const char *node, gboolean promoted_role_only);
  37 
  38 /* print */
  39 void cli_resource_print_cts(pe_resource_t * rsc);
  40 void cli_resource_print_raw(pe_resource_t * rsc);
  41 void cli_resource_print_cts_constraints(pe_working_set_t * data_set);
  42 void cli_resource_print_location(pe_resource_t * rsc, const char *prefix);
  43 void cli_resource_print_colocation(pe_resource_t * rsc, bool dependents, bool recursive, int offset);
  44 
  45 int cli_resource_print(pe_resource_t *rsc, pe_working_set_t *data_set,
  46                        bool expanded);
  47 int cli_resource_print_list(pe_working_set_t * data_set, bool raw);
  48 int cli_resource_print_attribute(pe_resource_t *rsc, const char *attr, const char *attr_set_type,
  49                                  pe_working_set_t *data_set);
  50 int cli_resource_print_property(pe_resource_t *rsc, const char *attr,
  51                                 pe_working_set_t *data_set);
  52 int cli_resource_print_operations(const char *rsc_id, const char *host_uname, bool active, pe_working_set_t * data_set);
  53 
  54 /* runtime */
  55 void cli_resource_check(cib_t * cib, pe_resource_t *rsc);
  56 int cli_resource_fail(pcmk_ipc_api_t *controld_api,
  57                       const char *host_uname, const char *rsc_id,
  58                       pe_working_set_t *data_set);
  59 int cli_resource_search(pe_resource_t *rsc, const char *requested_name,
  60                         pe_working_set_t *data_set);
  61 int cli_resource_delete(pcmk_ipc_api_t *controld_api,
  62                         const char *host_uname, pe_resource_t *rsc,
  63                         const char *operation, const char *interval_spec,
  64                         bool just_failures, pe_working_set_t *data_set,
  65                         gboolean force);
  66 int cli_cleanup_all(pcmk_ipc_api_t *controld_api, const char *node_name,
  67                     const char *operation, const char *interval_spec,
  68                     pe_working_set_t *data_set);
  69 int cli_resource_restart(pe_resource_t *rsc, const char *host, const char *move_lifetime,
  70                          int timeout_ms, cib_t *cib, int cib_options,
  71                          gboolean promoted_role_only, gboolean force);
  72 int cli_resource_move(pe_resource_t *rsc, const char *rsc_id,
  73                       const char *host_name, const char *move_lifetime,
  74                       cib_t *cib, int cib_options, pe_working_set_t *data_set,
  75                       gboolean promoted_role_only, gboolean force);
  76 crm_exit_t cli_resource_execute_from_params(const char *rsc_name, const char *rsc_class,
  77                                             const char *rsc_prov, const char *rsc_type,
  78                                             const char *rsc_action, GHashTable *params,
  79                                             GHashTable *override_hash, int timeout_ms,
  80                                             int resource_verbose, gboolean force);
  81 crm_exit_t cli_resource_execute(pe_resource_t *rsc, const char *requested_name,
  82                                 const char *rsc_action, GHashTable *override_hash,
  83                                 int timeout_ms, cib_t *cib, pe_working_set_t *data_set,
  84                                 int resource_verbose, gboolean force);
  85 
  86 int cli_resource_update_attribute(pe_resource_t *rsc, const char *requested_name,
  87                                   const char *attr_set, const char *attr_set_type,
  88                                   const char *attr_id, const char *attr_name,
  89                                   const char *attr_value, gboolean recursive, cib_t *cib,
  90                                   int cib_options, pe_working_set_t *data_set, gboolean force);
  91 int cli_resource_delete_attribute(pe_resource_t *rsc, const char *requested_name,
  92                                   const char *attr_set, const char *attr_set_type,
  93                                   const char *attr_id, const char *attr_name, cib_t *cib,
  94                                   int cib_options, pe_working_set_t *data_set, gboolean force);
  95 
  96 int update_working_set_xml(pe_working_set_t *data_set, xmlNode **xml);
  97 int wait_till_stable(int timeout_ms, cib_t * cib);
  98 void cli_resource_why(cib_t *cib_conn, GListPtr resources, pe_resource_t *rsc,
  99                       pe_node_t *node);

/* [previous][next][first][last][top][bottom][index][help] */