pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
Data Fields
resource_object_functions_s Struct Reference

Resource object methods. More...

#include <include/crm/common/resources.h>

Collaboration diagram for resource_object_functions_s:
Collaboration graph
[legend]

Data Fields

gboolean(* unpack )(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
 Parse variant-specific resource XML from CIB into struct members. More...
 
pcmk_resource_t *(* find_rsc )(pcmk_resource_t *rsc, const char *search, const pcmk_node_t *node, int flags)
 Search for a resource ID in a resource and its children. More...
 
char *(* parameter )(pcmk_resource_t *rsc, pcmk_node_t *node, gboolean create, const char *name, pcmk_scheduler_t *scheduler)
 Get value of a resource instance attribute. More...
 
void(* print )(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
 
gboolean(* active )(pcmk_resource_t *rsc, gboolean all)
 Check whether a resource is active. More...
 
enum rsc_role_e(* state )(const pcmk_resource_t *rsc, gboolean current)
 Get resource's current or assigned role. More...
 
pcmk_node_t *(* location )(const pcmk_resource_t *rsc, GList **list, int current)
 List nodes where a resource (or any of its children) is. More...
 
void(* free )(pcmk_resource_t *rsc)
 Free all memory used by a resource. More...
 
void(* count )(pcmk_resource_t *rsc)
 Increment cluster's instance counts for a resource. More...
 
gboolean(* is_filtered )(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
 Check whether a given resource is in a list of resources. More...
 
pcmk_node_t *(* active_node )(const pcmk_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
 Find a node (and optionally count all) where resource is active. More...
 
unsigned int(* max_per_node )(const pcmk_resource_t *rsc)
 Get maximum resource instances per node. More...
 

Detailed Description

Resource object methods.

Definition at line 266 of file resources.h.

Field Documentation

◆ active

gboolean(* resource_object_functions_s::active) (pcmk_resource_t *rsc, gboolean all)

Check whether a resource is active.

Parameters
[in]rscResource to check
[in]allIf rsc is collective, all instances must be active
Returns
TRUE if rsc is active, otherwise FALSE

Definition at line 317 of file resources.h.

◆ active_node

pcmk_node_t*(* resource_object_functions_s::active_node) (const pcmk_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)

Find a node (and optionally count all) where resource is active.

Parameters
[in]rscResource to check
[out]count_allIf not NULL, set this to count of active nodes
[out]count_cleanIf not NULL, set this to count of clean nodes
Returns
A node where the resource is active, preferring the source node if the resource is involved in a partial migration, or a clean, online node if the resource's "requires" is "quorum" or "nothing", otherwise NULL.

Definition at line 384 of file resources.h.

◆ count

void(* resource_object_functions_s::count) (pcmk_resource_t *rsc)

Increment cluster's instance counts for a resource.

Given a resource, increment its cluster's ninstances, disabled_resources, and blocked_resources counts for the resource and its descendants.

Parameters
[in,out]rscResource to count

Definition at line 357 of file resources.h.

◆ find_rsc

pcmk_resource_t*(* resource_object_functions_s::find_rsc) (pcmk_resource_t *rsc, const char *search, const pcmk_node_t *node, int flags)

Search for a resource ID in a resource and its children.

Parameters
[in]rscSearch this resource and its children
[in]idSearch for this resource ID
[in]on_nodeIf not NULL, limit search to resources on this node
[in]flagsGroup of enum pe_find flags
Returns
Resource that matches search criteria if any, otherwise NULL

Definition at line 287 of file resources.h.

◆ free

void(* resource_object_functions_s::free) (pcmk_resource_t *rsc)

Free all memory used by a resource.

Parameters
[in,out]rscResource to free

Definition at line 347 of file resources.h.

◆ is_filtered

gboolean(* resource_object_functions_s::is_filtered) (const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)

Check whether a given resource is in a list of resources.

Parameters
[in]rscResource ID to check for
[in]only_rscList of resource IDs to check
[in]check_parentIf TRUE, check top ancestor as well
Returns
TRUE if rsc, its top parent if requested, or '*' is in only_rsc, otherwise FALSE

Definition at line 369 of file resources.h.

◆ location

pcmk_node_t*(* resource_object_functions_s::location) (const pcmk_resource_t *rsc, GList **list, int current)

List nodes where a resource (or any of its children) is.

Parameters
[in]rscResource to check
[out]listList to add result to
[in]currentIf 0, list nodes where rsc is assigned; if 1, where active; if 2, where active or pending
Returns
If list contains only one node, that node, otherwise NULL

Definition at line 339 of file resources.h.

◆ max_per_node

unsigned int(* resource_object_functions_s::max_per_node) (const pcmk_resource_t *rsc)

Get maximum resource instances per node.

Parameters
[in]rscResource to check
Returns
Maximum number of rsc instances that can be active on one node

Definition at line 395 of file resources.h.

◆ parameter

char*(* resource_object_functions_s::parameter) (pcmk_resource_t *rsc, pcmk_node_t *node, gboolean create, const char *name, pcmk_scheduler_t *scheduler)

Get value of a resource instance attribute.

Parameters
[in,out]rscResource to check
[in]nodeNode to use to evaluate rules
[in]createIgnored
[in]nameName of instance attribute to check
[in,out]schedulerScheduler data
Returns
Value of requested attribute if available, otherwise NULL
Note
The caller is responsible for freeing the result using free().

Definition at line 302 of file resources.h.

◆ print

void(* resource_object_functions_s::print) (pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
Deprecated:
Do not use

Definition at line 306 of file resources.h.

◆ state

enum rsc_role_e(* resource_object_functions_s::state) (const pcmk_resource_t *rsc, gboolean current)

Get resource's current or assigned role.

Parameters
[in]rscResource to check
[in]currentIf TRUE, check current role, otherwise assigned role
Returns
Current or assigned role of rsc

Definition at line 327 of file resources.h.

◆ unpack

gboolean(* resource_object_functions_s::unpack) (pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)

Parse variant-specific resource XML from CIB into struct members.

Parameters
[in,out]rscPartially unpacked resource
[in,out]schedulerScheduler data
Returns
TRUE if resource was unpacked successfully, otherwise FALSE

Definition at line 275 of file resources.h.


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