pacemaker  1.1.16-94ff4df
Scalable High-Availability cluster resource manager
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 the metadata documentation for a resource. 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...
 

Detailed Description

Definition at line 264 of file lrmd.h.

Field Documentation

◆ cancel

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

◆ connect

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

◆ connect_async

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

◆ disconnect

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

Disconnect from the lrmd.

Return values
0,success
negativeerror code on failure

Definition at line 308 of file lrmd.h.

◆ exec

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

◆ get_metadata

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 the metadata documentation for a resource.

Note
Value is returned in output. Output must be freed when set
Return values
lrmd_oksuccess
negativeerror code on failure

Definition at line 407 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 329 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 291 of file lrmd.h.

◆ list_agents

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 421 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 434 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 444 of file lrmd.h.

◆ poke_connection

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

◆ register_rsc

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

◆ set_callback

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


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