pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
Data Structures | Typedefs | Enumerations | Functions
cluster.h File Reference
#include <glib.h>
#include <crm/cluster/compat.h>
Include dependency graph for cluster.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pcmk__cluster
 

Typedefs

typedef struct pcmk__cluster_private pcmk__cluster_private_t
 
typedef struct pcmk__cluster pcmk_cluster_t
 Connection to a cluster layer. More...
 

Enumerations

enum  pcmk_cluster_layer { pcmk_cluster_layer_unknown = 1, pcmk_cluster_layer_invalid = 2, pcmk_cluster_layer_corosync = 32 }
 Types of cluster layer. More...
 

Functions

int pcmk_cluster_connect (pcmk_cluster_t *cluster)
 
int pcmk_cluster_disconnect (pcmk_cluster_t *cluster)
 Disconnect from the cluster layer. More...
 
pcmk_cluster_tpcmk_cluster_new (void)
 Allocate a new pcmk_cluster_t object. More...
 
void pcmk_cluster_free (pcmk_cluster_t *cluster)
 Free a pcmk_cluster_t object and its dynamically allocated members. More...
 
int pcmk_cluster_set_destroy_fn (pcmk_cluster_t *cluster, void(*fn)(gpointer))
 Set the destroy function for a cluster object. More...
 
enum pcmk_cluster_layer pcmk_get_cluster_layer (void)
 Get and validate the local cluster layer. More...
 
const char * pcmk_cluster_layer_text (enum pcmk_cluster_layer layer)
 Get a log-friendly string equivalent of a cluster layer. More...
 

Typedef Documentation

◆ pcmk__cluster_private_t

Definition at line 24 of file cluster.h.

◆ pcmk_cluster_t

typedef struct pcmk__cluster pcmk_cluster_t

Connection to a cluster layer.

Definition at line 54 of file cluster.h.

Enumeration Type Documentation

◆ pcmk_cluster_layer

Types of cluster layer.

Enumerator
pcmk_cluster_layer_unknown 

Unknown cluster layer.

pcmk_cluster_layer_invalid 

Invalid cluster layer.

pcmk_cluster_layer_corosync 

Corosync Cluster Engine.

Definition at line 72 of file cluster.h.

Function Documentation

◆ pcmk_cluster_connect()

int pcmk_cluster_connect ( pcmk_cluster_t cluster)

Definition at line 78 of file cluster.c.

◆ pcmk_cluster_disconnect()

int pcmk_cluster_disconnect ( pcmk_cluster_t cluster)

Disconnect from the cluster layer.

Parameters
[in,out]clusterCluster object to disconnect
Returns
Standard Pacemaker return code

Definition at line 113 of file cluster.c.

◆ pcmk_cluster_free()

void pcmk_cluster_free ( pcmk_cluster_t cluster)

Free a pcmk_cluster_t object and its dynamically allocated members.

Parameters
[in,out]clusterCluster object to free

Definition at line 160 of file cluster.c.

◆ pcmk_cluster_layer_text()

const char* pcmk_cluster_layer_text ( enum pcmk_cluster_layer  layer)

Get a log-friendly string equivalent of a cluster layer.

Parameters
[in]layerCluster layer
Returns
Log-friendly string corresponding to layer

Definition at line 352 of file cluster.c.

◆ pcmk_cluster_new()

pcmk_cluster_t* pcmk_cluster_new ( void  )

Allocate a new pcmk_cluster_t object.

Returns
A newly allocated pcmk_cluster_t object (guaranteed not NULL)
Note
The caller is responsible for freeing the return value using pcmk_cluster_free().

Definition at line 145 of file cluster.c.

◆ pcmk_cluster_set_destroy_fn()

int pcmk_cluster_set_destroy_fn ( pcmk_cluster_t cluster,
void(*)(gpointer)  fn 
)

Set the destroy function for a cluster object.

Parameters
[in,out]clusterCluster object
[in]fnDestroy function to set
Returns
Standard Pacemaker return code

Definition at line 180 of file cluster.c.

◆ pcmk_get_cluster_layer()

enum pcmk_cluster_layer pcmk_get_cluster_layer ( void  )

Get and validate the local cluster layer.

If a cluster layer is not configured via the PCMK__ENV_CLUSTER_TYPE local option, this will try to detect an active cluster from among the supported cluster layers.

Returns
Local cluster layer
Note
This will fatally exit if the configured cluster layer is invalid.

Definition at line 379 of file cluster.c.