Navigation : Citus support Contributing Contributing guidelines Convert a Standalone to a Patroni Cluster DCS Failsafe Mode Dynamic Configuration Settings Environment Configuration Settings FAQ HA multi datacenter Installation Integration with other tools Modules - patroni - patroni package - patroni.api module - patroni.async_executor module - patroni.collections module - patroni.config module - patroni.config_generator module - patroni.ctl module - patroni.daemon module - patroni.dcs package - patroni.dcs.consul module - patroni.dcs.etcd module - patroni.dcs.etcd3 module - patroni.dcs.exhibitor module - patroni.dcs.kubernetes module - patroni.dcs.raft module - patroni.dcs.zookeeper module - patroni.dynamic_loader module - patroni.exceptions module - patroni.file_perm module - patroni.global_config module - patroni.ha module - patroni.log module - patroni.postgresql package - patroni.postgresql.available_parameters package - patroni.postgresql.bootstrap module - patroni.postgresql.callback_executor module - patroni.postgresql.cancellable module - patroni.postgresql.config module - patroni.postgresql.connection module - patroni.postgresql.misc module - patroni.postgresql.mpp package - patroni.postgresql.mpp.citus module - patroni.postgresql.postmaster module - patroni.postgresql.rewind module - patroni.postgresql.slots module - patroni.postgresql.sync module - patroni.postgresql.validator module - patroni.psycopg module - patroni.quorum module - patroni.raft_controller module - patroni.request module - patroni.scripts package - patroni.scripts.aws module - patroni.scripts.barman package - patroni.scripts.barman.cli module - patroni.scripts.barman.config_switch module - patroni.scripts.barman.recover module - patroni.scripts.barman.utils module - patroni.scripts.wale_restore module - patroni.tags module - patroni.utils module - patroni.validator module - patroni.version module - patroni.watchdog package - patroni.watchdog.base module - patroni.watchdog.linux module Patroni REST API Patroni configuration Pause/Resume mode for the cluster Python Module Index Release notes Replica imaging and bootstrap Replication modes Security Considerations Standby cluster Using Patroni with Kubernetes Watchdog support YAML Configuration Settings patronictl Introduction > Modules > patroni.request module patroni.request module Facilities for handling communication with Patroni’s REST API. class patroni.request. HTTPSConnectionPool ( host , port=None , strict=False , timeout= object> , maxsize=1 , block=False , headers=None , retries=None , _proxy=None , _proxy_headers=None , key_file=None , cert_file=None , cert_reqs=None , key_password=None , ca_certs=None , ssl_version=None , assert_hostname=None , assert_fingerprint=None , ca_cert_dir=None , **conn_kw ) View on GitHub Bases: HTTPSConnectionPool _validate_conn ( * args : Any , ** kwargs : Any ) → None View on GitHub Override parent method to silence warnings about requests without certificate verification enabled. class patroni.request. PatroniPoolManager ( * args : Any , ** kwargs : Any ) View on GitHub Bases: PoolManager __init__ ( * args : Any , ** kwargs : Any ) → None View on GitHub class patroni.request. PatroniRequest ( config : Config | Dict [ str , Any ] , insecure : bool | None = None ) View on GitHub Bases: object Wrapper for performing requests to Patroni’s REST API. Prepares the request manager with the configured settings before performing the request. __init__ ( config : Config | Dict [ str , Any ] , insecure : bool | None = None ) → None View on GitHub Create a new PatroniRequest instance with given config . Parameters : config – Patroni YAML configuration. insecure – how to deal with SSL certs verification: If True it will perform REST API requests without verifying SSL certs; or If False it will perform REST API requests and verify SSL certs; or If None it will behave according to the value of ctl.insecure configuration; or If none of the above applies, then it falls back to False . _apply_pool_param ( param : str , value : Any ) → None View on GitHub Configure param as value in the request manager. Parameters : param – name of the setting to be changed. value – new value for param . If None , 0 , False , and similar values, then explicit param declaration is removed, in which case it takes its default value, if any. _apply_ssl_file_param ( config : Config | Dict [ str , Any ] , name : str ) → str | None View on GitHub Apply a given SSL related param to the request manager. Parameters : config – Patroni YAML configuration. name – prefix of the Patroni SSL related setting name. Currently, supports these: cert : gets translated to certfile key : gets translated to keyfile Will attempt to fetch the requested key first from ctl section. Returns : value of ctl.*name*file if present, None otherwise. static _get_ctl_value ( config : Config | Dict [ str , Any ] , name : str , default : Any | None = None ) → Any | None View on GitHub Get value of name setting from the ctl section of the config . Parameters : config – Patroni YAML configuration. name – name of the setting value to be retrieved. Returns : value of ctl.*name* if present, None otherwise. static _get_restapi_value ( config : Config | Dict [ str , Any ] , name : str ) → Any | None View on GitHub Get value of name setting from the restapi section of the config . Parameters : config – Patroni YAML configuration. name – name of the setting value to be retrieved. Returns : value of restapi -> *name* if present, None otherwise. reload_config ( config : Config | Dict [ str , Any ] ) → None View on GitHub Apply config to request manager. Configure these HTTP headers for requests: authorization : based on Patroni’ CTL or REST API authentication config; user-agent : based on patroni.utils.USER_AGENT . Also configure SSL related settings for requests: ca_certs is configured if ctl.cacert or restapi.cafile is available; cert , key and key_password are configured if ctl.certfile is available. Parameters : config – Patroni YAML configuration. request ( method : str , url : str , body : Any | None = None , ** kwargs : Any ) → HTTPResponse View on GitHub Perform an HTTP request. Parameters : method – the HTTP method to be used, e.g. GET . url – the URL to be requested. body – anything to be used as the request body. kwargs – keyword arguments to be passed to urllib3.PoolManager.request() . Returns : the response returned upon request. patroni.request. get ( url : str , verify : bool = True , ** kwargs : Any ) → HTTPResponse View on GitHub Perform an HTTP GET request. Note It uses PatroniRequest so all relevant configuration is applied before processing the request. Parameters : url – full URL for this GET request. verify – if it should verify SSL certificates when processing the request. Returns : the response returned from the request. © Copyright 2015 Compose, Zalando SE patroni.raft_controller module patroni.scripts package