Caveat Coder.
connect()
typically called by the constructor. If you set
'Do_Not_Connect' to be true you must call this function
yourself.
disconnect()
Disconnects from a JUNOScript server & performs
other clean-up related to this conneciton. This function
will also be called if your JUNOS::Device object goes out
of scope or is undef'ed.
getErrors()
getFirstError()
getErrors() and getFirstError() are available for the application to
retrieve all of the errors occured within the last JUNOS::Device method
invocation. The application may wish to print these error messages in
log file or display on a different error window. getErrors() returns
a reference to all the errors and getFirstError() returns the earliest
error that triggered the failure. These methods can be called after
a JUNOS::Device method has failed.
Note: These errors normally go to the standard output unless
the Always category is in JUNOS::Trace is disabled. Unless you want
the errors to go someplace other than the standard output,
you don't need to call these methods.
An example of using getFirstError:
unless($jnx->connect()) {
my $error = $jnx->getFirstError();
print ERRORLOG ("ERROR: $error\n");
}
An example of using getErrors:
unless($jnx->connect()) {
my @errors = @{$jnx->getErrors()};
for my $error (@errors) {
print ERRORLOG ("ERROR: $error\n");
}
}
request($REQUEST)
You should call <JUNOScript command> functions - which
eventually utilize this function - you should not call this
directly!
Sends a request in $REQUEST to a Juniper box and returns the result.
In a scalar context a JUNOS::Response object is returned.
In an array context an array consisting of the
XML::DOM::Document object and the raw JUNOS::Response
object containing the enclosing <rpc-reply> tags.
The parameter is the name of the JUNOScript function to be
called on the remote Juniper box.
<JUNOScript command>
You may call any JUNOScript command via the JUNOS::Device
Handle. See 'request' function for return values.
These methods are available when connecting to a JUNOS 5.1 router.
they can take two types of arguments or zero arguments:
1. 'toggle' - argument is present or not.
For example the 'extensive' argument to the 'get_interface_information'
method:
get_interface_information(extensive => 1);
2. 'string' - a string argument
For example the 'slot' argument to the 'get_pic_information' method:
get_pic_information(slot => "2");
method is followed by a list of accepted arguments and their types
if it has any.
get_accounting_profile_information
profile => STRING
get_accounting_record_information
profile => STRING
since => STRING
utc_timestamp => TOGGLE
get_chassis_inventory
detail => TOGGLE
extensive => TOGGLE
get_environment_information
get_feb_information
get_firmware_information
get_fpc_information
=8= |