root/include/crm/common/agents.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright 2017-2022 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 #ifndef PCMK__CRM_COMMON_AGENTS__H
  11 #  define PCMK__CRM_COMMON_AGENTS__H
  12 
  13 #ifdef __cplusplus
  14 extern "C" {
  15 #endif
  16 
  17 /**
  18  * \file
  19  * \brief API related to resource agents
  20  * \ingroup core
  21  */
  22 
  23 #include <stdint.h>       // uint32_t
  24 #include <stdbool.h>
  25 
  26 // Known resource classes
  27 #define PCMK_RESOURCE_CLASS_OCF     "ocf"
  28 #define PCMK_RESOURCE_CLASS_SERVICE "service"
  29 #define PCMK_RESOURCE_CLASS_LSB     "lsb"
  30 #define PCMK_RESOURCE_CLASS_SYSTEMD "systemd"
  31 #define PCMK_RESOURCE_CLASS_UPSTART "upstart"
  32 #define PCMK_RESOURCE_CLASS_NAGIOS  "nagios"
  33 #define PCMK_RESOURCE_CLASS_STONITH "stonith"
  34 #define PCMK_RESOURCE_CLASS_ALERT   "alert"
  35 
  36 /* Special stonith-class agent parameters interpreted directly by Pacemaker
  37  * (not including the pcmk_ACTION_{action,retries,timeout} parameters)
  38  */
  39 #define PCMK_STONITH_ACTION_LIMIT       "pcmk_action_limit"
  40 #define PCMK_STONITH_DELAY_BASE         "pcmk_delay_base"
  41 #define PCMK_STONITH_DELAY_MAX          "pcmk_delay_max"
  42 #define PCMK_STONITH_HOST_ARGUMENT      "pcmk_host_argument"
  43 #define PCMK_STONITH_HOST_CHECK         "pcmk_host_check"
  44 #define PCMK_STONITH_HOST_LIST          "pcmk_host_list"
  45 #define PCMK_STONITH_HOST_MAP           "pcmk_host_map"
  46 #define PCMK_STONITH_PROVIDES           "provides"
  47 #define PCMK_STONITH_STONITH_TIMEOUT    "stonith-timeout"
  48 
  49 // OCF Resource Agent API standard version that this Pacemaker supports
  50 #define PCMK_OCF_MAJOR_VERSION "1"
  51 #define PCMK_OCF_MINOR_VERSION "1"
  52 #define PCMK_OCF_VERSION       PCMK_OCF_MAJOR_VERSION "." PCMK_OCF_MINOR_VERSION
  53 
  54 // Capabilities supported by a resource agent standard
  55 enum pcmk_ra_caps {
  56     pcmk_ra_cap_none         = 0,
  57     pcmk_ra_cap_provider     = (1 << 0), // Requires provider
  58     pcmk_ra_cap_status       = (1 << 1), // Supports status instead of monitor
  59     pcmk_ra_cap_params       = (1 << 2), // Supports parameters
  60     pcmk_ra_cap_unique       = (1 << 3), // Supports unique clones
  61     pcmk_ra_cap_promotable   = (1 << 4), // Supports promotable clones
  62     pcmk_ra_cap_stdin        = (1 << 5), // Reads from standard input
  63     pcmk_ra_cap_fence_params = (1 << 6), // Supports pcmk_monitor_timeout, etc.
  64 };
  65 
  66 uint32_t pcmk_get_ra_caps(const char *standard);
  67 char *crm_generate_ra_key(const char *standard, const char *provider,
  68                           const char *type);
  69 int crm_parse_agent_spec(const char *spec, char **standard, char **provider,
  70                          char **type);
  71 bool pcmk_stonith_param(const char *param);
  72 
  73 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
  74 #include <crm/common/agents_compat.h>
  75 #endif
  76 
  77 #ifdef __cplusplus
  78 }
  79 #endif
  80 
  81 #endif // PCMK__CRM_COMMON_AGENTS__H

/* [previous][next][first][last][top][bottom][index][help] */