pacemaker  2.1.9-49aab99839
Scalable High-Availability cluster resource manager
Data Fields
lrmd_api_operations_s Struct Reference

#include <include/crm/lrmd.h>

Collaboration diagram for lrmd_api_operations_s:
Collaboration graph
[legend]

Data Fields

int(* connect )(lrmd_t *lrmd, const char *client_name, int *fd)
 Connect to an executor. More...
 
int(* connect_async )(lrmd_t *lrmd, const char *client_name, int timeout)
 Initiate an executor connection without blocking. More...
 
int(* is_connected )(lrmd_t *lrmd)
 Check whether connection to executor daemon is (still) active. More...
 
int(* poke_connection )(lrmd_t *lrmd)
 Poke executor connection to verify it is still active. More...
 
int(* disconnect )(lrmd_t *lrmd)
 Disconnect from the executor. More...
 
int(* register_rsc )(lrmd_t *lrmd, const char *rsc_id, const char *standard, const char *provider, const char *agent, enum lrmd_call_options options)
 Register a resource with the executor. More...
 
lrmd_rsc_info_t *(* get_rsc_info )(lrmd_t *lrmd, const char *rsc_id, enum lrmd_call_options options)
 Retrieve a resource's registration information. More...
 
int(* get_recurring_ops )(lrmd_t *lrmd, const char *rsc_id, int timeout_ms, enum lrmd_call_options options, GList **output)
 Retrieve recurring operations registered for a resource. More...
 
int(* unregister_rsc )(lrmd_t *lrmd, const char *rsc_id, enum lrmd_call_options options)
 Unregister a resource from the executor. More...
 
void(* set_callback )(lrmd_t *lrmd, lrmd_event_callback callback)
 Set a callback for executor events. More...
 
int(* exec )(lrmd_t *lrmd, const char *rsc_id, const char *action, const char *userdata, guint interval_ms, int timeout, int start_delay, enum lrmd_call_options options, lrmd_key_value_t *params)
 Request execution of a resource action. More...
 
int(* cancel )(lrmd_t *lrmd, const char *rsc_id, const char *action, guint interval_ms)
 Cancel a recurring resource action. More...
 
int(* get_metadata )(lrmd_t *lrmd, const char *standard, const char *provider, const char *agent, char **output, enum lrmd_call_options options)
 Retrieve resource agent metadata synchronously. More...
 
int(* list_agents )(lrmd_t *lrmd, lrmd_list_t **agents, const char *standard, const char *provider)
 Retrieve a list of installed resource agents. More...
 
int(* list_ocf_providers )(lrmd_t *lrmd, const char *agent, lrmd_list_t **providers)
 Retrieve a list of resource agent providers. More...
 
int(* list_standards )(lrmd_t *lrmd, lrmd_list_t **standards)
 Retrieve a list of supported standards. More...
 
int(* exec_alert )(lrmd_t *lrmd, const char *alert_id, const char *alert_path, int timeout, lrmd_key_value_t *params)
 Execute an alert agent. More...
 
int(* get_metadata_params )(lrmd_t *lrmd, const char *standard, const char *provider, const char *agent, char **output, enum lrmd_call_options options, lrmd_key_value_t *params)
 Retrieve resource agent metadata synchronously with parameters. More...
 

Detailed Description

Definition at line 197 of file lrmd.h.

Field Documentation

◆ cancel

int(* lrmd_api_operations_s::cancel) (lrmd_t *lrmd, const char *rsc_id, const char *action, guint interval_ms)

Cancel a recurring resource action.

Parameters
[in,out]lrmdExecutor connection object
[in]rsc_idID of resource
[in]actionName of resource action to cancel
[in]interval_msAction's interval (in milliseconds)
Returns
Legacy Pacemaker return code (if pcmk_ok, cancellation is queued on function return, and the event callback will be called later with an exec_complete event with an lrmd_op_status signifying that the operation is cancelled)
Note
exec() and cancel() operations on an individual resource are guaranteed to occur in the order the client API is called. However, operations on different resources are not guaranteed to occur in any specific order.

Definition at line 372 of file lrmd.h.

◆ connect

int(* lrmd_api_operations_s::connect) (lrmd_t *lrmd, const char *client_name, int *fd)

Connect to an executor.

Parameters
[in,out]lrmdExecutor connection object
[in]client_nameArbitrary identifier to pass to server
[out]fdIf not NULL, where to store file descriptor for connection's socket
Returns
Legacy Pacemaker return code

Definition at line 208 of file lrmd.h.

◆ connect_async

int(* lrmd_api_operations_s::connect_async) (lrmd_t *lrmd, const char *client_name, int timeout)

Initiate an executor connection without blocking.

