Owner's Manual
72 | Smart Scripting
www.dell.com | support.dell.com
Figure 5-2. PERL Script with API function call: Example
Supported Dell Networking OS API Functions in PERL Scripts describes the
supported functions and required arguments that you can use in PERL scripts running
on a Dell Networking switch to connect through a telnet session and gather
information or configure parameters through the CLI.
#!/usr/pkg/bin/perl -w
require '/usr/pkg/scripts/smartutils/F10SmartUtils.pl'; <------ Load the PERL API
usage() if ($#ARGV < 1);
($start,$end)=@ARGV;
$startVlan = $start;
$endVlan = $end;
for (my $i=$startVlan;$i<=$endVlan;$i++) {
my $createvlanId = F10CreateVlanId($i); <-------------------- Invoke a PERL API function
}
sub usage {
print "usage: createVlans.pl <start> <end>\n";
exit;
}
Table 5-3. Supported Dell Networking OS API Functions in PERL Scripts
PERL API Function Arguments Description
F10AddLagIntToVlan (lagId, vlanId, tagFlag) Adds a LAG interface to a VLAN as either tagged or untagged.
tagFlag values: 1 (tagged) or 0 (untagged).
F10AddPhyIntToVlan (stackUnitNum, portId,
vlanId, tagFlag)
Adds a physical interface to a VLAN as either tagged or untagged.
tagFlag values: 1 (tagged) or 0 (untagged).
F10CreateVlanId (vlanId) Creates a VLAN on the switch.
F10DeleteVlanId (vlanId) Deletes a VLAN on the switch.
F10ExecShowCmd (command) Executes a specified show command.
F10MakeLagIntNoShutdown (lagId) Enables the specified port channel.
F10MakeLagIntShutdown (lagId) Disables the specified port channel.
F10MakeLagIntSwitch (lagId) Configures the specified port channel (LAG) as a Layer 2
switchport.
F10MakePhyIntNoShutdown (stackUnitNum, portId) Enables the specified port.
F10MakePhyIntShutdown (stackUnitNum, portId) Disables the specified port.
F10MakePhyIntSwitch (stackUnitNum, portId) Configures the specified port as a Layer 2 switchport.
F10MakeVlanIntNoShutdow
n
(vlanId) Enables the specified VLAN interface.
F10MakeVlanIntShutdown (vlanId) Disables the specified VLAN interface.