INNER CODE UNIT · Python
override
scality/Zenko · monitoring/kafka-connect/kafka-connect.dashboard.py:330
def override(name: str, color: str = None, displayName: str = None, unit: str = None,
hidden: bool = False, thresholds: dict = [], mappings: dict = []) -> dict:
properties = []
if color:
properties += [{"id": "color", "value": {"fixedColor": color, "mode": "fixed"}}]
if displayName:
properties += [{"id": "displayName", "value": displayName}]
if unit:
properties += [{"id": "unit", "value": unit}]
if hidden:
properties += [{"id": "custom.hidden", "value": hidden}]
if thresholds:
properties += [{"id": "thresholds", "value": {
"mode": "absolute",
"steps": [
{"color": value, "value": key} for key, value in thresholds.items()
]
}}]