Wired Network Automation and Integration
Domain overview
Wired Network Automation and Integration tests how you extend Mist beyond the UI: REST API, API tokens, webhooks, Terraform, and integrations. The focus is repeatable provisioning and event-driven operations, not ad hoc CLI scripting.
Core rules
- The Mist API is REST/JSON. Use an organization-scoped or site-scoped API token with least privilege; tokens are sent in the Authorization header.
- Common automation objects are orgs, sites, devices, templates, and site variables. A typical flow creates a site, assigns a template, claims devices, and applies settings.
- Webhooks push events such as alarms, audits, device up/down, and client events to an HTTPS endpoint; verify the shared secret and handle retries idempotently.
- Terraform's Mist provider is suited to declarative org/site and template management; API scripts are better for one-off bulk actions.
- Integrations such as ServiceNow, Slack, or Teams consume Mist alarms and webhooks; keep the integration scope aligned to the site or org.
Worked example
A new branch needs a site, a switch template assignment, and alarm notifications. A script calls POST /api/v1/orgs/{org_id}/sites with the site name and timezone, stores the returned site ID, assigns the branch template via the site settings, claims the switch by MAC, and registers a webhook for alarms. On retry, the script checks whether the site already exists before creating it. Without that check, a retry creates a duplicate site, and the switch assignment becomes ambiguous.
Traps
Do not hard-code org IDs or tokens in scripts. Do not use an org token where a site token is enough. Do not assume a webhook was delivered; log the response and reconcile. Do not let Terraform and manual UI edits manage the same object.