Download Open Automation Guide
Transcript
To configure the username and passwords in the smartutils.cfg file that are used to run PERL API scripts, do one of the following: • • From the Web user interface, select Settings > SmartUtils Credentials (see Menu Options). From a UNIX shell, use the UNIX text editor to open the smartutils.cfg file, enter a user name and password, and save the file. To run a PERL API script: • • From the FTOS CLI, use the script command as described in Running a Script from the FTOS CLI. From a UNIX shell, follow the procedure described in Running a Script from the UNIX Shell. Using the Python API Use the information in this section to create a Python script using the Python API and run the script on a Dell Force10 switch. For information on how to create and run a PERL script using the PERL API, see Supported UNIX Utilities. Creating a Python API Script Use the information in this section to create a Python script to be run on a Dell Force10 switch. For information on how to run a Python script from the FTOS CLI, see Running a Script from the FTOS CLI. F10SmartUtils.py is the Python API library containing the supported functions (described in Table 3-4), which can be used in a Python script to invoke FTOS operations on a switch. This file is downloaded with the Programmatic Management package and is stored at /usr/pkg/scripts/smartutils. You code FTOS API functions in a Python script as shown in the following example: Smart Scripting | 27