pacemaker  2.0.5-ba59be712
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)
 Is connected to lrmd daemon? 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 registration info for a rsc. 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 286 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.

Note
Synchronous, guaranteed to occur in daemon before function returns.
The cancel is completed async from this call. We can be guaranteed the cancel has completed once the callback receives an exec_complete event with the lrmd_op_status signifying that the operation is cancelled.
For each resource, cancel operations and exec operations are processed in the order they are received. It is safe to assume that for a single resource, a cancel will occur in the executor before an exec if the client's cancel api call occurs before the exec api call.

It is not however safe to assume any operation on one resource will occur before an operation on another resource regardless of the order the client api is called in.

Return values
0,cancelcommand sent.
negativeerror code on failure

Definition at line 424 of file lrmd.h.

◆ connect

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

Connect to an executor.

Return values
0,success
negativeerror code on failure

Definition at line 293 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
0 on success (in which case the event callback will be called later with the connection result), -1 otherwise
Note
This function requires a mainloop.

Definition at line 302 of file lrmd.h.

◆ disconnect

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

Disconnect from the executor.

Return values
0,success
negativeerror code on failure

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

Note
Asynchronous, command is queued in daemon on function return, but execution of command is not synced.
Operations on individual resources are guaranteed to occur in the order the client api calls them in.
Operations between different resources are not guaranteed to occur in any specific order in relation to one another regardless of what order the client api is called in.
Return values
call_idto track async event result on success
negativeerror code on failure

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

Note
Asynchronous, command is queued in daemon on function return, but execution of command is not synced.
Operations on individual alerts are guaranteed to occur in the order the client api calls them in.
Operations between different alerts are not guaranteed to occur in any specific order in relation to one another regardless of what order the client api is called in.
Return values
call_idto track async event result on success
negativeerror code on failure

Definition at line 504 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)
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.
Return values
lrmd_oksuccess
negativeerror code on failure

Definition at line 450 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
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.
Returns
lrmd_ok on success, negative error code on failure

Definition at line 525 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
pcmk_ok on success, -errno otherwise

Definition at line 356 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 registration info for a rsc.

Return values
infoon success
NULLon failure

Definition at line 348 of file lrmd.h.

◆ is_connected

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

Is connected to lrmd daemon?

Return values
0,false
1,true

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.

Note
if standard is not provided, all known agents will be returned
list must be freed using lrmd_list_freeall()
Return values
numitems in list on success
negativeerror code on failure

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

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()
Return values
numitems in list on success
negativeerror code on failure

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

Note
List must be freed using lrmd_list_freeall()
Return values
numitems in list on success
negativeerror code on failure

Definition at line 487 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.
Return values
0,waitfor response in callback
-1,connectionfailure, callback may not be invoked

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.
Return values
0,success
negativeerror code on failure

Definition at line 337 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 378 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.
Return values
0,success
-1,success,butoperations are currently executing on the rsc which will return once they are completed.
negativeerror code on failure

Definition at line 373 of file lrmd.h.


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