pacemaker
2.0.5-ba59be712
Scalable High-Availability cluster resource manager
|
#include <crm_internal.h>
#include <crm/common/mainloop.h>
#include <crm/common/results.h>
#include <crm/common/output_internal.h>
#include <crm/stonith-ng.h>
#include <crm/fencing/internal.h>
#include <glib.h>
#include <libxml/tree.h>
#include <pacemaker.h>
#include <pcmki/pcmki_output.h>
#include <pcmki/pcmki_fence.h>
Go to the source code of this file.
Functions | |
int | pcmk__fence_action (stonith_t *st, const char *target, const char *action, const char *name, unsigned int timeout, unsigned int tolerance, int delay) |
Perform a STONITH action. More... | |
int | pcmk__fence_history (pcmk__output_t *out, stonith_t *st, char *target, unsigned int timeout, int verbose, bool broadcast, bool cleanup) |
List the fencing operations that have occurred for a specific node. More... | |
int | pcmk__fence_installed (pcmk__output_t *out, stonith_t *st, unsigned int timeout) |
List all installed STONITH agents. More... | |
int | pcmk__fence_last (pcmk__output_t *out, const char *target, bool as_nodeid) |
When was a device last fenced? More... | |
int | pcmk__fence_list_targets (pcmk__output_t *out, stonith_t *st, const char *device_id, unsigned int timeout) |
List nodes that can be fenced. More... | |
int | pcmk__fence_metadata (pcmk__output_t *out, stonith_t *st, char *agent, unsigned int timeout) |
Get metadata for a resource. More... | |
int | pcmk__fence_registered (pcmk__output_t *out, stonith_t *st, char *target, unsigned int timeout) |
List registered fence devices. More... | |
int | pcmk__fence_register_level (stonith_t *st, char *target, int fence_level, stonith_key_value_t *devices) |
Register a fencing level for a specific node, node regex, or attribute. More... | |
int | pcmk__fence_unregister_level (stonith_t *st, char *target, int fence_level) |
Unregister a fencing level for a specific node, node regex, or attribute. More... | |
int | pcmk__fence_validate (pcmk__output_t *out, stonith_t *st, const char *agent, const char *id, stonith_key_value_t *params, unsigned int timeout) |
Validate a STONITH device configuration. More... | |
int pcmk__fence_action | ( | stonith_t * | st, |
const char * | target, | ||
const char * | action, | ||
const char * | name, | ||
unsigned int | timeout, | ||
unsigned int | tolerance, | ||
int | delay | ||
) |
Perform a STONITH action.
[in] | st | A connection to the STONITH API. |
[in] | target | The node receiving the action. |
[in] | action | The action to perform. |
[in] | name | Who requested the fence action? |
[in] | timeout | How long to wait for the operation to complete (in ms). |
[in] | tolerance | If a successful action for target happened within this many ms, return 0 without performing the action again. |
[in] | delay | Apply a fencing delay. Value -1 means disable also any static/random fencing delays from pcmk_delay_base/max |
Definition at line 136 of file pcmk_fence.c.
int pcmk__fence_history | ( | pcmk__output_t * | out, |
stonith_t * | st, | ||
char * | target, | ||
unsigned int | timeout, | ||
int | verbose, | ||
bool | broadcast, | ||
bool | cleanup | ||
) |
List the fencing operations that have occurred for a specific node.
out
should be initialized with pcmk__output_new() before calling this function and destroyed with out->finish and pcmk__output_free() before reusing it with any other functions in this library.[in,out] | out | The output functions structure. |
[in] | st | A connection to the STONITH API. |
[in] | target | The node to get history for. |
[in] | timeout | How long to wait for the operation to complete (in ms). |
[in] | verbose | Include additional output. |
[in] | broadcast | Gather fencing history from all nodes. |
[in] | cleanup | Clean up fencing history after listing. |
Definition at line 173 of file pcmk_fence.c.
int pcmk__fence_installed | ( | pcmk__output_t * | out, |
stonith_t * | st, | ||
unsigned int | timeout | ||
) |
List all installed STONITH agents.
out
should be initialized with pcmk__output_new() before calling this function and destroyed with out->finish and pcmk__output_free() before reusing it with any other functions in this library.[in,out] | out | The output functions structure. |
[in] | st | A connection to the STONITH API. |
[in] | timeout | How long to wait for the operation to complete (in ms). |
Definition at line 259 of file pcmk_fence.c.
int pcmk__fence_last | ( | pcmk__output_t * | out, |
const char * | target, | ||
bool | as_nodeid | ||
) |
When was a device last fenced?
out
should be initialized with pcmk__output_new() before calling this function and destroyed with out->finish and pcmk__output_free() before reusing it with any other functions in this library.[in,out] | out | The output functions structure. |
[in] | target | The node that was fenced. |
[in] | as_nodeid |
Definition at line 297 of file pcmk_fence.c.
int pcmk__fence_list_targets | ( | pcmk__output_t * | out, |
stonith_t * | st, | ||
const char * | device_id, | ||
unsigned int | timeout | ||
) |
List nodes that can be fenced.
out
should be initialized with pcmk__output_new() before calling this function and destroyed with out->finish and pcmk__output_free() before reusing it with any other functions in this library.[in,out] | out | The output functions structure |
[in] | st | A connection to the STONITH API |
[in] | device_id | Resource ID of fence device to check |
[in] | timeout | How long to wait for the operation to complete (in ms) |
Definition at line 331 of file pcmk_fence.c.
int pcmk__fence_metadata | ( | pcmk__output_t * | out, |
stonith_t * | st, | ||
char * | agent, | ||
unsigned int | timeout | ||
) |
Get metadata for a resource.
out
should be initialized with pcmk__output_new() before calling this function and destroyed with out->finish and pcmk__output_free() before reusing it with any other functions in this library.[in,out] | out | The output functions structure. |
[in] | st | A connection to the STONITH API. |
[in] | agent | The fence agent to get metadata for. |
[in] | timeout | How long to wait for the operation to complete (in ms). |
Definition at line 374 of file pcmk_fence.c.
int pcmk__fence_register_level | ( | stonith_t * | st, |
char * | target, | ||
int | fence_level, | ||
stonith_key_value_t * | devices | ||
) |
Register a fencing level for a specific node, node regex, or attribute.
target
can take three different forms:
target
is an attribute.target
is a node regex.target
is a node name.[in] | st | A connection to the STONITH API. |
[in] | target | The object to register a fencing level for. |
[in] | fence_level | Index number of level to add. |
[in] | devices | Devices to use in level. |
Definition at line 452 of file pcmk_fence.c.
int pcmk__fence_registered | ( | pcmk__output_t * | out, |
stonith_t * | st, | ||
char * | target, | ||
unsigned int | timeout | ||
) |
List registered fence devices.
out
should be initialized with pcmk__output_new() before calling this function and destroyed with out->finish and pcmk__output_free() before reusing it with any other functions in this library.[in,out] | out | The output functions structure. |
[in] | st | A connection to the STONITH API. |
[in] | target | If not NULL, only return devices that can fence this node. |
[in] | timeout | How long to wait for the operation to complete (in ms). |
Definition at line 408 of file pcmk_fence.c.
int pcmk__fence_unregister_level | ( | stonith_t * | st, |
char * | target, | ||
int | fence_level | ||
) |
Unregister a fencing level for a specific node, node regex, or attribute.
target
can take three different forms:
target
is an attribute.target
is a node regex.target
is a node name.[in] | st | A connection to the STONITH API. |
[in] | target | The object to unregister a fencing level for. |
[in] | fence_level | Index number of level to remove. |
Definition at line 466 of file pcmk_fence.c.
int pcmk__fence_validate | ( | pcmk__output_t * | out, |
stonith_t * | st, | ||
const char * | agent, | ||
const char * | id, | ||
stonith_key_value_t * | params, | ||
unsigned int | timeout | ||
) |
Validate a STONITH device configuration.
out
should be initialized with pcmk__output_new() before calling this function and destroyed with out->finish and pcmk__output_free() before reusing it with any other functions in this library.[in,out] | out | The output functions structure. |
[in] | st | A connection to the STONITH API. |
[in] | agent | The agent to validate (for example, "fence_xvm"). |
[in] | id | STONITH device ID (may be NULL). |
[in] | params | STONITH device configuration parameters. |
[in] | timeout | How long to wait for the operation to complete (in ms). |
Definition at line 478 of file pcmk_fence.c.
const char* action |
Definition at line 30 of file pcmk_fence.c.
int delay |
Definition at line 34 of file pcmk_fence.c.
char* name |
Definition at line 31 of file pcmk_fence.c.
int rc |
Definition at line 35 of file pcmk_fence.c.
stonith_t* st |
Definition at line 28 of file pcmk_fence.c.
const char* target |
Definition at line 29 of file pcmk_fence.c.
unsigned int timeout |
Definition at line 32 of file pcmk_fence.c.
unsigned int tolerance |
Definition at line 33 of file pcmk_fence.c.