root/lib/pacemaker/pcmk_options.c

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

DEFINITIONS

This source file includes following definitions.
  1. pcmk__list_cluster_options
  2. pcmk_list_cluster_options
  3. pcmk__list_fencing_params
  4. pcmk_list_fencing_params
  5. pcmk__list_primitive_meta
  6. pcmk_list_primitive_meta

   1 /*
   2  * Copyright 2024 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 
  12 #include <libxml/tree.h>    // xmlNode
  13 
  14 #include <pacemaker.h>
  15 #include <pacemaker-internal.h>
  16 
  17 /*!
  18  * \internal
  19  * \brief List all available cluster options
  20  *
  21  * These are options that affect the entire cluster.
  22  *
  23  * \param[in,out] out  Output object
  24  * \param[in]     all  If \c true, include advanced and deprecated options (this
  25  *                     is always treated as true for XML output objects)
  26  *
  27  * \return Standard Pacemaker return code
  28  */
  29 int
  30 pcmk__list_cluster_options(pcmk__output_t *out, bool all)
     /* [previous][next][first][last][top][bottom][index][help] */
  31 {
  32     const char *name = "cluster-options";
  33     const char *desc_short = "Pacemaker cluster options";
  34     const char *desc_long = NULL;
  35 
  36     // Can't use string constants because desc_long may be translated by gettext
  37     desc_long = "Also known as properties, these are options that affect "
  38                 "behavior across the entire cluster. They are configured "
  39                 "within cluster_property_set elements inside the crm_config "
  40                 "subsection of the CIB configuration section.";
  41 
  42     return pcmk__output_cluster_options(out, name, desc_short, desc_long,
  43                                         pcmk__opt_none, all);
  44 }
  45 
  46 // Documented in header
  47 int
  48 pcmk_list_cluster_options(xmlNode **xml, bool all)
     /* [previous][next][first][last][top][bottom][index][help] */
  49 {
  50     pcmk__output_t *out = NULL;
  51     int rc = pcmk_rc_ok;
  52 
  53     rc = pcmk__xml_output_new(&out, xml);
  54     if (rc != pcmk_rc_ok) {
  55         return rc;
  56     }
  57 
  58     pcmk__register_lib_messages(out);
  59 
  60     rc = pcmk__list_cluster_options(out, all);
  61 
  62     pcmk__xml_output_finish(out, pcmk_rc2exitc(rc), xml);
  63     return rc;
  64 }
  65 
  66 /*!
  67  * \internal
  68  * \brief List common fencing resource parameters
  69  *
  70  * These are parameters that are available for all fencing resources, regardless
  71  * of type. They are processed by Pacemaker, rather than by the fence agent or
  72  * the fencing library.
  73  *
  74  * \param[in,out] out  Output object
  75  * \param[in]     all  If \c true, include advanced and deprecated options (this
  76  *                     is always treated as true for XML output objects)
  77  *
  78  * \return Standard Pacemaker return code
  79  */
  80 int
  81 pcmk__list_fencing_params(pcmk__output_t *out, bool all)
     /* [previous][next][first][last][top][bottom][index][help] */
  82 {
  83     const char *name = "fence-attributes";
  84     const char *desc_short = "Fencing resource common parameters";
  85     const char *desc_long = NULL;
  86 
  87     desc_long = "Special parameters that are available for all fencing "
  88                 "resources, regardless of type. They are processed by "
  89                 "Pacemaker, rather than by the fence agent or the fencing "
  90                 "library.";
  91 
  92     return pcmk__output_fencing_params(out, name, desc_short, desc_long, all);
  93 }
  94 
  95 // Documented in header
  96 int
  97 pcmk_list_fencing_params(xmlNode **xml, bool all)
     /* [previous][next][first][last][top][bottom][index][help] */
  98 {
  99     pcmk__output_t *out = NULL;
 100     int rc = pcmk_rc_ok;
 101 
 102     rc = pcmk__xml_output_new(&out, xml);
 103     if (rc != pcmk_rc_ok) {
 104         return rc;
 105     }
 106 
 107     pcmk__register_lib_messages(out);
 108 
 109     rc = pcmk__list_fencing_params(out, all);
 110 
 111     pcmk__xml_output_finish(out, pcmk_rc2exitc(rc), xml);
 112     return rc;
 113 }
 114 
 115 /*!
 116  * \internal
 117  * \brief List meta-attributes applicable to primitive resources as OCF-like XML
 118  *
 119  * \param[in,out] out  Output object
 120  * \param[in]     all  If \c true, include advanced and deprecated options (this
 121  *                     is always treated as true for XML output objects)
 122  *
 123  * \return Standard Pacemaker return code
 124  */
 125 int
 126 pcmk__list_primitive_meta(pcmk__output_t *out, bool all)
     /* [previous][next][first][last][top][bottom][index][help] */
 127 {
 128     const char *name = "primitive-meta";
 129     const char *desc_short = "Primitive meta-attributes";
 130     const char *desc_long = "Meta-attributes applicable to primitive resources";
 131 
 132     return pcmk__output_primitive_meta(out, name, desc_short, desc_long, all);
 133 }
 134 
 135 // Documented in header
 136 int
 137 pcmk_list_primitive_meta(xmlNode **xml, bool all)
     /* [previous][next][first][last][top][bottom][index][help] */
 138 {
 139     pcmk__output_t *out = NULL;
 140     int rc = pcmk_rc_ok;
 141 
 142     rc = pcmk__xml_output_new(&out, xml);
 143     if (rc != pcmk_rc_ok) {
 144         return rc;
 145     }
 146 
 147     pcmk__register_lib_messages(out);
 148 
 149     rc = pcmk__list_primitive_meta(out, all);
 150 
 151     pcmk__xml_output_finish(out, pcmk_rc2exitc(rc), xml);
 152     return rc;
 153 }

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