Submitting A Request - Juniper JUNOS OS 10.3 - XML MANAGEMENT PROTOCOL GUIDE 6-30-2010 Manual

Junos xml management protocol guide
Hide thumbs Also See for JUNOS OS 10.3 - XML MANAGEMENT PROTOCOL GUIDE 6-30-2010:
Table of Contents

Advertisement

Junos 10.3 Junos XML Management Protocol Guide
220
extensive => $TOGGLE,
multicast => $TOGGLE,
family => $STRING,
vpn => $STRING,
summary => $TOGGLE,
matching => $STRING,
destination => $STRING,
label => $STRING,
},

Submitting a Request

The following code is the recommended way to send a request to the Junos XML protocol
server and shows how to handle error conditions. The
JUNOS::Device
object, as discussed in "Establishing the Connection" on page 217. A detailed
discussion of the functional subsections follows the complete code sample.
my %arguments = ( );
%arguments = ( argument1 => value1 ,
argument2 => value2 , ...);
argument3 => value3 ,
...);
my $res = $jnx-> method (%args);
unless ( ref $res ) {
$jnx->request_end_session( );
$jnx->disconnect( );
print "ERROR: Could not send request to $hostname\n";
}
my $err = $res->getFirstError( );
if ($err) {
$jnx->request_end_session( );
$jnx->disconnect();
print "ERROR: Error for $hostname: " . $err->{message} . "\n";
}
The first subsection of the preceding code sample creates a hash called
define values for a method's options or attributes. For each argument, the application
uses the notation described in "Providing Method Options or Attributes" on page 218.
my %arguments = ( );
%arguments = ( argument1 => value1 ,
argument2 => value2 , ...);
$jnx
variable is defined to be a
%arguments
Copyright © 2010, Juniper Networks, Inc.
to

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junos os

Table of Contents