{# SPDX-License-Identifier: Apache-2.0 #} {# Copyright (C) 2025 Marcin Zieba #} {% extends 'base/layout.html' %} {% load helpers %} {% block title %}NSO Devices{% endblock %} {% block content %}
Instance: {{ data.instance }} {% if instances|length > 1 %} {% for inst in instances %} {{ inst.name }} {% endfor %} {% endif %} Platform → NED mappings
{% if data.error %}
Adapter error: {{ data.error }}
{% endif %}
{# ── Managed: plugin-managed devices (NSODeviceManagement) ───────────────── #}
{% for m in managed %} {% empty %} {% endfor %}
DeviceNSO nameNEDScopesLast syncStatus
{{ m.device }} {{ m.nso_device_name }} {{ m.ned_in_use|placeholder }} {% if m.manage_description %}desc{% endif %} {% if m.manage_enabled %}enabled{% endif %} {% if m.auto_apply %}auto-apply{% endif %} {{ m.last_sync_at|placeholder }} {% if m.onboard_status == 'provisioning' %} Provisioning… {% elif m.onboard_status == 'provision_failed' %} Provisioning failed {# A broken link outranks last_sync_status — that status records an EARLIER sync. #} {% elif m.adapter_link_error %} Adapter link failed {% elif m.last_sync_status == "succeeded" %}succeeded {% elif m.last_sync_status == "failed" %}failed {% elif m.last_sync_status == "partial" %}partial{% if m.degraded_surfaces %} ({{ m.degraded_surfaces|length }}){% endif %} {% elif m.last_sync_status %}{{ m.last_sync_status }}{% else %}{{ ''|placeholder }}{% endif %} NSO tab
No managed devices on this instance.
{# ── Onboarded in NSO (matched to NetBox) ────────────────────────────────── #}
{% for o in data.onboarded %} {% empty %} {% endfor %}
NSO deviceNetBoxNEDAdmin stateMatched by
{{ o.nso_name }}{% if not o.plugin_managed %} external{% endif %} {% if o.netbox_device %}{{ o.netbox_device }}{% else %}{{ ''|placeholder }}{% endif %} {{ o.ned_id|placeholder }} {{ o.admin_state|placeholder }} {{ o.matched_by|default:"—" }} {% if not o.plugin_managed and o.netbox_device %}
{% csrf_token %}
{% endif %}
None.
{# ── Onboardable candidates ──────────────────────────────────────────────── #}

NetBox devices that are active and have a management IP (primary, or OOB for a freshly-deployed box), not yet in NSO. The platform’s NED mapping is the default — pick a different NED to override (software version / testing).

{% for c in data.candidates %} {% empty %} {% endfor %}
DevicePlatformAddressNED
{{ c.device }} {{ c.platform|placeholder }} {{ c.mgmt_ip }} {% if c.oob_only %}OOB{% endif %}
{% csrf_token %} {% if data.neds %} {% else %} {% endif %}
None — no active devices with a management IP that aren’t already in NSO.
{# ── Unmatched in NetBox (NSO orphans) ───────────────────────────────────── #}

Devices in NSO with no matching NetBox device (by name or primary IP).

{% for r in data.orphans %} {% empty %} {% endfor %}
NSO deviceAddressNED
{{ r.nso_name }} {{ r.address|placeholder }} {{ r.ned_id|placeholder }}
None.
{# ── Live-poll provisioning rows: advance the async onboarding job, reload on terminal ── #} {% endblock %}