pacemaker  2.1.9-49aab99839
Scalable High-Availability cluster resource manager
Functions
pcmk_ticket.c File Reference
#include <crm_internal.h>
#include <crm/cib/internal.h>
#include <crm/pengine/internal.h>
#include <pacemaker.h>
#include <pacemaker-internal.h>
#include "libpacemaker_private.h"
Include dependency graph for pcmk_ticket.c:

Go to the source code of this file.

Functions

int pcmk__get_ticket_state (cib_t *cib, const char *ticket_id, xmlNode **state)
 
int pcmk__ticket_constraints (pcmk__output_t *out, cib_t *cib, const char *ticket_id)
 
int pcmk_ticket_constraints (xmlNodePtr *xml, const char *ticket_id)
 Return constraints that apply to the given ticket. More...
 
int pcmk__ticket_delete (pcmk__output_t *out, cib_t *cib, pcmk_scheduler_t *scheduler, const char *ticket_id, bool force)
 
int pcmk_ticket_delete (xmlNodePtr *xml, const char *ticket_id, bool force)
 Delete a ticket's state from the local cluster site. More...
 
int pcmk__ticket_get_attr (pcmk__output_t *out, pcmk_scheduler_t *scheduler, const char *ticket_id, const char *attr_name, const char *attr_default)
 
int pcmk_ticket_get_attr (xmlNodePtr *xml, const char *ticket_id, const char *attr_name, const char *attr_default)
 Return the value of a ticket's attribute. More...
 
int pcmk__ticket_info (pcmk__output_t *out, pcmk_scheduler_t *scheduler, const char *ticket_id, bool details, bool raw)
 Return information about the given ticket. More...
 
int pcmk_ticket_info (xmlNodePtr *xml, const char *ticket_id)
 Return information about the given ticket. More...
 
int pcmk__ticket_remove_attr (pcmk__output_t *out, cib_t *cib, pcmk_scheduler_t *scheduler, const char *ticket_id, GList *attr_delete, bool force)
 Remove the given attribute(s) from a ticket. More...
 
int pcmk_ticket_remove_attr (xmlNodePtr *xml, const char *ticket_id, GList *attr_delete, bool force)
 Remove the given attribute(s) from a ticket. More...
 
int pcmk__ticket_set_attr (pcmk__output_t *out, cib_t *cib, pcmk_scheduler_t *scheduler, const char *ticket_id, GHashTable *attr_set, bool force)
 Set the given attribute(s) on a ticket. More...
 
int pcmk_ticket_set_attr (xmlNodePtr *xml, const char *ticket_id, GHashTable *attr_set, bool force)
 Set the given attribute(s) on a ticket. More...
 
int pcmk__ticket_state (pcmk__output_t *out, cib_t *cib, const char *ticket_id)
 
int pcmk_ticket_state (xmlNodePtr *xml, const char *ticket_id)
 Return a ticket's state XML. More...
 

Function Documentation

◆ pcmk__get_ticket_state()

int pcmk__get_ticket_state ( cib_t cib,
const char *  ticket_id,
xmlNode **  state 
)

Definition at line 76 of file pcmk_ticket.c.

◆ pcmk__ticket_constraints()

int pcmk__ticket_constraints ( pcmk__output_t out,
cib_t cib,
const char *  ticket_id 
)

Definition at line 112 of file pcmk_ticket.c.

◆ pcmk__ticket_delete()

int pcmk__ticket_delete ( pcmk__output_t out,
cib_t cib,
pcmk_scheduler_t scheduler,
const char *  ticket_id,
bool  force 
)

Definition at line 180 of file pcmk_ticket.c.

◆ pcmk__ticket_get_attr()

int pcmk__ticket_get_attr ( pcmk__output_t out,
pcmk_scheduler_t scheduler,
const char *  ticket_id,
const char *  attr_name,
const char *  attr_default 
)

Definition at line 259 of file pcmk_ticket.c.

◆ pcmk__ticket_info()

int pcmk__ticket_info ( pcmk__output_t out,
pcmk_scheduler_t scheduler,
const char *  ticket_id,
bool  details,
bool  raw 
)

Return information about the given ticket.

Parameters
[in,out]outOutput object
[in,out]schedulerScheduler data
[in]ticket_idTicket to display info for, or NULL for all tickets
[in]detailsIf true (and out is not an XML format object), output any additional attributes set on a ticket beyond the basics
[in]rawIf true (and out is not an XML format object), simply list the IDs of all tickets. This does not make a lot of sense if ticket_id is not NULL, but that will not raise an error.
Returns
Standard Pacemaker return code

Definition at line 312 of file pcmk_ticket.c.

◆ pcmk__ticket_remove_attr()

int pcmk__ticket_remove_attr ( pcmk__output_t out,
cib_t cib,
pcmk_scheduler_t scheduler,
const char *  ticket_id,
GList *  attr_delete,
bool  force 
)

Remove the given attribute(s) from a ticket.

