Owner's Manual
Smart Scripting | 71
Figure 5-1. Execution of a PERL, Python, and Shell Script from a UNIX Shell: Example
Using the PERL API
The RESTAPI Interface package provides a PERL API library containing the
supported functions (described in Supported UNIX Utilities), which you can use in a
PERL script to invoke Dell Networking OS operations on a switch. The PERL API
library is stored in the F10SmartUtils.pl file at /usr/pkg/scripts/smartutils. Code Dell
Networking OS API functions in a PERL script as shown in the following example:
D
ell# start shell <---------------------------------- Log on to a UNIX shell
4
.4 BSD UNIX () (ttyp0)
l
ogin: admin
P
assword:
C
opyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002
The NetBSD Foundation, Inc. All rights reserved.
C
opyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
$
cd /f10/flash/scripts
$
ls <------------------------------------------------- List the existing scripts
c
reateVlans.pl createVlans.py createVlans.sh
$
./createVlans.pl 12 14 <-------------------------- Execute the PERL script using either command
$
perl createVlans.pl 12 14
$
./createVlans.py 12 14 <-------------------------- Execute the Python script using either command
$
python createVlans.py 12 14
$
./createVlans.sh 12 14 <-------------------------- Execute the UNIX shell script