Using Unix Shell Scripting; Creating A Unix Api Script - Dell FORCE10 Open Automation Configuration

Open automation guide
Table of Contents

Advertisement

Using UNIX Shell Scripting

Figure 3-5. Script Written in the UNIX Shell Scripting Language: Example
#!/bin/sh
i=$1
while [ $i -le $2 ]
do
echo $i
/usr/pkg/bin/python /usr/pkg/scripts/smartutils/F10SmartScriptUtils.py createvlanid $i
(( i++ ))
done
Table 3-5. Supported API Functions in UNIX Shell Scripts
Function
addlaginttovlan
addphyinttovlan
createvlanid
deletevlanid
makelagintnoshutdown
makelagintshutdown
makelagintswitch
Use the information in this section to create a UNIX script using the UNIX API and
run the script on a Dell Force10 switch. For information on how to create and run a
PERL or Python script using the PERL or Python API, see
and
Using the Python

Creating a UNIX API Script

Use the information in this section to create a UNIX shell script to be run on a Dell
Force10 switch.
The F10SmartScriptUtils.py file is the main API library file that contains the
functions that you can include in a UNIX shell script. The F10SmartScriptUtils.py
file is downloaded with the Programmatic Management package and is stored at /usr/
pkg/scripts/smartutils.
from a UNIX shell script, including the supported functions and required arguments.
Figure 3-5
shows an example of how to write a script in the UNIX shell scripting
language. You can store a UNIX shell script anywhere on the switch.
Arguments
lagId, vlanId, tagFlag
stackunitNum, portId
vlanId, tagFlag
vlanId
vlanId
lagId
lagId
lagId
API.
Table 3-5
describes the FTOS operations that you can invoke
Description
Adds a port channel (LAG) to a VLAN.
tagFlag values: 1 (tagged) or 0 (untagged).
Adds an interface to a VLAN.
tagFlag values: 1 (tagged) or 0 (untagged).
Creates a VLAN with a specified VLAN ID.
Deletes a VLAN with a specified VLAN ID
Enables the specified port channel.
Disables the specified port channel.
Configures the specified port channel (LAG) as a Layer 2
switchport.
Supported UNIX Utilities
Smart Scripting | 31

Advertisement

Table of Contents
loading

This manual is also suitable for:

Force10

Table of Contents