pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
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
16extern "C" {
17#endif
18
20static inline const char *
21services_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)";
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
Function and executable result codes.
ocf_exitcode
Exit status codes for resource agents.
Definition results.h:173
@ PCMK_OCF_INSUFFICIENT_PRIV
Insufficient privileges.
Definition results.h:181
@ PCMK_OCF_FAILED_PROMOTED
Service failed and possibly in promoted role.
Definition results.h:189
@ PCMK_OCF_RUNNING_PROMOTED
Service active and promoted.
Definition results.h:188
@ PCMK_OCF_DEGRADED_PROMOTED
Service promoted but more likely to fail soon.
Definition results.h:191
@ PCMK_OCF_UNIMPLEMENT_FEATURE
Requested action not implemented.
Definition results.h:180
@ PCMK_OCF_NOT_CONFIGURED
Parameter invalid (inherently)
Definition results.h:183
@ PCMK_OCF_DEGRADED
Service active but more likely to fail soon.
Definition results.h:190
@ PCMK_OCF_NOT_INSTALLED
Dependencies not available locally.
Definition results.h:182
@ PCMK_OCF_UNKNOWN_ERROR
Unspecified error.
Definition results.h:177
@ PCMK_OCF_INVALID_PARAM
Parameter invalid (in local context)
Definition results.h:179
@ PCMK_OCF_NOT_RUNNING
Service safely stopped.
Definition results.h:186
@ PCMK_OCF_OK
Success.
Definition results.h:174