# Technical Information (/docs/integrations/hpe-mist/hpe-mist-tech-info)



## HPE Juniper Networking Mist to NetBox Object Mapping [#hpe-mist-to-netbox-object-mapping]

## Object Type Mapping Table [#object-type-mapping-table]

| **Mist Object**                 | **NetBox Object** | **Key Attributes**                                                                                                                                                                                                                                                  |
| ------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Site`                          | `Site`            | `name`, `slug`, `time_zone`, `custom_fields.mist_id`, `custom_fields.mist_org_id`                                                                                                                                                                                   |
| *(unassigned devices)*          | `Site`            | `name` "Unassigned Mist Inventory"                                                                                                                                                                                                                                  |
| `Inventory device` (standalone) | `Device`          | `name` (or `serial`), `serial`, `status`, `role`, `device_type`, `platform`, `site`, `custom_fields.mist_mac`, `custom_fields.mist_device_status`, `custom_fields.mist_device_id`                                                                                   |
| `Inventory device` (VC member)  | `Device`          | `vc_name`+`fpc_idx` → `name`, member `serial`, `device_type`, `platform`, `virtual_chassis`, `vc_position`, `custom_fields.mist_mac`, `custom_fields.mist_vc_mac`, `custom_fields.mist_vc_role`, `custom_fields.mist_device_status`, `custom_fields.mist_device_id` |
| `vc_mac` (switch stack)         | `VirtualChassis`  | `name`                                                                                                                                                                                                                                                              |
| Device `model`                  | `DeviceType`      | `model`, `slug`, `custom_fields.mist_type`                                                                                                                                                                                                                          |
| Device `type`                   | `DeviceRole`      | `name`, `slug` (e.g. "ap", "switch", "gateway")                                                                                                                                                                                                                     |
| Device `version`                | `Platform`        | `name` "Junos \{version}", manufacturer "Juniper"                                                                                                                                                                                                                   |
| *(static)*                      | `Manufacturer`    | `name` "Juniper"                                                                                                                                                                                                                                                    |
| Org network template            | `VLANGroup`       | `name` "\{site} VLANs", `slug`, `scope_site`                                                                                                                                                                                                                        |
| Template network VLAN           | `VLAN`            | `name`, `vid`, `status` "active", `group`                                                                                                                                                                                                                           |
| `WLAN`                          | `WirelessLAN`     | `ssid`, `status`, `auth_type`, `auth_cipher`, `scope_site`, `custom_fields.mist_wlan_id`, `custom_fields.mist_ap_ids`, `custom_fields.mist_ap_scope`, `custom_fields.mist_wxtag_ids`, `custom_fields.mist_ap_mac_addresses_serving_this`                            |
| Device stats interface          | `Interface`       | `name`, `enabled`, `type`, `custom_fields.mist_interface_port_id`                                                                                                                                                                                                   |
| Interface IP from device stats  | `IPAddress`       | `address` (CIDR), `status` "active", `assigned_object`                                                                                                                                                                                                              |
| Interface port MAC from stats   | `MACAddress`      | `mac_address` (uppercase)                                                                                                                                                                                                                                           |
| *(per-site, when IP conflict)*  | `VRF`             | `name` "mist-site-\{site.name}"                                                                                                                                                                                                                                     |

## Field Mapping Details [#field-mapping-details]

### Device Status Mapping [#device-status-mapping]

| **Mist Connection Status**                | **NetBox Status** |
| ----------------------------------------- | ----------------- |
| Missing or invalid `site_id` (unassigned) | `inventory`       |
| `true` (connected)                        | `active`          |
| `false` (disconnected)                    | `offline`         |

### Wireless LAN Status Mapping [#wireless-lan-status-mapping]

| **Mist WLAN Status** | **NetBox Status** |
| -------------------- | ----------------- |
| `true` (enabled)     | `active`          |
| `false` (disabled)   | `disabled`        |

### Authentication Type Mapping [#authentication-type-mapping]

| **Mist Auth Type** | **NetBox Auth Type** |
| ------------------ | -------------------- |
| `open`             | `open`               |
| `psk`              | `wpa-personal`       |
| `psk-tkip`         | `wpa-personal`       |
| `psk-wpa2-tkip`    | `wpa-personal`       |
| `eap`              | `wpa-enterprise`     |
| `eap192`           | `wpa-enterprise`     |
| `wep`              | `wep`                |
| Any other value    | `Unknown`            |

### Authentication Cipher Mapping [#authentication-cipher-mapping]

| **Mist Auth Type**            | **Mist Pairwise Ciphers** | **NetBox Auth Cipher** |
| ----------------------------- | ------------------------- | ---------------------- |
| `eap192`                      | Any                       | `aes`                  |
| `psk-tkip` \| `psk-wpa2-tkip` | Any                       | `tkip`                 |
| `wep`                         | Any                       | `auto`                 |
| `open`                        | Any                       | `None`                 |
| `psk` \| `eap`                | Contains "tkip"           | `tkip`                 |
| `psk` \| `eap`                | Contains "ccmp" or "wpa3" | `aes`                  |
| `psk` \| `eap`                | No recognized cipher      | `None`                 |
| Unknown auth\_type            | -                         | Integration raises     |

Cipher uses Mist `auth.pairwise` list (e.g. `wpa2-ccmp`, `wpa2-tkip`, `wpa3`).

### Interface Type Heuristics [#interface-type-heuristics]

| **Interface Name Pattern** | **NetBox Type** |
| -------------------------- | --------------- |
| `ge-*`                     | `1000base-t`    |
| `vme*` or `VLAN*`          | `virtual`       |
| Other                      | `other`         |

### Site Assignment Logic [#site-assignment-logic]

1. **Allowed sites**: From policy scope `sites` (list of site names). `["*"]` or empty means all sites.
2. **Valid site**: Device `site_id` present in allowed site IDs → assign to that NetBox site.
3. **Unassigned fallback**: Missing or invalid `site_id` (e.g. `00000000-0000-0000-0000-000000000000`) or site not in allowed list → assign to "Unassigned Mist Inventory" site.
4. **Inventory filtering**: Only devices in allowed sites (or unassigned) are ingested; same for `devices/search` when building device–WLAN mapping.

### WLAN Scope and Custom Fields [#wlan-scope-and-custom-fields]

WLANs are always scoped to a site (`scope_site`). Mist scope is stored in custom fields:

| **Mist apply\_to** | **Custom Field Usage**        |
| ------------------ | ----------------------------- |
| `site`             | Standard site scope           |
| `wxtags`           | `mist_wxtag_ids` (JSON array) |
| `aps`              | `mist_ap_ids` (JSON array)    |
| `None`             | Site scope                    |

### Virtual Chassis Detection [#virtual-chassis-detection]

* **Condition**: `type == "switch"`, a `vc_mac` is present, and either `vc_mac` starts with `0200` (a preprovisioned Virtual Chassis) or `chassis_mac` differs from `mac` (a non-preprovisioned Virtual Chassis). See [Known Limitations](#known-limitations).
* **VirtualChassis**: One per unique `vc_mac`; name from device `name`.
* **Member devices**: Built from `module_stat` in the device stats; member name `\{vc_name\}-member-\{fpc_idx\}`; master by `vc_role='master'` or lowest `fpc_idx`.

### Device–WLAN Matching [#devicewlan-matching]

* **Source**: `devices/search` (type=ap, duration=1h) gives per-device `wlans[]` (id, ssid).
* **Uniqueness**: WLANs keyed by `(wlan_id, site_id, ssid)`; only WLANs present in `listSiteWlansDerived` for that site are used.
* **Device custom field**: `mist_wlans_served` (object, multiple) references the WirelessLAN entities the device serves.
* **WLAN custom field**: `mist_ap_mac_addresses_serving_this` (JSON array of AP MAC addresses) populated after matching.

## Custom Fields [#custom-fields]

| **Custom Field**                     | **Object Type** | **Purpose**                                                                                                               |
| ------------------------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `mist_id`                            | Site            | Mist site ID                                                                                                              |
| `mist_org_id`                        | Site            | Mist organization ID                                                                                                      |
| `mist_type`                          | Device Type     | Mist device type (ap, switch, etc.)                                                                                       |
| `mist_mac`                           | Device          | Mist device MAC                                                                                                           |
| `mist_vc_mac`                        | Device          | Virtual Chassis MAC (VC members only)                                                                                     |
| `mist_vc_role`                       | Device          | VC role: master, backup, or empty (VC members only)                                                                       |
| `mist_device_id`                     | Device          | Mist device ID                                                                                                            |
| `mist_device_status`                 | Device          | Original Mist status: `connected`, `disconnected`, or `unassigned`                                                        |
| `mist_wlans_served`                  | Device          | JSON array of WLANs served by this device, each with `ssid` and `wlan_id`                                                 |
| `mist_wlan_id`                       | Wireless LAN    | Mist WLAN ID                                                                                                              |
| `mist_ap_ids`                        | Wireless LAN    | JSON array of AP IDs                                                                                                      |
| `mist_ap_scope`                      | Wireless LAN    | apply\_to (site, wxtags, aps)                                                                                             |
| `mist_wxtag_ids`                     | Wireless LAN    | JSON array of WxTag IDs when apply\_to=wxtags                                                                             |
| `mist_ap_mac_addresses_serving_this` | Wireless LAN    | JSON array of AP MAC addresses serving this WLAN                                                                          |
| `mist_interface_port_id`             | Interface       | Mist port ID for the interface                                                                                            |
| `mist_ha_cluster`                    | Device          | Shared Mist gateway identifier linking the two nodes of an HA pair. Both nodes carry the same value                       |
| `mist_port_profile`                  | Interface       | Port profile the port runs, as Mist device stats report it                                                                |
| `mist_network_template_name`         | Site            | Name of the Network Template that Mist assigns to the site                                                                |
| `mist_device_local_context`          | Device          | JSON. Only when `MIST_SYNC_DEVICE_LOCAL_CONTEXT` is true. See [Local context custom fields](#local-context-custom-fields) |
| `mist_site_local_context`            | Site            | JSON. Only when `MIST_SYNC_SITE_LOCAL_CONTEXT` is true. See [Local context custom fields](#local-context-custom-fields)   |

## Policy Configuration [#policy-configuration]

* **BOOTSTRAP** (optional): When true, only static entities (custom fields, manufacturer) are created; no Mist API calls.
* **MIST\_APITOKEN** (required when not BOOTSTRAP): Mist API token.
* **MIST\_ORG\_ID** (required when not BOOTSTRAP): Mist organization ID.
* **MIST\_ENVIRONMENT** (optional): Mist cloud environment. Defaults to `"Global 01"` (`api.mist.com`). Each Mist organization is hosted in a specific cloud environment - if not specified, `Global 01` is used. See [Mist API Environments](https://www.juniper.net/documentation/us/en/software/mist/automation-integration/topics/topic-map/api-endpoint-url-global-regions.html) to identify which environment your organization uses.

  | Environment | API Host         |
  | ----------- | ---------------- |
  | Global 01   | api.mist.com     |
  | Global 02   | api.gc1.mist.com |
  | Global 03   | api.ac2.mist.com |
  | Global 04   | api.gc2.mist.com |
  | Global 05   | api.gc4.mist.com |
  | EMEA 01     | api.eu.mist.com  |
  | EMEA 02     | api.gc3.mist.com |
  | EMEA 03     | api.ac6.mist.com |
  | EMEA 04     | api.gc6.mist.com |
  | APAC 01     | api.ac5.mist.com |
  | APAC 03     | api.gc7.mist.com |
* **MIST\_SYNC\_DEVICE\_LOCAL\_CONTEXT** (optional, default `false`): When true, sets the `mist_device_local_context` custom field on devices. Adds one API call per site to each run.
* **MIST\_SYNC\_SITE\_LOCAL\_CONTEXT** (optional, default `false`): When true, sets the `mist_site_local_context` custom field on sites.
* **MIST\_SITE\_SETTING\_KEYS\_SITE\_LOCAL\_CONTEXT** (optional): The site settings to copy into `mist_site_local_context`, as a list or a comma-separated string. Applies only when `MIST_SYNC_SITE_LOCAL_CONTEXT` is true. An entry that is not a non-empty string, or is `network_template`, is skipped with an error in the log. A key that no site in scope has is logged as a warning.
* **Scope – sites** (optional): List of site names to include; default `["*"]` for all sites. Invalid or missing names cause validation to fail after fetching sites.

### Local context custom fields [#local-context-custom-fields]

The two local context custom fields are opt-in, and are created only when their key is true. Set the keys in the bootstrap policy too, so that Bootstrap mode creates the fields.

* **`mist_device_local_context`** holds the device's own settings in Mist (`name`, `additional_config_cmds`, `ip_config`, `port_config`, `port_config_overwrite`, `port_usages`), its observed gateway, and its claim code. An AP also gets its `ap_group`, a switch its Network Template and device profile, and a gateway its gateway template and hub profile. Empty values are left out.
* **`mist_site_local_context`** holds the site's Network Template, without `created_time`, `modified_time`, or `org_id`, plus each site setting named in `MIST_SITE_SETTING_KEYS_SITE_LOCAL_CONTEXT`. Any variable under `vars` whose name contains `credential`, `key`, `pass`, `psk`, `pwd`, `secret`, or `token` is left out.

These fields copy claim codes and CLI lines as Mist returns them. Any NetBox user who can view the device or site can read them.

## Tags and Metadata [#tags-and-metadata]

All created entities are tagged with:

* `juniper`
* `mist`
* `discovered`

Optional unique tag: `mist-\{org_id\}` when not in bootstrap mode.

## API and Behavior Notes [#api-and-behavior-notes]

* **APIs used**: `listOrgSites`, `getOrgInventory`, `listOrgNetworkTemplates`, `listOrgDevicesStats`, `searchOrgSwOrGwPorts` (or, when `scope.sites` names sites, `listOrgDevicesStats` filtered by site and `searchSiteSwOrGwPorts` per site), `searchOrgDevices` (type=ap), `listSiteWlansDerived`. With `MIST_SYNC_DEVICE_LOCAL_CONTEXT`, also `listSiteDevices` (one call per site), `listOrgDeviceProfiles`, and `listOrgGatewayTemplates`. With `MIST_SYNC_SITE_LOCAL_CONTEXT` and site setting keys, also `getSiteSetting` (one call per site).
* **Rate limiting**: Custom retry (e.g. `MistCustomRetry`) for 429, 5xx with `Retry-After` support.
* **Device naming**: Standalone: `name` or `serial` or "Unnamed". VC members: `\{vc_name\}-member-\{fpc_idx\}`.
* **WLAN uniqueness**: Deduplicated by (wlan\_id, site\_id, ssid). WLANs with no serving devices are still created from site-derived WLANs.
* **Interfaces**: Only devices with a valid `site_id` (and in allowed sites) have stats fetched; unassigned devices do not get interfaces or IPs from this integration.

## Known Limitations [#known-limitations]

* **Some non-preprovisioned Virtual Chassis are not detected.** A non-preprovisioned Virtual Chassis is detected when Mist reports a `chassis_mac` that differs from the switch's `mac`. When the two are equal, which happens when Mist took the device ID from the first member, or when Mist reports no `chassis_mac`, the Virtual Chassis is ingested as a single standalone device carrying one member's serial number and MAC address, and no warning is reported. When Mist reports no `module_stat` for a detected Virtual Chassis, the VirtualChassis is created without member devices, and a warning is logged.
