patroni.tags module

Tags handling.

_class _patroni.tags.Tags View on GitHub

Bases: ABC + An abstract class that encapsulates all the tags logic. + Child classes that want to use provided facilities must implement tags abstract property. +

abc_impl = <_abc._abc_data object>_

+

static \\__filter_tags(_tags: Dict[ str, Any]) → Dict[ str, Any] View on GitHub

Get tags configured for this node, if any. + Handle both predefined Patroni tags and custom defined tags. + Note

A custom tag is any tag added to the configuration `+tags+` section that is not one of `+clonefrom+`, `+nofailover+`, `+noloadbalance+` or `+nosync+`.
  For the Patroni predefined tags, the returning object will only contain them if they are enabled as they all are boolean values that default to disabled.
  +
  Returns:::
    a dictionary of tags set for this node. The key is the tag name, and the value is the corresponding tag value.
+
property _clonefrom: bool_

True if clonefrom tag is True, else False. +

property _failover_priority: int_

Common logic for obtaining the value of failover_priority from tags if defined.
If nofailover is defined as True, this will return 0. Otherwise, it will return the value of failover_priority, defaulting to 1 if it’s not defined or invalid. +

property _nofailover: bool_

Common logic for obtaining the value of nofailover from tags if defined.
If nofailover is not defined, this methods returns True if failover_priority is non-positive, False otherwise. +

property _noloadbalance: bool_

True if noloadbalance is True, else False. +

property _nosync: bool_

True if nosync is True, else False. +

property _replicatefrom: str | None_

Value of replicatefrom tag, if any. +

abstract property _tags: Dict[ str, Any]_

Configured tags. + Must be implemented in a child class.


© Copyright 2015 Compose, Zalando SE. Revision 3d527f57.

Built with Sphinx using a theme provided by Read the Docs.

Read the Docs v: master