Parameters
[in,out]lrmdExecutor connection object
[in]client_nameArbitrary identifier to pass to server
[in]timeoutError if not connected within this time (milliseconds)
Returns
Legacy Pacemaker return code (if pcmk_ok, the event callback will be called later with the result)
Note
This function requires a mainloop.

Definition at line 222 of file lrmd.h.

◆ disconnect

int(* lrmd_api_operations_s::disconnect) (lrmd_t *lrmd)

Disconnect from the executor.

Parameters
[in,out]lrmdExecutor connection object to disconnect
Returns
Legacy Pacemaker return code

Definition at line 253 of file lrmd.h.

◆ exec

int(* lrmd_api_operations_s::exec) (lrmd_t *lrmd, const char *rsc_id, const char *action, const char *userdata, guint interval_ms, int timeout, int start_delay, enum lrmd_call_options options, lrmd_key_value_t *params)

Request execution of a resource action.

Parameters
[in,out]lrmdExecutor connection object
[in]rsc_idID of resource
[in]actionName of resource action to execute
[in]userdataArbitrary string to pass to event callback
[in]interval_msIf 0, execute action once, otherwise recurring at this interval (in milliseconds)
[in]timeoutError if not complete within this time (in milliseconds)
[in]start_delayWait this long before execution (in milliseconds)
[in]optionsGroup of enum lrmd_call_options flags
[in,out]paramsParameters to pass to agent (will be freed)
Returns
A call ID for the action on success (in which case the action is queued in the executor, and the event callback will be called later with the result), otherwise a negative legacy Pacemaker return code
Note
exec() and cancel() operations on an individual resource are guaranteed to occur in the order the client API is called. However, operations on different resources are not guaranteed to occur in any specific order.

Definition at line 349 of file lrmd.h.

◆ exec_alert

int(* lrmd_api_operations_s::exec_alert) (lrmd_t *lrmd, const char *alert_id, const char *alert_path, int timeout, lrmd_key_value_t *params)

Execute an alert agent.

Parameters
[in,out]lrmdExecutor connection
[in]alert_idName of alert to execute
[in]alert_pathFull path to alert executable
[in]timeoutError if not complete within this many milliseconds
[in,out]paramsParameters to pass to agent (will be freed)
Returns
Legacy Pacemaker return code (if pcmk_ok, the alert is queued in the executor, and the event callback will be called later with the result)
Note
Operations on individual alerts (by ID) are guaranteed to occur in the order the client API is called. Operations on different alerts are not guaranteed to occur in any specific order.

Definition at line 463 of file lrmd.h.

◆ get_metadata

int(* lrmd_api_operations_s::get_metadata) (lrmd_t *lrmd, const char *standard, const char *provider, const char *agent, char **output, enum lrmd_call_options options)

Retrieve resource agent metadata synchronously.

Parameters
[in]lrmdExecutor connection (unused)
[in]standardResource agent class
[in]providerResource agent provider
[in]agentResource agent type
[out]outputWhere to store metadata (must not be NULL)
[in]optionsGroup of enum lrmd_call_options flags (unused)
Returns
Legacy Pacemaker return code
Note
Caller is responsible for freeing output. This call is always synchronous (blocking), and always done directly by the library (not via the executor connection). This means that it is based on the local host environment, even if the executor connection is to a remote node, so this may fail if the agent is not installed locally. This also means that, if an external agent must be executed, it will be executed by the caller's user, not the executor's.

Definition at line 396 of file lrmd.h.

◆ get_metadata_params

int(* lrmd_api_operations_s::get_metadata_params) (lrmd_t *lrmd, const char *standard, const char *provider, const char *agent, char **output, enum lrmd_call_options options, lrmd_key_value_t *params)

Retrieve resource agent metadata synchronously with parameters.

Parameters
[in]lrmdExecutor connection (unused)
[in]standardResource agent class
[in]providerResource agent provider
[in]agentResource agent type
[out]outputWhere to store metadata (must not be NULL)
[in]optionsGroup of enum lrmd_call_options flags (unused)
[in,out]paramsParameters to pass to agent (will be freed)
Returns
Legacy Pacemaker return code
Note
This is identical to the get_metadata() API call, except parameters will be passed to the resource agent via environment variables.

Definition at line 483 of file lrmd.h.

◆ get_recurring_ops

int(* lrmd_api_operations_s::get_recurring_ops) (lrmd_t *lrmd, const char *rsc_id, int timeout_ms, enum lrmd_call_options options, GList **output)

Retrieve recurring operations registered for a resource.

Parameters
[in,out]lrmdExecutor connection object
[in]rsc_idID of resource to check
[in]timeout_msError if not completed within this time
[in]optionsGroup of enum lrmd_call_options flags
[out]outputWhere to store list of lrmd_op_info_t
Returns
Legacy Pacemaker return code

