pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
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
29int
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
47int
48pcmk_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
80int
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
96int
97pcmk_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
112 return rc;
113}
114
125int
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
136int
137pcmk_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
152 return rc;
153}
const char * name
Definition cib.c:26
@ pcmk__opt_none
No additional information.
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:1466
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:1443
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:1493
void pcmk__xml_output_finish(pcmk__output_t *out, crm_exit_t exit_status, xmlNodePtr *xml)
Definition output.c:273
int pcmk__xml_output_new(pcmk__output_t **out, xmlNodePtr *xml)
Definition output.c:246
High Level API.
int pcmk_list_fencing_params(xmlNode **xml, bool all)
List common fencing resource parameters.
int pcmk__list_cluster_options(pcmk__output_t *out, bool all)
int pcmk_list_primitive_meta(xmlNode **xml, bool all)
int pcmk__list_primitive_meta(pcmk__output_t *out, bool all)
int pcmk_list_cluster_options(xmlNode **xml, bool all)
List all available cluster options.
int pcmk__list_fencing_params(pcmk__output_t *out, bool all)
void pcmk__register_lib_messages(pcmk__output_t *out)
@ pcmk_rc_ok
Definition results.h:159
crm_exit_t pcmk_rc2exitc(int rc)
Map a function return code to the most similar exit code.
Definition results.c:820
This structure contains everything that makes up a single output formatter.