Skip to main content

PyPI Supported python versions

Caveats

As napalm-ros uses API, several caveats exist.

  • API is not versioned so things may break when routeros is upgraded.
  • RouterOS has no native, non-reboot commit/rollback and safe mode is not exposed via the API. Rollback is emulated with a device-side scheduler that restores a backup, so a rollback (or an expired commit-confirm) reverts by rebooting. See Configuration management.
  • get_config reads the running configuration over the binary API on RouterOS 7 (no SSH). On RouterOS 6 it falls back to SSH (paramiko), where paramiko offers keys from a running SSH agent by default; if the agent offers a key the device rejects, RouterOS may drop the session and get_config then fails with No existing session. Pass optional_args={'paramiko_allow_agent': False} to authenticate with the password only (SSH agent/key auth is otherwise left enabled); paramiko_look_for_keys (default False) similarly controls on-disk key lookup.

Configuration management

Configuration management is supported on RouterOS 7.x and is implemented entirely over the binary API (via librouteros), so it needs no SSH access. It requires librouteros >= 4.2.2, which carries the /file/add fix commit_config relies on to apply a candidate on RouterOS older than ~7.13.

  • get_config / compare_config read the running configuration with /export.
  • load_merge_candidate stages a .rsc script that is applied with /import. load_replace_candidate stages a full configuration.
  • commit_config applies the candidate. Before a plain commit a backup is taken so rollback can restore it (by rebooting). commit_config(revert_in=<seconds>) arms a device-side scheduler that restores that backup unless confirm_commit is called in time (has_pending_commit reports whether one is armed). Because the timer lives on the device it survives a lost session or a lock-out.
  • A replace (load_replace_candidate + commit_config) uses /system reset-configuration run-after-reset, which wipes the configuration and reboots into the candidate. It is destructive, has no automatic rollback, and the candidate must be a complete, self-consistent configuration that restores management connectivity. Commit-confirm (revert_in) is not available with a replace.

RouterOS configuration is imperative (an /export is a list of add/set actions, not declarative state) and ordering matters in some paths (e.g. /ip firewall filter) but not others (e.g. /ip address). compare_config is therefore a textual diff for review, not an executable patch.

Implemented getters

  • get_arp_table
  • get_interfaces_counters
  • get_environment
  • get_facts
  • get_interfaces
  • get_interfaces_ip
  • get_ntp_servers
  • get_snmp_information
  • get_users
  • get_ipv6_neighbors_table
  • is_alive
  • ping
  • get_lldp_neighbors
  • get_lldp_neighbors_detail
  • get_network_instances
  • get_mac_address_table
  • get_bgp_neighbors
  • get_bgp_neighbors_detail
  • get_config
  • get_vlans

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napalm_ros-1.4.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napalm_ros-1.4.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file napalm_ros-1.4.0.tar.gz.

File metadata

  • Download URL: napalm_ros-1.4.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.3 CPython/3.12.3 Linux/6.17.0-1022-azure

File hashes

Hashes for napalm_ros-1.4.0.tar.gz
Algorithm Hash digest
SHA256 cc0d7570b51fa9104c47b284bdca2598c4899be4c6587fea434868b346b68916
MD5 84329860053b5748352b25766578281f
BLAKE2b-256 276c8ca7938709320a9949b37006ea907424af15ebd64cf8fea629cc51764237

See more details on using hashes here.

File details

Details for the file napalm_ros-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: napalm_ros-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.3 CPython/3.12.3 Linux/6.17.0-1022-azure

File hashes

Hashes for napalm_ros-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 282e66199488d0fe5a70461822d5179155f20083f38ab734595feab1da67dcfa
MD5 02fe2bcce7afc0d1e97c9e0101643807
BLAKE2b-256 c4cd46c82653b63c3837c427fa6baec2a25b8f9217f168bdbb1aef6ee8d9c54c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 files

1.3.1

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

1 file

1.2.1

1 file

1.2.0

1 file

1.1.0

1 file

1.0.1

1 file

1.0.0

1 file

0.8.0

1 file

0.7.0

1 file

0.6.2

1 file

0.6.1

1 file

0.6.0

1 file

0.5.1

1 file

0.5.0

1 file

0.4.2

1 file

0.4.1

1 file

0.4.0

1 file

0.3.5

1 file

0.3.4

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page