pacemaker  2.1.9-49aab99839
Scalable High-Availability cluster resource manager
pcmk_options.c
Go to the documentation of this file.
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 
29 int
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)
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 
59 
60  rc = pcmk__list_cluster_options(out, all);
61 
63  return rc;
64 }
65 
80 int
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)
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 
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 
125 int
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)
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 
148 
149  rc = pcmk__list_primitive_meta(out, all);
150 
151  pcmk__xml_output_finish(out, pcmk_rc2exitc(rc), xml);
152  return rc;
153 }
const char * name
Definition: cib.c:26
int pcmk__list_fencing_params(pcmk__output_t *out, bool all)
Definition: pcmk_options.c:81
crm_exit_t pcmk_rc2exitc(int rc)
Map a function return code to the most similar exit code.
Definition: results.c:704
High Level API.
void pcmk__xml_output_finish(pcmk__output_t *out, crm_exit_t exit_status, xmlNodePtr *xml)
Definition: output.c:271
int pcmk__xml_output_new(pcmk__output_t **out, xmlNodePtr *xml)
Definition: output.c:244
int pcmk__output_primitive_meta(pcmk__output_t *out, const char *name, const char *desc_short, const char *desc_long, bool all)
Definition: options.c:1475
int pcmk_list_fencing_params(xmlNode **xml, bool all)
List common fencing resource parameters.
Definition: pcmk_options.c:97
void pcmk__register_lib_messages(pcmk__output_t *out)
Definition: pcmk_output.c:2680
No additional information.
int pcmk__output_cluster_options(pcmk__output_t *out, const char *name, const char *desc_short, const char *desc_long, uint32_t filter, bool all)
Definition: options.c:1452
int pcmk__list_cluster_options(pcmk__output_t *out, bool all)
Definition: pcmk_options.c:30
int pcmk__output_fencing_params(pcmk__output_t *out, const char *name, const char *desc_short, const char *desc_long, bool all)
Definition: options.c:1502
This structure contains everything that makes up a single output formatter.
int pcmk__list_primitive_meta(pcmk__output_t *out, bool all)
Definition: pcmk_options.c:126
int pcmk_list_primitive_meta(xmlNode **xml, bool all)
Definition: pcmk_options.c:137
int pcmk_list_cluster_options(xmlNode **xml, bool all)
List all available cluster options.
Definition: pcmk_options.c:48