10#ifndef PCMK__CRM_SERVICES__H
11# define PCMK__CRM_SERVICES__H
19# include <sys/types.h>
39# define SYSTEMCTL "/bin/systemctl"
46#define PCMK_OCF_REASON_PREFIX "ocf-exit-reason:"
49#define PCMK_DEFAULT_AGENT_VERSION "0.1"
174 gboolean executable);
240 const char *provider,
const char *agent,
241 const char *
action, guint interval_ms,
242 int timeout, GHashTable *params,
352 int timeout, GHashTable *params,
353 int sequence,
void *cb_data);
364#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
API related to resource agents.
Function and executable result codes.
ocf_exitcode
Exit status codes for resource agents.
svc_action_t * services_alert_create(const char *id, const char *exec, int timeout, GHashTable *params, int sequence, void *cb_data)
Create an alert agent action.
const char * resources_find_service_class(const char *agent)
Find first service class that can provide a specified agent.
gboolean resources_agent_exists(const char *standard, const char *provider, const char *agent)
Check whether a resource agent exists on the local host.
gboolean services_action_kick(const char *name, const char *action, guint interval_ms)
Reschedule a recurring action for immediate execution.
int services_action_user(svc_action_t *op, const char *user)
Set the user and group that an action will execute as.
GList * resources_list_agents(const char *standard, const char *provider)
Get a list of resource agents.
@ PCMK_LSB_STATUS_NOT_INSTALLED
@ PCMK_LSB_STATUS_VAR_PID
@ PCMK_LSB_STATUS_INSUFFICIENT_PRIV
@ PCMK_LSB_STATUS_UNKNOWN
@ PCMK_LSB_STATUS_VAR_LOCK
@ PCMK_LSB_STATUS_NOT_RUNNING
gboolean services_action_async(svc_action_t *op, void(*action_callback)(svc_action_t *))
Request asynchronous execution of an action.
gboolean services_action_cancel(const char *name, const char *action, guint interval_ms)
Cancel a recurring action.
gboolean services_action_sync(svc_action_t *op)
GList * resources_list_standards(void)
void services_action_free(svc_action_t *op)
@ PCMK_LSB_UNIMPLEMENT_FEATURE
@ PCMK_LSB_NOT_CONFIGURED
@ PCMK_LSB_INSUFFICIENT_PRIV
gboolean services_alert_async(svc_action_t *action, void(*cb)(svc_action_t *op))
Execute an alert agent action.
struct svc_action_s svc_action_t
Object for executing external actions.
svc_action_t * resources_action_create(const char *name, const char *standard, const char *provider, const char *agent, const char *action, guint interval_ms, int timeout, GHashTable *params, enum svc_action_flags flags)
Create a new resource action.
enum ocf_exitcode services_result2ocf(const char *standard, const char *action, int exit_status)
void services_action_cleanup(svc_action_t *op)
GList * resources_list_providers(const char *standard)
Get a list of providers.
svc_action_t * services_action_create_generic(const char *exec, const char *args[])
Request execution of an arbitrary command.
GList * get_directory_list(const char *root, gboolean files, gboolean executable)
Get a list of files or directories in a given path.
gboolean services_action_async_fork_notify(svc_action_t *op, void(*action_callback)(svc_action_t *), void(*action_fork_callback)(svc_action_t *))
Run an action asynchronously, with callback after process is forked.
Object for executing external actions.
void * cb_data
For caller's use (not used by library)
char * provider
Resource provider for resource actions that require it, otherwise NULL.
char * agent
Resource agent name for resource actions, otherwise NULL.
char * standard
Resource standard for resource actions, otherwise NULL.
int rc
Exit status of action (set by library upon completion)
char * rsc
XML ID of resource being executed for resource actions, otherwise NULL.
char * action
Name of action being executed for resource actions, otherwise NULL.
enum svc_action_flags flags
Flag group of enum svc_action_flags.
char * stderr_data
Action stderr (set by library)
int timeout
Action timeout (in milliseconds)
char * stdout_data
Action stdout (set by library)
guint interval_ms
Action interval for recurring resource actions, otherwise 0.
int status
Execution status (enum pcmk_exec_status set by library)
svc_action_private_t * opaque
This field should be treated as internal to Pacemaker.