Models¶
The Models resource (client.models) reads model configuration, current alert
state, and the action history for models attached to assets.
Listing models¶
One model with everything attached¶
get_model takes a model ID (or a Model you already have) and can
fetch its configuration, alert state, and recent actions in one call.
if model.config:
print("Active:", model.config.active)
if model.alert_state:
print("Alerts:", ", ".join(model.alert_state.active_alerts))
if model.actions:
for action in model.actions:
print(action.change_date, action.action_type, action.action_note)
State and actions across an asset¶
To check many models at once, query by asset instead of model by model:
get_model_actions_by_asset works the same way for
action history.