pacemaker  1.1.16-94ff4df
Scalable High-Availability cluster resource manager
complex.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This software is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef PENGINE_COMPLEX__H
19 # define PENGINE_COMPLEX__H
20 
21 # define n_object_classes 3
22 
23 /*#define PE_OBJ_F_ ""*/
24 
25 # define PE_OBJ_T_NATIVE "native"
26 # define PE_OBJ_T_GROUP "group"
27 # define PE_OBJ_T_INCARNATION "clone"
28 # define PE_OBJ_T_MASTER "master"
29 
31  pe_unknown = -1,
32  pe_native = 0,
33  pe_group = 1,
34  pe_clone = 2,
36 };
37 
38 enum pe_obj_types get_resource_type(const char *name);
39 const char *get_resource_typename(enum pe_obj_types type);
40 
42  gboolean(*unpack) (resource_t *, pe_working_set_t *);
43  resource_t *(*find_rsc) (resource_t * parent, const char *search, node_t * node, int flags);
44  /* parameter result must be free'd */
45  char *(*parameter) (resource_t *, node_t *, gboolean, const char *, pe_working_set_t *);
46  void (*print) (resource_t *, const char *, long, void *);
47  gboolean(*active) (resource_t *, gboolean);
48  enum rsc_role_e (*state) (const resource_t *, gboolean);
49  node_t *(*location) (resource_t *, GListPtr *, gboolean);
50  void (*free) (resource_t *);
52 
54 void get_meta_attributes(GHashTable * meta_hash, resource_t * rsc, node_t * node,
55  pe_working_set_t * data_set);
56 void get_rsc_attributes(GHashTable * meta_hash, resource_t * rsc, node_t * node,
57  pe_working_set_t * data_set);
58 
59 typedef struct resource_alloc_functions_s resource_alloc_functions_t;
60 
61 gboolean is_parent(resource_t *child, resource_t *rsc);
63 
64 #endif
gboolean is_parent(resource_t *child, resource_t *rsc)
Definition: complex.c:764
void(* free)(resource_t *)
Definition: complex.h:50
void get_rsc_attributes(GHashTable *meta_hash, resource_t *rsc, node_t *node, pe_working_set_t *data_set)
Definition: complex.c:153
enum rsc_role_e(* state)(const resource_t *, gboolean)
Definition: complex.h:48
struct resource_object_functions_s resource_object_functions_t
resource_t * uber_parent(resource_t *rsc)
Definition: complex.c:781
const char * get_resource_typename(enum pe_obj_types type)
Definition: complex.c:86
pe_obj_types
Definition: complex.h:30
resource_object_functions_t resource_class_functions[]
Definition: complex.c:27
gboolean(* active)(resource_t *, gboolean)
Definition: complex.h:47
enum pe_obj_types get_resource_type(const char *name)
Definition: complex.c:67
void(* print)(resource_t *, const char *, long, void *)
Definition: complex.h:46
gboolean(* unpack)(resource_t *, pe_working_set_t *)
Definition: complex.h:42
rsc_role_e
Definition: common.h:81
void get_meta_attributes(GHashTable *meta_hash, resource_t *rsc, node_t *node, pe_working_set_t *data_set)
Definition: complex.c:110
struct resource_alloc_functions_s resource_alloc_functions_t
Definition: complex.h:59
Definition: status.h:165
GList * GListPtr
Definition: crm.h:198
uint64_t flags
Definition: remote.c:121
enum crm_ais_msg_types type
Definition: internal.h:51