Net::CLI::Interact::ActionSet(3pm) | User Contributed Perl Documentation | Net::CLI::Interact::ActionSet(3pm) |
Net::CLI::Interact::ActionSet - Conversation of Send and Match Actions
This class is used internally by Net::CLI::Interact and it's unlikely that an end-user will need to make use of ActionSet objects directly. The interface is documented here as a matter of record.
An ActionSet comprises a sequence (usefully, two or more) of Actions which describe a conversation with a connected network device. Actions will alternate between type "send" and "match", perhaps not in their original Phrasebook definition, but certainly by the time they are used.
If the first Action is of type "send" then the ActionSet is a normal sequence of "send a command" then "match a response", perhaps repeated. If the first Action is of type "match" then the ActionSet represents a "continuation", which is the method of dealing with paged output.
An ActionSet ("match" then "send") which will be available for use on all commands sent from this ActionSet. An alternative to explicitly describing the Continuation sequence within the Phrasebook.
A stash for the current Prompt (regular expression reference) which Net::CLI::Interact expects to see after each command. This is passed into the constructor and is used when padding Match Actions into the ActionSet (see "execute", below).
Returns a new ActionSet which is a shallow clone of the existing one. All the reference based slots will share data, but you can add (for example) a "current_match" without affecting the original ActionSet. Used when preparing to execute an ActionSet which has been retrieved from the Phrasebook.
Accepts a list of parameters which will be used when "sprintf" is called on each Send Action in the set. You must supply sufficient parameters as a list for all Send Actions in the set, and they will be popped off and stashed with the Action(s) according to how many are required.
Allows the Transport to be registered such that when the ActionSet is executed, commands are sent to the registered callback subroutine. May be called more than once, and on execution each of the callbacks will be run, in turn and in order.
The business end of this class, where the sequence of Actions is prepared for execution and then control passed to the Transport. This process is split into a number of phases:
This phase copies Continuation ActionSets from Send statements to following Match statements in the ActionSet. It also performs a similar action using the "default_continuation" if one is set and there's no existing Continuation configured.
See the following for further interface details:
2019-07-17 | perl v5.28.1 |