| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/saltstack/salt/lib/python3.10/site-packages/salt/proxy/ |
Upload File : |
"""
Chronos
========
Proxy minion for managing a Chronos cluster.
Dependencies
------------
- :mod:`chronos execution module (salt.modules.chronos) <salt.modules.chronos>`
Pillar
------
The chronos proxy configuration requires a 'base_url' property that points to
the chronos endpoint:
.. code-block:: yaml
proxy:
proxytype: chronos
base_url: http://my-chronos-master.mydomain.com:4400
.. versionadded:: 2015.8.2
"""
import logging
import salt.utils.http
__proxyenabled__ = ["chronos"]
CONFIG = {}
CONFIG_BASE_URL = "base_url"
log = logging.getLogger(__file__)
def __virtual__():
return True
def init(opts):
"""
Perform any needed setup.
"""
if CONFIG_BASE_URL in opts["proxy"]:
CONFIG[CONFIG_BASE_URL] = opts["proxy"][CONFIG_BASE_URL]
else:
log.error("missing proxy property %s", CONFIG_BASE_URL)
log.debug("CONFIG: %s", CONFIG)
def ping():
"""
Is the chronos api responding?
"""
try:
response = salt.utils.http.query(
f"{CONFIG[CONFIG_BASE_URL]}/scheduler/jobs",
decode_type="json",
decode=True,
)
log.debug(
"chronos.info returned successfully: %s",
response,
)
if "dict" in response:
return True
except Exception as ex: # pylint: disable=broad-except
log.error(
"error pinging chronos with base_url %s: %s",
CONFIG[CONFIG_BASE_URL],
ex,
)
return False
def shutdown(opts):
"""
For this proxy shutdown is a no-op
"""
log.debug("chronos proxy shutdown() called...")