pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
services_compat.h
Go to the documentation of this file.
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 
20 static inline const char *
21 services_ocf_exitcode_str(enum ocf_exitcode code)
22 {
23  switch (code) {
24  case PCMK_OCF_OK:
25  return "ok";
27  return "error";
29  return "invalid parameter";
31  return "unimplemented feature";
33  return "insufficient privileges";
35  return "not installed";
37  return "not configured";
39  return "not running";
41  return "promoted";
43  return "promoted (failed)";
44  case PCMK_OCF_DEGRADED:
45  return "OCF_DEGRADED";
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
ocf_exitcode
Exit status codes for resource agents.
Definition: results.h:173
Service failed and possibly in promoted role.
Definition: results.h:189
Service active and promoted.
Definition: results.h:188
Service safely stopped.
Definition: results.h:186
Service promoted but more likely to fail soon.
Definition: results.h:191
Parameter invalid (in local context)
Definition: results.h:179
Parameter invalid (inherently)
Definition: results.h:183
Insufficient privileges.
Definition: results.h:181
Dependencies not available locally.
Definition: results.h:182
Function and executable result codes.
Unspecified error.
Definition: results.h:177
Requested action not implemented.
Definition: results.h:180
Service active but more likely to fail soon.
Definition: results.h:190
Success.
Definition: results.h:174