Skip to content

adapter

Name

adapter - Device adapter (profile) utilities

Synopsis

noc adapter mangle <name>

Description

mangle

Print the flat adapter directory name for a profile name.

The flat name is generated by mangle_profile_name (noc.core.profile.names): each dot-separated segment is lowercased, every character outside [a-z0-9] is replaced with _ (consecutive runs collapse to one _), segments are joined with __, and a leading digit or underscore gets an extra _ prefix. The result is the directory name of the adapter that backs the profile. Adapter directories live either in src/noc/adapters/ (built-in) or in <custom root>/adapters/ (custom).

  • <name> - Profile name in the Vendor.Software form, e.g. Cisco.IOS

Examples

Print the flat name of the Cisco.IOS profile

$ ./noc adapter mangle Cisco.IOS
cisco__ios

Digit-led vendor name

$ ./noc adapter mangle 3Com.4500
_3com__4500

Create the adapter directory for a new custom profile (in <custom root>/adapters/)

$ mkdir -p "<custom root>/adapters/$(./noc adapter mangle Acme.Router)"

For built-in adapters, create the directory under src/noc/adapters/ instead.

See also

SA profile concepts