pacemaker  2.1.4-dc6eb4362
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 capable of serving requests. 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 registered recurring operations. 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)
 Issue a command on a resource. More...
 
int(* cancel )(lrmd_t *lrmd, const char *rsc_id, const char *action, guint interval_ms)
 Cancel a recurring command. More...
 
int(* get_metadata )(lrmd_t *lrmd, const char *standard, const char *provider, const char *agent, char **output, enum lrmd_call_options options)
 Get resource metadata for a specified resource agent. 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 standards supported by this machine/installation. 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)
 Get resource metadata for a resource agent, passing parameters. More...
 

Detailed Description

Definition at line 288 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 command.

Returns
Legacy Pacemaker return code (if pcmk_ok, command is queued in daemon 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 407 of file lrmd.h.

◆ connect

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

Connect to an executor.

Returns
Legacy Pacemaker return code

Definition at line 294 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.

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 303 of file lrmd.h.

◆ disconnect

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

Disconnect from the executor.

Returns
Legacy Pacemaker return code

Definition at line 326 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)

Issue a command on a resource.

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 388 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.

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 482 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)

Get resource metadata for a specified resource agent.

Parameters
[in]lrmdExecutor connection (unused)
[in]standardResource agent class
[in]providerResource agent provider
[in]agentResource agent type
[out]outputMetadata will be stored here (must not be NULL)
[in]optionsOptions to use with any executor API calls (unused)
Returns
Legacy Pacemaker return code
Note
Caller is responsible for freeing output. This call is currently 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 (for most resource agent classes) this will 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.
Todo:
Add a metadata call to the executor API and let the server handle this.

Definition at line 432 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)

Get resource metadata for a resource agent, passing parameters.

Parameters
[in]lrmdExecutor connection (unused)
[in]standardResource agent class
[in]providerResource agent provider
[in]agentResource agent type
[out]outputMetadata will be stored here (must not be NULL)
[in]optionsOptions to use with any executor API calls (unused)
[in]paramsParameters to pass to agent via environment
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.
The API will handle freeing params.

Definition at line 503 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 registered recurring operations.

Returns
Legacy Pacemaker return code

Definition at line 353 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.

Returns
Resource information on success, otherwise NULL

Definition at line 345 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.

Returns
1 if the executor connection is active, 0 otherwise

Definition at line 310 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.

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 446 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.

Returns
Number of items in list on success, negative legacy Pacemaker return code otherwise
Note
When the agent is provided, only the agent's provider will be returned
When no agent is supplied, all providers will be returned.
List must be freed using lrmd_list_freeall()

Definition at line 459 of file lrmd.h.

◆ list_standards

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

Retrieve a list of standards supported by this machine/installation.

Returns
Number of items in list on success, negative legacy Pacemaker return code otherwise
Note
List must be freed using lrmd_list_freeall()

Definition at line 469 of file lrmd.h.

◆ poke_connection

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

Poke executor connection to verify it is still capable of serving requests.

Note
The response comes in the form of a poke event to the callback.
Returns
Legacy Pacemaker return code (if pcmk_ok, the event callback will be called later with the result)

Definition at line 319 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.

Note
Synchronous, guaranteed to occur in daemon before function returns.
Returns
Legacy Pacemaker return code

Definition at line 335 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.

Definition at line 373 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.

Note
All pending and recurring operations will be cancelled automatically.
Synchronous, guaranteed to occur in daemon before function returns.
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)

Definition at line 368 of file lrmd.h.


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