Definition at line 296 of file lrmd.h.

◆ get_rsc_info

lrmd_rsc_info_t*(* lrmd_api_operations_s::get_rsc_info) (lrmd_t *lrmd, const char *rsc_id, enum lrmd_call_options options)

Retrieve a resource's registration information.

Parameters
[in,out]lrmdExecutor connection object
[in]rsc_idID of resource to check
[in]optionsGroup of enum lrmd_call_options flags
Returns
Resource information on success, otherwise NULL

Definition at line 282 of file lrmd.h.

◆ is_connected

int(* lrmd_api_operations_s::is_connected) (lrmd_t *lrmd)

Check whether connection to executor daemon is (still) active.

Parameters
[in,out]lrmdExecutor connection object to check
Returns
1 if the executor connection is active, 0 otherwise

Definition at line 232 of file lrmd.h.

◆ list_agents

int(* lrmd_api_operations_s::list_agents) (lrmd_t *lrmd, lrmd_list_t **agents, const char *standard, const char *provider)

Retrieve a list of installed resource agents.

Parameters
[in]lrmdExecutor connection (unused)
[out]agentsWhere to store agent list (must not be NULL)
[in]standardResource agent standard to list
[in]providerResource agent provider to list (or NULL)
Returns
Number of items in list on success, negative legacy Pacemaker return code otherwise
Note
if standard is not provided, all known agents will be returned
list must be freed using lrmd_list_freeall()

Definition at line 414 of file lrmd.h.

◆ list_ocf_providers

int(* lrmd_api_operations_s::list_ocf_providers) (lrmd_t *lrmd, const char *agent, lrmd_list_t **providers)

Retrieve a list of resource agent providers.

Parameters
[in]lrmdExecutor connection (unused)
[in]agentIf not NULL, list providers for this agent only
[out]providersWhere to store provider list
Returns
Number of items in list on success, negative legacy Pacemaker return code otherwise
Note
The caller is responsible for freeing *providers with lrmd_list_freeall().

Definition at line 429 of file lrmd.h.

◆ list_standards

int(* lrmd_api_operations_s::list_standards) (lrmd_t *lrmd, lrmd_list_t **standards)

Retrieve a list of supported standards.

Parameters
[in]lrmdExecutor connection (unused)
[out]standardsWhere to store standards list
Returns
Number of items in list on success, negative legacy Pacemaker return code otherwise
Note
The caller is responsible for freeing *standards with lrmd_list_freeall().

Definition at line 443 of file lrmd.h.

◆ poke_connection

int(* lrmd_api_operations_s::poke_connection) (lrmd_t *lrmd)

Poke executor connection to verify it is still active.

Parameters
[in,out]lrmdExecutor connection object to check
Returns
Legacy Pacemaker return code (if pcmk_ok, the event callback will be called later with the result)
Note
The response comes in the form of a poke event to the callback.

Definition at line 244 of file lrmd.h.

◆ register_rsc

int(* lrmd_api_operations_s::register_rsc) (lrmd_t *lrmd, const char *rsc_id, const char *standard, const char *provider, const char *agent, enum lrmd_call_options options)

Register a resource with the executor.

Parameters
[in,out]lrmdExecutor connection object
[in]rsc_idID of resource to register
[in]standardResource's resource agent standard
[in]providerResource's resource agent provider (or NULL)
[in]agentResource's resource agent name
[in]optionsGroup of enum lrmd_call_options flags
Note
Synchronous, guaranteed to occur in daemon before function returns.
Returns
Legacy Pacemaker return code

Definition at line 269 of file lrmd.h.

◆ set_callback

void(* lrmd_api_operations_s::set_callback) (lrmd_t *lrmd, lrmd_event_callback callback)

Set a callback for executor events.

Parameters
[in,out]lrmdExecutor connection object
[in]callbackCallback to set

Definition at line 322 of file lrmd.h.

◆ unregister_rsc

int(* lrmd_api_operations_s::unregister_rsc) (lrmd_t *lrmd, const char *rsc_id, enum lrmd_call_options options)

Unregister a resource from the executor.

Parameters
[in,out]lrmdExecutor connection object
[in]rsc_idID of resource to unregister
[in]optionsGroup of enum lrmd_call_options flags
Returns
Legacy Pacemaker return code (of particular interest, EINPROGRESS means that operations are in progress for the resource, and the unregistration will be done when they complete)
Note
Pending and recurring operations will be cancelled.
Synchronous, guaranteed to occur in daemon before function returns.

Definition at line 313 of file lrmd.h.


The documentation for this struct was generated from the following file: