Difference between revisions of "Freeside:3:Documentation:Developer/FS/part export/router"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
 
(No difference)

Latest revision as of 20:08, 27 June 2012

FS::part_export::router

This export connects to a router and transmits commands via telnet or SSH. It requires the following custom router fields:

Required custom fields

admin_address - IP address (or hostname) to connect.; admin_user - Username for the router.; admin_password - Password for the router.; admin_protocol - Protocol to use for the router. 'telnet' or 'ssh'. The ssh protocol only support password-less (ie. RSA key) authentication. As such, the admin_password field isn't used if ssh is specified.; admin_timeout - Time in seconds to wait for a connection.; admin_prompt - A regular expression matching the router's prompt. See Net::Telnet for details. Only applies to the 'telnet' protocol.; admin_cmd_insert - Insert export command.; admin_cmd_insert_error - Insert export command error pattern.; admin_cmd_delete - Delete export command.; admin_cmd_delete_error - Delete export command error pattern.; admin_cmd_replace - Replace export command.; admin_cmd_replace_error - Replace export command error pattern.; admin_cmd_suspend - Suspend export command.; admin_cmd_suspend_error - Support export command error pattern.; admin_cmd_unsuspend - Unsuspend export command.; admin_cmd_unsuspend_error - Unsuspend export command error pattern.
The admin_cmd_* virtual fields, if set, will be processed in one of two ways. After being expanded, they will be run on the router specified by admin_address using the protocol specified by admin_protocol.
Text::Template
If the export command contains the string [@--, then it will be processed with Text::Template using [@-- and --@] as delimeters.
eval
If the export command does not contain [@--, it will be double quoted and eval'd.
The admin_cmd_*_error virtual fields, if set, define a regular expression that will be matched against the output of the command being run. If the pattern matches, an error will be raised using the output as the error.
If any of the required router virtual fields are not defined, then the export silently declines.

The export itself takes no options.