refresh_acl_from_database( $name )

Given an AccessControlListName result with prefetched mappings, creates the corresponding hosts_groups ACL in configuration.

load_acls_from_database

Loads all the managed ACLs into host_groups.

CONFIGURATION OVERRIDE

Users can override or add to Netdisco configuration from the command line, or in a job specification in a configured schedule or API-submitted job. This in turn overrides the NETDISCO_WITH_CONFIGURATION environment variable.

Configuration is provided to a Job in either the port or subaction (extra) slots. There is a way to provide configuration when these slots are also used for job parameters.

Configuration can be provided directly as JSON, as simple "k1=v1,k2=v2" format, or, when job parameters are needed, in a JSON dictionary slot "with" alongside the job parameter in a dictionary slot "value".

When configuration override is provided to BOTH the port and subaction (extra) slots the BEHAVIOUR IS UNDEFINED. Best to avoid doing that.

Note that earlier behaviour of providing a bare string as a device_auth tag hint is now unsupported and device_auth_tag_hint setting can be used instead.

Also note that this implementation precludes providing a dictionary as the "extra" configuration to any action (as it will be interpreted and consumed as configuration setting overrides). Lists and strings remain supported.

For example:

  • undef (changed to empty string if subaction)

  • unchanged

  • "unchanged"

  • '"unchanged"'

  • [{"mac": "string", "port": "string"}]

  • {"mac": "string", "port": "string"} (unsupported)

  • {"value": [{"mac": "string", "port": "string"}]}

  • {"value": {"mac": "string", "port": "string"}}

  • {"value": '{"mac": "string", "port": "string"}'}

  • {"value": "unchanged", "with": {"snmptimeout": 5000000}}

  • {"value": "unchanged", "with": '{"snmptimeout": 5000000}'}

  • {"value": "unchanged", "with": 'snmptimeout=5000000'}

  • {"snmptimeout": 5000000}

  • '{"snmptimeout": 5000000}'

  • snmptimeout=5000000

  • {"value": "unchanged", "with": "FAILS"} (unsupported)

  • {"value": "unchanged", "with": ["FAILS"]} (unsupported)

snmp_charset_maps( $raw )

Returns the snmp_charset setting as a list of maps from ACL to a list of charset names, from any of the forms it may be written in: a charset name, a map whose values are a name or a list, or a list of those maps. Undef, references and empty names are dropped. Returns [ { 'group:__ANY__' => [] } ] when nothing is left.

parse_params_to_config

Takes a defined value, works out what has been provided. If there is configuration to override it applies that. If there is a residual value to return, it returns that, otherwise returns undef.

split_params_to_config

Works out what has been provided as parse_params_to_config does, but applies nothing. Returns the residual value and a hashref of the configuration overrides, or undef when there are none.