diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:29 +0000 |
commit | b41961d74fe7ff2d4d4abaca92454e87c561e49f (patch) | |
tree | b34e3826a7b649dafdbd05081140c990c96d736d /include/pcmki | |
parent | Releasing progress-linux version 2.1.7-1~progress7.99u1. (diff) | |
download | pacemaker-b41961d74fe7ff2d4d4abaca92454e87c561e49f.tar.xz pacemaker-b41961d74fe7ff2d4d4abaca92454e87c561e49f.zip |
Merging upstream version 2.1.8~rc1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | include/pcmki/pcmki_options.h | 19 | ||||
-rw-r--r-- | include/pcmki/pcmki_resource.h | 4 | ||||
-rw-r--r-- | include/pcmki/pcmki_ticket.h | 154 | ||||
-rw-r--r-- | include/pcmki/pcmki_transition.h | 3 | ||||
-rw-r--r-- | include/pcmki/pcmki_verify.h | 49 |
5 files changed, 227 insertions, 2 deletions
diff --git a/include/pcmki/pcmki_options.h b/include/pcmki/pcmki_options.h new file mode 100644 index 0000000..6d6a1aa --- /dev/null +++ b/include/pcmki/pcmki_options.h @@ -0,0 +1,19 @@ +/* + * 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_OPTIONS__H +#define PCMK__PCMKI_PCMKI_OPTIONS__H + +#include <crm/common/output_internal.h> + +int pcmk__list_cluster_options(pcmk__output_t *out, bool all); +int pcmk__list_fencing_params(pcmk__output_t *out, bool all); +int pcmk__list_primitive_meta(pcmk__output_t *out, bool all); + +#endif // PCMK__PCMKI_PCMKI_OPTIONS__H diff --git a/include/pcmki/pcmki_resource.h b/include/pcmki/pcmki_resource.h index 442bb1f..973b896 100644 --- a/include/pcmki/pcmki_resource.h +++ b/include/pcmki/pcmki_resource.h @@ -11,9 +11,13 @@ #include <glib.h> +#include <crm/cib/cib_types.h> #include <crm/common/scheduler.h> #include <crm/common/output_internal.h> +int pcmk__resource_delete(cib_t *cib, uint32_t cib_opts, const char *rsc_id, + const char *rsc_type); + int pcmk__resource_digests(pcmk__output_t *out, pcmk_resource_t *rsc, const pcmk_node_t *node, GHashTable *overrides); diff --git a/include/pcmki/pcmki_ticket.h b/include/pcmki/pcmki_ticket.h new file mode 100644 index 0000000..a4606fc --- /dev/null +++ b/include/pcmki/pcmki_ticket.h @@ -0,0 +1,154 @@ +/* + * 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_TICKET__H +# define PCMK__PCMKI_PCMKI_TICKET__H + +#include <crm/common/output_internal.h> + +#include <crm/cib/cib_types.h> + +/*! + * \internal + * \brief Return the state XML for a given ticket + * + * \param[in] cib Open CIB connection + * \param[in] ticket_id Ticket to get state for, or \c NULL for all tickets + * \param[out] state Where to store the result XML + * + * \return Standard Pacemaker return code + * + * \note If \p ticket_id is not \c NULL and more than one ticket exists with + * that ID, this function returns \c pcmk_rc_duplicate_id. + */ +int pcmk__get_ticket_state(cib_t *cib, const char *ticket_id, xmlNode **state); + +/*! + * \internal + * \brief Display the constraints that apply to a given ticket + * + * \param[in,out] out Output object + * \param[in] cib Open CIB connection + * \param[in] ticket_id Ticket to find constraints for, + * or \c NULL for all ticket constraints + * + * \return Standard Pacemaker return code + */ +int pcmk__ticket_constraints(pcmk__output_t *out, cib_t *cib, const char *ticket_id); + +/*! + * \internal + * \brief Delete a ticket's state from the local cluster site + * + * \param[in,out] out Output object + * \param[in] cib Open CIB connection + * \param[in] scheduler Scheduler data + * \param[in] ticket_id Ticket to delete + * \param[in] force If \c true, delete the ticket even if it has + * been granted + * + * \return Standard Pacemaker return code + */ +int pcmk__ticket_delete(pcmk__output_t *out, cib_t *cib, pcmk_scheduler_t *scheduler, + const char *ticket_id, bool force); + +/*! + * \internal + * \brief Return the value of a ticket's attribute + * + * \param[in,out] out Output object + * \param[in,out] scheduler Scheduler data + * \param[in] ticket_id Ticket to find attribute value for + * \param[in] attr_name Attribute's name to find value for + * \param[in] attr_default If either the ticket or the attribute do not + * exist, use this as the value in the output + * + * \return Standard Pacemaker return code + */ +int pcmk__ticket_get_attr(pcmk__output_t *out, pcmk_scheduler_t *scheduler, + const char *ticket_id, const char *attr_name, + const char *attr_default); + +/*! + * \brief Return information about the given ticket + * + * \param[in,out] out Output object + * \param[in,out] scheduler Scheduler data + * \param[in] ticket_id Ticket to display info for, or \c NULL for + * all tickets + * \param[in] details If true (and \p out is not an XML format + * object), output any additional attributes + * set on a ticket beyond the basics + * \param[in] raw If true (and \p out is not an XML format + * object), simply list the IDs of all tickets. + * This does not make a lot of sense if + * \p ticket_id is not NULL, but that will not + * raise an error. + * + * \return Standard Pacemaker return code + */ +int pcmk__ticket_info(pcmk__output_t *out, pcmk_scheduler_t *scheduler, + const char *ticket_id, bool details, bool raw); + +/*! + * \brief Remove the given attribute(s) from a ticket + * + * \param[in,out] out Output object + * \param[in] cib Open CIB connection + * \param[in,out] scheduler Scheduler data + * \param[in] ticket_id Ticket to remove attributes from + * \param[in] attr_delete A list of attribute names + * \param[in] force Attempting to remove the granted attribute of + * \p ticket_id will cause this function to return + * \c EACCES unless \p force is set to \c true + * + * \return Standard Pacemaker return code + */ +int pcmk__ticket_remove_attr(pcmk__output_t *out, cib_t *cib, pcmk_scheduler_t *scheduler, + const char *ticket_id, GList *attr_delete, bool force); + +/*! + * \brief Set the given attribute(s) on a ticket + * + * \param[in,out] out Output object + * \param[in] cib Open CIB connection + * \param[in,out] scheduler Scheduler data + * \param[in] ticket_id Ticket to set attributes on + * \param[in] attr_set A hash table of attributes, where keys are the + * attribute names and the values are the attribute + * values + * \param[in] force Attempting to change the granted status of + * \p ticket_id will cause this function to return + * \c EACCES unless \p force is set to \c true + * + * \return Standard Pacemaker return code + * + * \note If no \p ticket_id attribute exists but \p attr_set is non-NULL, the + * ticket will be created with the given attributes. + */ +int pcmk__ticket_set_attr(pcmk__output_t *out, cib_t *cib, pcmk_scheduler_t *scheduler, + const char *ticket_id, GHashTable *attr_set, bool force); + +/*! + * \internal + * \brief Return a ticket's state XML + * + * \param[in,out] out Output object + * \param[in] cib Open CIB connection + * \param[in] ticket_id Ticket to find constraints for, + * or \c NULL for all ticket constraints + * + * \return Standard Pacemaker return code + * + * \note If \p ticket_id is not \c NULL and more than one ticket exists with + * that ID, this function returns \c pcmk_rc_duplicate_id. + */ +int pcmk__ticket_state(pcmk__output_t *out, cib_t *cib, const char *ticket_id); + +#endif diff --git a/include/pcmki/pcmki_transition.h b/include/pcmki/pcmki_transition.h index 93237ed..73ab3aa 100644 --- a/include/pcmki/pcmki_transition.h +++ b/include/pcmki/pcmki_transition.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2023 the Pacemaker project contributors + * Copyright 2004-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -12,7 +12,6 @@ # include <glib.h> # include <crm/crm.h> -# include <crm/msg_xml.h> # include <crm/common/xml.h> # include <crm/lrmd_events.h> // lrmd_event_data_t 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 |