pacemaker  2.1.5-b7adf64e51
Scalable High-Availability cluster resource manager
Macros | Functions
operations.c File Reference
#include <crm_internal.h>
#include <regex.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <ctype.h>
#include <crm/crm.h>
#include <crm/lrmd.h>
#include <crm/msg_xml.h>
#include <crm/common/xml.h>
#include <crm/common/xml_internal.h>
#include <crm/common/util.h>
Include dependency graph for operations.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 

Functions

char * pcmk__op_key (const char *rsc_id, const char *op_type, guint interval_ms)
 Generate an operation key (RESOURCE_ACTION_INTERVAL) More...
 
gboolean parse_op_key (const char *key, char **rsc_id, char **op_type, guint *interval_ms)
 
char * pcmk__notify_key (const char *rsc_id, const char *notify_type, const char *op_type)
 
gboolean decode_transition_magic (const char *magic, char **uuid, int *transition_id, int *action_id, int *op_status, int *op_rc, int *target_rc)
 Parse a transition magic string into its constituent parts. More...
 
char * pcmk__transition_key (int transition_id, int action_id, int target_rc, const char *node)
 
gboolean decode_transition_key (const char *key, char **uuid, int *transition_id, int *action_id, int *target_rc)
 Parse a transition key into its constituent parts. More...
 
void pcmk__filter_op_for_digest (xmlNode *param_set)
 
int rsc_op_expected_rc (lrmd_event_data_t *op)
 
gboolean did_rsc_op_fail (lrmd_event_data_t *op, int target_rc)
 
xmlNode * crm_create_op_xml (xmlNode *parent, const char *prefix, const char *task, const char *interval_spec, const char *timeout)
 Create a CIB XML element for an operation. More...
 
bool crm_op_needs_metadata (const char *rsc_class, const char *op)
 Check whether an operation requires resource agent meta-data. More...
 
bool pcmk__is_fencing_action (const char *action)
 
bool pcmk_is_probe (const char *task, guint interval)
 
bool pcmk_xe_is_probe (xmlNode *xml_op)
 
bool pcmk_xe_mask_probe_failure (xmlNode *xml_op)
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 13 of file operations.c.

Function Documentation

◆ crm_create_op_xml()

xmlNode* crm_create_op_xml ( xmlNode *  parent,
const char *  prefix,
const char *  task,
const char *  interval_spec,
const char *  timeout 
)

Create a CIB XML element for an operation.

Parameters
[in,out]parentIf not NULL, make new XML node a child of this
[in]prefixGenerate an ID using this prefix
[in]taskOperation task to set
[in]interval_specOperation interval to set
[in]timeoutIf not NULL, operation timeout to set
Returns
New XML object on success, NULL otherwise

Definition at line 474 of file operations.c.

◆ crm_op_needs_metadata()

bool crm_op_needs_metadata ( const char *  rsc_class,
const char *  op 
)

Check whether an operation requires resource agent meta-data.

Parameters
[in]rsc_classResource agent class (or NULL to skip class check)
[in]opOperation action (or NULL to skip op check)
Returns
true if operation needs meta-data, false otherwise
Note
At least one of rsc_class and op must be specified.

Definition at line 501 of file operations.c.

◆ decode_transition_key()

gboolean decode_transition_key ( const char *  key,
char **  uuid,
int *  transition_id,
int *  action_id,
int *  target_rc 
)

Parse a transition key into its constituent parts.

Parameters
[in]keyTransition key to parse (must be non-NULL)
[out]uuidIf non-NULL, where to store copy of parsed UUID
[out]transition_idIf non-NULL, where to store parsed transition ID
[out]action_idIf non-NULL, where to store parsed action ID
[out]target_rcIf non-NULL, where to stored parsed target rc
Returns
TRUE if key was valid, FALSE otherwise
Note
If uuid is supplied and this returns TRUE, the caller is responsible for freeing the memory for *uuid using free().

Definition at line 318 of file operations.c.

◆ decode_transition_magic()

gboolean decode_transition_magic ( const char *  magic,
char **  uuid,
int *  transition_id,
int *  action_id,
int *  op_status,
int *  op_rc,
int *  target_rc 
)

Parse a transition magic string into its constituent parts.

Parameters
[in]magicMagic string to parse (must be non-NULL)
[out]uuidIf non-NULL, where to store copy of parsed UUID
[out]transition_idIf non-NULL, where to store parsed transition ID
[out]action_idIf non-NULL, where to store parsed action ID
[out]op_statusIf non-NULL, where to store parsed result status
[out]op_rcIf non-NULL, where to store parsed actual rc
[out]target_rcIf non-NULL, where to stored parsed target rc
Returns
TRUE if key was valid, FALSE otherwise
Note
If uuid is supplied and this returns TRUE, the caller is responsible for freeing the memory for *uuid using free().

Definition at line 255 of file operations.c.

◆ did_rsc_op_fail()

gboolean did_rsc_op_fail ( lrmd_event_data_t op,
int  target_rc 
)

Definition at line 437 of file operations.c.

◆ parse_op_key()

gboolean parse_op_key ( const char *  key,
char **  rsc_id,
char **  op_type,
guint *  interval_ms 
)

Definition at line 185 of file operations.c.

◆ pcmk__filter_op_for_digest()

void pcmk__filter_op_for_digest ( xmlNode *  param_set)

Definition at line 390 of file operations.c.

◆ pcmk__is_fencing_action()

bool pcmk__is_fencing_action ( const char *  action)

Definition at line 535 of file operations.c.

◆ pcmk__notify_key()

char* pcmk__notify_key ( const char *  rsc_id,
const char *  notify_type,
const char *  op_type 
)

Definition at line 229 of file operations.c.

◆ pcmk__op_key()

char* pcmk__op_key ( const char *  rsc_id,
const char *  op_type,
guint  interval_ms 
)

Generate an operation key (RESOURCE_ACTION_INTERVAL)

Parameters
[in]rsc_idID of resource being operated on
[in]op_typeOperation name
[in]interval_msOperation interval
Returns
Newly allocated memory containing operation key as string
Note
This function asserts on errors, so it will never return NULL. The caller is responsible for freeing the result with free().

Definition at line 45 of file operations.c.

◆ pcmk__transition_key()

char* pcmk__transition_key ( int  transition_id,
int  action_id,
int  target_rc,
const char *  node 
)

Definition at line 296 of file operations.c.

◆ pcmk_is_probe()

bool pcmk_is_probe ( const char *  task,
guint  interval 
)

Definition at line 541 of file operations.c.

◆ pcmk_xe_is_probe()

bool pcmk_xe_is_probe ( xmlNode *  xml_op)

Definition at line 551 of file operations.c.

◆ pcmk_xe_mask_probe_failure()

bool pcmk_xe_mask_probe_failure ( xmlNode *  xml_op)

Definition at line 562 of file operations.c.

◆ rsc_op_expected_rc()

int rsc_op_expected_rc ( lrmd_event_data_t op)

Definition at line 426 of file operations.c.