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. + NoteDue to backward-compatibility reasons, old tags may have a less strict type conversion than new ones. + _abc_impl_ = <_abc._abc_data object>_link:#patroni.tags.Tags._abc_impl[];; + _static \\__filter_tags(_tags: https://docs.python.org/3/library/typing.html#typing.Dict[Dict][ https://docs.python.org/3/library/stdtypes.html#str[str], https://docs.python.org/3/library/typing.html#typing.Any[Any]]_) → https://docs.python.org/3/library/typing.html#typing.Dict[Dict][ https://docs.python.org/3/library/stdtypes.html#str[str], https://docs.python.org/3/library/typing.html#typing.Any[Any]] https://github.com/zalando/patroni/blob/9d231aeecdd69f4d06c75a702755fa70d8c2b5f6/patroni/tags.py#L18-L39[View on GitHub]link:#patroni.tags.Tags._filter_tags[];; 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+`,``nosync`` or `+nostream+`.
For most of 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. However `+nofailover+` tag is always returned if `+failover_priority+` tag is defined. In this case, we need both values to see if they are contradictory and the `+nofailover+` value should be used. + 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_: https://docs.python.org/3/library/functions.html#bool[bool]_link:#patroni.tags.Tags.clonefrom[];; `+True+` if `+clonefrom+` tag is `+True+`, else `+False+`. + _property _failover_priority_: https://docs.python.org/3/library/functions.html#int[int]_link:#patroni.tags.Tags.failover_priority[];; 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_: https://docs.python.org/3/library/functions.html#bool[bool]_link:#patroni.tags.Tags.nofailover[];; 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_: https://docs.python.org/3/library/functions.html#bool[bool]_link:#patroni.tags.Tags.noloadbalance[];; `+True+` if `+noloadbalance+` is `+True+`, else `+False+`. + _property _nostream_: https://docs.python.org/3/library/functions.html#bool[bool]_link:#patroni.tags.Tags.nostream[];; `+True+` if `+nostream+` is `+True+`, else `+False+`. + _property _nosync_: https://docs.python.org/3/library/functions.html#bool[bool]_link:#patroni.tags.Tags.nosync[];; `+True+` if `+nosync+` is `+True+`, else `+False+`. + _property _replicatefrom_: https://docs.python.org/3/library/stdtypes.html#str[str] | https://docs.python.org/3/library/constants.html#None[None]_link:#patroni.tags.Tags.replicatefrom[];; Value of `+replicatefrom+` tag, if any. + _abstract property _tags_: https://docs.python.org/3/library/typing.html#typing.Dict[Dict][ https://docs.python.org/3/library/stdtypes.html#str[str], https://docs.python.org/3/library/typing.html#typing.Any[Any]]_link:#patroni.tags.Tags.tags[];; Configured tags. + Must be implemented in a child class.
© Copyright 2015 Compose, Zalando SE. Revision 9d231aee
.
Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
+ Builds