patroni.tags module
Tags handling.
- _class _patroni.tags.Tags View on GitHub
-
Bases:
ABC
+ An abstract class that encapsulates all thetags
logic. + Child classes that want to use provided facilities must implementtags
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
ifclonefrom
tag isTrue
, elseFalse
. + - property _failover_priority: int_
-
Common logic for obtaining the value of
failover_priority
fromtags
if defined.
Ifnofailover
is defined asTrue
, this will return0
. Otherwise, it will return the value offailover_priority
, defaulting to1
if it’s not defined or invalid. + - property _nofailover: bool_
-
Common logic for obtaining the value of
nofailover
fromtags
if defined.
Ifnofailover
is not defined, this methods returnsTrue
iffailover_priority
is non-positive,False
otherwise. + - property _noloadbalance: bool_
-
True
ifnoloadbalance
isTrue
, elseFalse
. + - property _nosync: bool_
-
True
ifnosync
isTrue
, elseFalse
. + - 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