Brocade Virtual ADX OpenScript Programmer’s Guide (Supporting ADX v03.1.00) User Manual
Page 3

Brocade Virtual ADX OpenScript Programmer’s Guide
iii
53-1003244-01
Contents
Preface
Document conventions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Text formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Command syntax conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Notes, cautions, and warnings . . . . . . . . . . . . . . . . . . . . . . . . . . .vi
Brocade resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
Getting technical help. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Document feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
What is OpenScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Why OpenScript uses Perl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Why OpenScript uses Perl instead of TCL . . . . . . . . . . . . . . . . . . 2
The OpenScript Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Capabilities provided by the Brocade OpenScript engine . . . . . . 3
Architecture of the OpenScript engine . . . . . . . . . . . . . . . . . . . . . 4
Using Perl on the Brocade Virtual ADX . . . . . . . . . . . . . . . . . . . . . . . . 4
Perl variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Structure of a Brocade Virtual ADX Perl script . . . . . . . . . . . . . . . . . . 7
Basic anatomy of a script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Sample scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
High readability script example. . . . . . . . . . . . . . . . . . . . . . . . . . 10
Power-user script example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Managing Scripts on a Brocade Virtual ADX
Importing and exporting scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Managing scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Deleting a script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Renaming a script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Display script in the script directory . . . . . . . . . . . . . . . . . . . . . . 14
Compiling and binding scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Binding a script to a virtual server port . . . . . . . . . . . . . . . . . . . 15
Updating an existing script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15