API with Wired Assurance

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:

  1. Network Templates:
    Documentation is located just below RF Templates here: https://api.mist.com/api/v1/docs/Org#rf-template

    1. Create Network Template
      1. POST: https://api.mist.com/api/v1/orgs/:org_id/networktemplates
      2. Payload: JSON Formatted Payload
      3. Required: name
    2. Get List of Network Templates:
      1. GET: /api/v1/orgs/:org_id/networktemplates
      2. Payload: None
      3. Filters: id, name
    3. Get Network Template:
      1. GET: /api/v1/orgs/:org_id/networktemplates/:networktemplate_id
      2. Payload: None
    4. Update Network Template:
      1. PUT: /api/v1/orgs/:org_id/networktemplates/:networktemplate_id
      2. Payload: JSON Formatted Payload (only changes/additions needed)
    5. Delete Network Template:
      1. DELETE: /api/v1/orgs/:org_id/networktemplates/:networktemplate_id
      2. Payload: None
  2. Site Settings:

    Documentation is located here: https://api.mist.com/api/v1/docs/Site#site-setting

    1. Get Site Settings:
      *Includes both switching and non-switching related settings*

      1. GET: /api/v1/sites/:site_id/setting
      2. Payload: None
    2. Update Site Settings:
      1. PUT: /api/v1/sites/:site_id/setting
      2. Payload: JSON Formatted Payload (only changes/additions needed)
      3. To link this site to a template, add the “networktemplate_id” key with the value of the ID for the network template to apply.
    3. 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.
  3. Switch Settings:

    Documentation is located here: https://api.mist.com/api/v1/docs/Site#device

    1. Get Switch Settings:
      1. GET: /api/v1/sites/:site_id/devices/:device_id
      2. Payload: None
    2. Update Switch Settings:
      1. PUT: /api/v1/sites/:site_id/devices/:device_id
      2. Payload: JSON Formatted Payload (only changes/additions needed)
    3. Reset Switch Settings:
      1. POST: /api/v1/sites/:site_id/devices/:device_id
      2. Payload: None or JSON
      3. 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.
      4. 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.
    4. 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.

      1. GET: /api/v1/sites/:site_id/devices/:device_id/config_cmd
      2. Payload: None
      3. Super useful in both brownfield deployments as well as learning and testing EX in Mist.

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.