The API provides the same functionality as the UI, but through a programmable interface. There are primarily 3 main URI endpoints of interest with respect to Wired Assurance.
API Endpoints:
- Network Templates:
Documentation is located just below RF Templates here: https://api.mist.com/api/v1/docs/Org#rf-template- Create Network Template
- POST: https://api.mist.com/api/v1/orgs/:org_id/networktemplates
- Payload: JSON Formatted Payload
- Required: name
- Get List of Network Templates:
- GET: /api/v1/orgs/:org_id/networktemplates
- Payload: None
- Filters: id, name
- Get Network Template:
- GET: /api/v1/orgs/:org_id/networktemplates/:networktemplate_id
- Payload: None
- Update Network Template:
- PUT: /api/v1/orgs/:org_id/networktemplates/:networktemplate_id
- Payload: JSON Formatted Payload (only changes/additions needed)
- Delete Network Template:
- DELETE: /api/v1/orgs/:org_id/networktemplates/:networktemplate_id
- Payload: None
- Create Network Template
- Site Settings:
Documentation is located here: https://api.mist.com/api/v1/docs/Site#site-setting- Get Site Settings:
*Includes both switching and non-switching related settings*- GET: /api/v1/sites/:site_id/setting
- Payload: None
- Update Site Settings:
- PUT: /api/v1/sites/:site_id/setting
- Payload: JSON Formatted Payload (only changes/additions needed)
- To link this site to a template, add the “networktemplate_id” key with the value of the ID for the network template to apply.
- Note: There is no POST or DELETE for site settings. The only way to create site settings is to create a new site, and the only current way to delete them is to delete the site.
- Get Site Settings:
- Switch Settings:
Documentation is located here: https://api.mist.com/api/v1/docs/Site#device- Get Switch Settings:
- GET: /api/v1/sites/:site_id/devices/:device_id
- Payload: None
- Update Switch Settings:
- PUT: /api/v1/sites/:site_id/devices/:device_id
- Payload: JSON Formatted Payload (only changes/additions needed)
- Reset Switch Settings:
- POST: /api/v1/sites/:site_id/devices/:device_id
- Payload: None or JSON
- This effectively deletes the configuration defined at the switch settings and replaces it with either nothing, or whatever is passed in the payload. Great for if you messed up and need to reset the settings before reconfiguring.
- NOTE: This is currently missing from the API documentation. We are currently working to get it re-added. You can find it in the django API browser.
- Get Switch Config Commands:
This returns the config set commands that Mist will push to the switch. Note, this does not include the basic connectivity (brownfield config snippet, or greenfield config), just the settings that are pushed via the Template/Site/Switch configuration from Mist.- GET: /api/v1/sites/:site_id/devices/:device_id/config_cmd
- Payload: None
- Super useful in both brownfield deployments as well as learning and testing EX in Mist.
- Get Switch Settings:
API Use Cases:
Source of Truth
As network operations continues to evolve, the Source of Truth (SoT) is becoming a more important construct. These SoTs allow us to describe how the network should be configured in an external software application and have that SoT talk directly with Mist to configure.
The source of truth can be something as simple as a set of YAML or JSON datafiles or as sophisticated as dedicated applications such as Netbox or NSOT. Configuring sites and switches via the API based on data in the SoT provides a level of control and can keep configuration consistent across sites and devices.
Service Oriented Configuration
Change management is a large part of network operations. Manual changes are both error prone and time consuming. Integration of change management into ITSM platforms like ServiceNow helps simplify common change management requests by letting changes flow through proper change management processes as well as reduce the human error of making the changes. The API for Wired Assurance enables these integrations between ITSM platforms and the wired network configuration.
Continuing Efforts
While the API gives us some immediate opportunities to programmatically configure EX Switching, work is already progressing for additional functionality. For example, automating the migration Cisco IOS configurations as well as the automated migration of existing Juniper EX configs to the Mist platform using existing software libraries and opensource tools.