diff --git a/include/crm/common/Makefile.am b/include/crm/common/Makefile.am index f30e75f..2686dc0 100644 --- a/include/crm/common/Makefile.am +++ b/include/crm/common/Makefile.am @@ -12,7 +12,7 @@ MAINTAINERCLEANFILES = Makefile.in headerdir=$(pkgincludedir)/crm/common header_HEADERS = xml.h ipc.h util.h iso8601.h mainloop.h logging.h results.h \ - nvpair.h acl.h ipc_controld.h ipc_pacemakerd.h + nvpair.h acl.h agents.h ipc_controld.h ipc_pacemakerd.h noinst_HEADERS = internal.h alerts_internal.h \ iso8601_internal.h remote_internal.h xml_internal.h \ ipc_internal.h output_internal.h cmdline_internal.h \ diff --git a/include/crm/common/agents.h b/include/crm/common/agents.h new file mode 100644 index 0000000..b585ada --- /dev/null +++ b/include/crm/common/agents.h @@ -0,0 +1,58 @@ +/* + * Copyright 2017-2020 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__AGENTS__H +# define PCMK__AGENTS__H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file + * \brief API related to resource agents + * \ingroup core + */ + +#include // uint32_t +#include + +// Capabilities supported by a resource agent standard +enum pcmk_ra_caps { + pcmk_ra_cap_none = 0, + pcmk_ra_cap_provider = (1 << 0), // Requires provider + pcmk_ra_cap_status = (1 << 1), // Supports status instead of monitor + pcmk_ra_cap_params = (1 << 2), // Supports parameters + pcmk_ra_cap_unique = (1 << 3), // Supports unique clones + pcmk_ra_cap_promotable = (1 << 4), // Supports promotable clones + pcmk_ra_cap_stdin = (1 << 5), // Reads from standard input + pcmk_ra_cap_fence_params = (1 << 6), // Supports pcmk_monitor_timeout, etc. +}; + +uint32_t pcmk_get_ra_caps(const char *standard); +char *crm_generate_ra_key(const char *standard, const char *provider, + const char *type); +int crm_parse_agent_spec(const char *spec, char **standard, char **provider, + char **type); + +#ifndef PCMK__NO_COMPAT +/* Everything here is deprecated and kept only for public API backward + * compatibility. It will be moved to compatibility.h in a future release. + */ + +//! \deprecated Use pcmk_get_ra_caps() instead +bool crm_provider_required(const char *standard); + +#endif // PCMK__NO_COMPAT + +#ifdef __cplusplus +} +#endif + +#endif // PCMK__AGENTS__H diff --git a/include/crm/common/util.h b/include/crm/common/util.h index 74fd6bd..0a2ee6c 100644 --- a/include/crm/common/util.h +++ b/include/crm/common/util.h @@ -32,6 +32,7 @@ extern "C" { # include # include +# include # include # define ONLINESTATUS "online" // Status of an online client @@ -133,27 +134,6 @@ xmlNode *crm_create_op_xml(xmlNode *parent, const char *prefix, const char *timeout); #define CRM_DEFAULT_OP_TIMEOUT_S "20s" -// Public resource agent functions (from agents.c) - -// Capabilities supported by a resource agent standard -enum pcmk_ra_caps { - pcmk_ra_cap_none = 0, - pcmk_ra_cap_provider = (1 << 0), // Requires provider - pcmk_ra_cap_status = (1 << 1), // Supports status instead of monitor - pcmk_ra_cap_params = (1 << 2), // Supports parameters - pcmk_ra_cap_unique = (1 << 3), // Supports unique clones - pcmk_ra_cap_promotable = (1 << 4), // Supports promotable clones - pcmk_ra_cap_stdin = (1 << 5), // Reads from standard input - pcmk_ra_cap_fence_params = (1 << 6), // Supports pcmk_monitor_timeout, etc. -}; - -uint32_t pcmk_get_ra_caps(const char *standard); -char *crm_generate_ra_key(const char *standard, const char *provider, - const char *type); -int crm_parse_agent_spec(const char *spec, char **standard, char **provider, - char **type); - - int compare_version(const char *version1, const char *version2); /* coverity[+kill] */ @@ -255,9 +235,6 @@ is_set_any(long long word, long long bit) return ((word & bit) != 0); } -//! \deprecated Use pcmk_get_ra_caps() instead -bool crm_provider_required(const char *standard); - //! \deprecated Use strcmp or strcasecmp instead gboolean crm_str_eq(const char *a, const char *b, gboolean use_case);