Skip to content

v1.3 Release Notes

Overview

v1.3 adds structured output parsing, platform autodetection, and enhanced security. These features simplify data extraction, support discovery workflows, and harden container security.


Migration Guide

Breaking changes

delay_factor parameter removed — replaced with read_timeout (float, seconds):

// v1.2 (no longer works)
{ "host": "192.168.1.1", "platform": "cisco_ios", "commands": ["show version"], "delay_factor": 2 }

// v1.3
{ "host": "192.168.1.1", "platform": "cisco_ios", "commands": ["show version"], "read_timeout": 30.0 }

read_timeout is the total time to wait for command output. Default is 10 seconds.

New endpoints

  • POST /v1/send_command_structured — Parse command output with TextFSM

New parameters

  • platform: "autodetect" — Automatically detect device type
  • expect_string — Custom prompt matching for non-standard devices

What's New

Structured output with TextFSM

POST /v1/send_command_structured parses command output into JSON using TextFSM templates from ntc-templates.

Request:

{
  "host": "192.168.1.1",
  "platform": "cisco_ios",
  "commands": ["show ip interface brief"]
}

Response:

{
  "job_id": "abc-123",
  "status": "finished",
  "structured_output": [
    {"interface": "GigabitEthernet0/0", "ip_address": "10.1.1.1", "status": "up", "protocol": "up"},
    {"interface": "GigabitEthernet0/1", "ip_address": "10.1.2.1", "status": "up", "protocol": "up"}
  ]
}

Supports 300+ commands across 50+ platforms. Bring your own TextFSM templates:

{
  "host": "192.168.1.1",
  "platform": "cisco_ios",
  "commands": ["show custom-command"],
  "textfsm_template": "Value FIELD1 (\\S+)\\nValue FIELD2 (\\S+)\\n\\nStart\\n  ^${FIELD1}\\s+${FIELD2} -> Record"
}

Full guide: docs/structured-output.md

Platform autodetect

Set platform: "autodetect" and NAAS probes the device to determine its type:

{
  "host": "192.168.1.1",
  "platform": "autodetect",
  "commands": ["show version"]
}

NAAS uses Netmiko's SSHDetect to identify the device (cisco_ios, arista_eos, juniper_junos, etc.) and executes the command with the correct driver.

Useful for:

  • Discovery workflows
  • Heterogeneous environments
  • Unknown device types

Custom prompt matching

expect_string parameter for devices with non-standard prompts:

{
  "host": "192.168.1.1",
  "platform": "cisco_ios",
  "commands": ["show version"],
  "expect_string": "CustomPrompt#"
}

Overrides Netmiko's default prompt detection.

Enhanced security

Non-root containers — API and worker containers run as UID 1000 with NET_BIND_SERVICE capability for port 443. No root privileges required.

Read-only filesystem — Containers use read-only root filesystems with pre-compiled Python bytecode. Prevents runtime file modifications.

Audit events — Structured logging for job lifecycle, authentication failures, and device errors (introduced in v1.2, expanded in v1.3).


Bug fixes

  • Config error detection via error_pattern in send_config_set — returns error string instead of succeeding silently
  • Call find_prompt() after connection pool hit to verify clean CLI state
  • Use setnx for naas_cred_salt so API restarts don't invalidate existing pool keys
  • Pass Redis connection explicitly to lockout functions, eliminating per-request TCP overhead
  • Set explicit job_timeout on enqueue to prevent hung workers
  • Call redis.ping() at startup to fail fast if Redis unavailable

Performance improvements

  • Explicitly set fast_cli=True on ConnectHandler for consistent throughput
  • Use Job.fetch_many() in ListJobs to batch-fetch job details in single Redis pipeline
  • Pass Job object directly to job_locker to avoid redundant Redis fetch

Documentation improvements

  • Comprehensive guides for all v1.3 features
  • Job cancellation examples
  • Connection pooling configuration
  • Prometheus metrics reference with Grafana queries
  • Audit events reference with event types
  • Troubleshooting guides for pooling, structured output, autodetect
  • Architecture diagram updated with v1.3 components

Upgrade Steps

  1. Pull the latest image or update your deployment
  2. Update all requests that use delay_factor to use read_timeout instead (breaking change)
  3. Review security posture — containers now run as non-root with read-only filesystem
  4. Optionally enable structured output for commands that benefit from parsing
  5. Consider using platform: "autodetect" for discovery workflows
  6. Review Prometheus metrics — new metrics added for connection pool and structured output