pacemaker  1.1.18-7fdfbbe
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
lrmd_api_operations_s Struct Reference

#include <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 from the lrmd. More...
 
int(* connect_async )(lrmd_t *lrmd, const char *client_name, int timeout)
 Establish an connection to lrmd, don't block while connecting. More...
 
int(* is_connected )(lrmd_t *lrmd)
 Is connected to lrmd daemon? More...
 
int(* poke_connection )(lrmd_t *lrmd)
 Poke lrmd connection to verify it is still capable of serving requests. More...
 
int(* disconnect )(lrmd_t *lrmd)
 Disconnect from the lrmd. More...
 
int(* register_rsc )(lrmd_t *lrmd, const char *rsc_id, const char *class, const char *provider, const char *agent, enum lrmd_call_options options)
 Register a resource with the lrmd. 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(* unregister_rsc )(lrmd_t *lrmd, const char *rsc_id, enum lrmd_call_options options)
 Unregister a resource from the lrmd. More...
 
void(* set_callback )(lrmd_t *lrmd, lrmd_event_callback callback)
 Sets the callback to receive lrmd events on. More...
 
int(* exec )(lrmd_t *lrmd, const char *rsc_id, const char *action, const char *userdata, int interval, 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, int interval)
 Cancel a recurring command. More...
 
int(* get_metadata )(lrmd_t *lrmd, const char *class, 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 *class, 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...
 

Detailed Description

Definition at line 280 of file lrmd.h.

Field Documentation

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

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

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

Connect from the lrmd.

Return values
0,success
negativeerror code on failure

Definition at line 287 of file lrmd.h.

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

Establish an connection to lrmd, don't block while connecting.

Note
this function requires the use of mainloop.
The is returned using the event callback.
When this function returns 0, the callback will be invoked to report the final result of the connect.
Return values
0,connectin progress, wait for event callback
-1,failure.

Definition at line 299 of file lrmd.h.

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

Disconnect from the lrmd.

Return values
0,success
negativeerror code on failure

Definition at line 324 of file lrmd.h.

int(* lrmd_api_operations_s::exec)(lrmd_t *lrmd, const char *rsc_id, const char *action, const char *userdata,int interval,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 384 of file lrmd.h.

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

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

Get resource metadata for a specified resource agent.

Parameters
[in]lrmdLRMD connection (unused)
[in]classResource 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 LRMD 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 LRMD connection). This means that it is based on the local host environment, even if the lrmd 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 lrmd's.
Todo:
Add a metadata call to the LRMD API and let the server handle this.
Return values
lrmd_oksuccess
negativeerror code on failure

Definition at line 438 of file lrmd.h.

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

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

Is connected to lrmd daemon?

Return values
0,false
1,true

Definition at line 307 of file lrmd.h.

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

Retrieve a list of installed resource agents.

Note
if class 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 452 of file lrmd.h.

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

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

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

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

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

Register a resource with the lrmd.

Note
Synchronous, guaranteed to occur in daemon before function returns.
Return values
0,success
negativeerror code on failure

Definition at line 334 of file lrmd.h.

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

Sets the callback to receive lrmd events on.

Definition at line 367 of file lrmd.h.

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

Unregister a resource from the lrmd.

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


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