root/include/crm/services_compat.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. services_ocf_exitcode_str

   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 #ifndef PCMK__CRM_SERVICES_COMPAT__H
  11 #define PCMK__CRM_SERVICES_COMPAT__H
  12 
  13 #include <crm/common/results.h> // enum ocf_exitcode, PCMK_OCF_OK, etc.
  14 
  15 #ifdef __cplusplus
  16 extern "C" {
  17 #endif
  18 
  19 //! \deprecated Use crm_exit_str() instead
  20 static inline const char *
  21 services_ocf_exitcode_str(enum ocf_exitcode code)
     /* [previous][next][first][last][top][bottom][index][help] */
  22 {
  23     switch (code) {
  24         case PCMK_OCF_OK:
  25             return "ok";
  26         case PCMK_OCF_UNKNOWN_ERROR:
  27             return "error";
  28         case PCMK_OCF_INVALID_PARAM:
  29             return "invalid parameter";
  30         case PCMK_OCF_UNIMPLEMENT_FEATURE:
  31             return "unimplemented feature";
  32         case PCMK_OCF_INSUFFICIENT_PRIV:
  33             return "insufficient privileges";
  34         case PCMK_OCF_NOT_INSTALLED:
  35             return "not installed";
  36         case PCMK_OCF_NOT_CONFIGURED:
  37             return "not configured";
  38         case PCMK_OCF_NOT_RUNNING:
  39             return "not running";
  40         case PCMK_OCF_RUNNING_PROMOTED:
  41             return "promoted";
  42         case PCMK_OCF_FAILED_PROMOTED:
  43             return "promoted (failed)";
  44         case PCMK_OCF_DEGRADED:
  45             return "OCF_DEGRADED";
  46         case PCMK_OCF_DEGRADED_PROMOTED:
  47             return "promoted (degraded)";
  48         default:
  49             return "unknown";
  50     }
  51 }
  52 
  53 #  ifdef __cplusplus
  54 }
  55 #  endif
  56 
  57 #endif // PCMK__CRM_SERVICES_COMPAT__H

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