summaryrefslogtreecommitdiffstats
path: root/include/pcmki/pcmki_verify.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:39:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:39:28 +0000
commit924f5ea83e48277e014ebf0d19a27187cb93e2f7 (patch)
tree75920a275bba045f6d108204562c218a9a26ea15 /include/pcmki/pcmki_verify.h
parentAdding upstream version 2.1.7. (diff)
downloadpacemaker-924f5ea83e48277e014ebf0d19a27187cb93e2f7.tar.xz
pacemaker-924f5ea83e48277e014ebf0d19a27187cb93e2f7.zip
Adding upstream version 2.1.8~rc1.upstream/2.1.8_rc1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/pcmki/pcmki_verify.h')
-rw-r--r--include/pcmki/pcmki_verify.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/pcmki/pcmki_verify.h b/include/pcmki/pcmki_verify.h
new file mode 100644
index 0000000..28f20cd
--- /dev/null
+++ b/include/pcmki/pcmki_verify.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2024 the Pacemaker project contributors
+ *
+ * The version control history for this file may have further details.
+ *
+ * This source code is licensed under the GNU Lesser General Public License
+ * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
+ */
+
+#ifndef PCMK__PCMKI_PCMKI_VERIFY__H
+# define PCMK__PCMKI_PCMKI_VERIFY__H
+
+#include <crm/common/output_internal.h>
+#include <crm/common/scheduler.h>
+#include <libxml/tree.h>
+
+/*!
+ * \internal
+ * \brief Parse a CIB file
+ *
+ * This function parses a CIB file into a CIB object
+ *
+ * \param[in] out Output to use for logging and printing results
+ * \param[in] cib_source Source of the CIB:
+ * NULL -> use live cib, "-" -> stdin
+ * "<..." -> xml str, otherwise -> xml file name
+ * \param[in,out] cib_object The resulting, parsed CIB object
+ *
+ * \return Standard Pacemaker return code
+ */
+int pcmk__parse_cib(pcmk__output_t *out, const char *cib_source, xmlNodePtr *cib_object);
+
+/*!
+ * \internal
+ * \brief Verify that a CIB is error-free or output errors and warnings
+ *
+ * This high-level function essentially implements crm_verify(8). It operates
+ * on an input CIB file, which can be inputted through one of several ways. It
+ * can either write out XML-formatted output or plaintext output.
+ *
+ * \param[in,out] scheduler Scheduler data
+ * \param[in] out Output to use for logging and printing results
+ * \param[in] cib_object The parsed CIB object
+ *
+ * \return Standard Pacemaker return code
+ */
+int pcmk__verify(pcmk_scheduler_t *scheduler, pcmk__output_t *out, xmlNode *cib_object);
+
+#endif