Parameters
[in,out]outOutput object
[in]cibOpen CIB connection
[in,out]schedulerScheduler data
[in]ticket_idTicket to remove attributes from
[in]attr_deleteA list of attribute names
[in]forceAttempting to remove the granted attribute of ticket_id will cause this function to return EACCES unless force is set to true
Returns
Standard Pacemaker return code

Definition at line 369 of file pcmk_ticket.c.

◆ pcmk__ticket_set_attr()

int pcmk__ticket_set_attr ( pcmk__output_t out,
cib_t cib,
pcmk_scheduler_t scheduler,
const char *  ticket_id,
GHashTable *  attr_set,
bool  force 
)

Set the given attribute(s) on a ticket.

Parameters
[in,out]outOutput object
[in]cibOpen CIB connection
[in,out]schedulerScheduler data
[in]ticket_idTicket to set attributes on
[in]attr_setA hash table of attributes, where keys are the attribute names and the values are the attribute values
[in]forceAttempting to change the granted status of ticket_id will cause this function to return EACCES unless force is set to true
Returns
Standard Pacemaker return code
Note
If no ticket_id attribute exists but attr_set is non-NULL, the ticket will be created with the given attributes.

Definition at line 441 of file pcmk_ticket.c.

◆ pcmk__ticket_state()

int pcmk__ticket_state ( pcmk__output_t out,
cib_t cib,
const char *  ticket_id 
)

Definition at line 510 of file pcmk_ticket.c.

◆ pcmk_ticket_constraints()

int pcmk_ticket_constraints ( xmlNodePtr *  xml,
const char *  ticket_id 
)

Return constraints that apply to the given ticket.

Parameters
[in,out]xmlThe destination for the result, as an XML tree
[in]ticket_idTicket to find constraint for, or NULL for all ticket constraints
Returns
Standard Pacemaker return code

Definition at line 145 of file pcmk_ticket.c.

◆ pcmk_ticket_delete()

int pcmk_ticket_delete ( xmlNodePtr *  xml,
const char *  ticket_id,
bool  force 
)

Delete a ticket's state from the local cluster site.

Parameters
[in,out]xmlThe destination for the result, as an XML tree
[in]ticket_idTicket to delete
[in]forceIf true, delete the ticket even if it has been granted
Returns
Standard Pacemaker return code

Definition at line 234 of file pcmk_ticket.c.

◆ pcmk_ticket_get_attr()

int pcmk_ticket_get_attr ( xmlNodePtr *  xml,
const char *  ticket_id,
const char *  attr_name,
const char *  attr_default 
)

Return the value of a ticket's attribute.

Parameters
[in,out]xmlThe destination for the result, as an XML tree
[in]ticket_idTicket to find attribute value for
[in]attr_nameAttribute's name to find value for
[in]attr_defaultIf either the ticket or the attribute do not exist, use this as the value in xml
Returns
Standard Pacemaker return code

Definition at line 291 of file pcmk_ticket.c.

◆ pcmk_ticket_info()

int pcmk_ticket_info ( xmlNodePtr *  xml,
const char *  ticket_id 
)

Return information about the given ticket.

Parameters
[in,out]xmlThe destination for the result, as an XML tree
[in]ticket_idTicket to find info value for, or NULL for all tickets
Returns
Standard Pacemaker return code

Definition at line 343 of file pcmk_ticket.c.

◆ pcmk_ticket_remove_attr()

int pcmk_ticket_remove_attr ( xmlNodePtr *  xml,
const char *  ticket_id,
GList *  attr_delete,
bool  force 
)

Remove the given attribute(s) from a ticket.

Parameters
[in,out]xmlThe destination for the result, as an XML tree
[in]ticket_idTicket to remove attributes from
[in]attr_deleteA list of attribute names
[in]forceAttempting to remove the granted attribute of ticket_id will cause this function to return EACCES unless force is set to true
Returns
Standard Pacemaker return code

Definition at line 416 of file pcmk_ticket.c.

◆ pcmk_ticket_set_attr()

int pcmk_ticket_set_attr ( xmlNodePtr *  xml,
const char *  ticket_id,
GHashTable *  attr_set,
bool  force 
)

Set the given attribute(s) on a ticket.

Parameters
[in,out]xmlThe destination for the result, as an XML tree
[in]ticket_idTicket to set attributes on
[in]attr_setA hash table of attributes, where keys are the attribute names and the values are the attribute values
[in]forceAttempting to change the granted status of ticket_id will cause this function to return EACCES unless force is set to true
Returns
Standard Pacemaker return code
Note
If no ticket_id attribute exists but attr_set is non-NULL, the ticket will be created with the given attributes.

Definition at line 484 of file pcmk_ticket.c.

◆ pcmk_ticket_state()

int pcmk_ticket_state ( xmlNodePtr *  xml,
const char *  ticket_id 
)

Return a ticket's state XML.

Parameters
[in,out]xmlThe destination for the result, as an XML tree
[in]ticket_idTicket to find state for, or NULL for all tickets
Returns
Standard Pacemaker return code
Note
If ticket_id is not NULL and more than one ticket exists with that ID, this function returns pcmk_rc_duplicate_id.

Definition at line 533 of file pcmk_ticket.c.