beautypg.com

About openscript, Overview, General nomenclature of functions – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 13: Extensions and events, Chapter 1

background image

Brocade Virtual ADX OpenScript API Guide

1

53-1003243-01

Chapter

1

About OpenScript

Overview

Brocade Virtual ADX Perl Extensions allow scripts to access load-balancing functionality such as
content manipulation and server selection. Some of these extensions (HTTP, TCP, IP) follow the
syntax and semantics of equivalent extensions found on CPAN. Others specific to Brocade Virtual
ADX, follow the same convention.

NOTE

Not all of the CPAN methods are supported in the ADX CPAN supported modules either due to
performance constraints or lack of relevance in the load balancing environment.

General nomenclature of functions

OpenScript package names have the prefix OS_, This stands for OpenScript. For example,
OS_HTTP_REQUEST.

The set and get APIs normally have the same name. The set APIs normally have the value specified
as the parameter. For example, the API OS_HTTP_REQUEST::version get and set APIs are as follows.

GET: OS_HTTP_REQUEST::version.

SET: OS_HTTP_REQUEST::version("1.1");

Extensions and events

ADX OpenScript Perl Scripts are “Event Driven”. This means that users write a script with event
handlers that are called when the attached event occurs. Examples of an event that will trigger
execution of a script include: arrival of a TCP SYN packet or a HTTP Request. The event context
largely determines the extensions to be used in the handler. For example, in the event of an
http_request handler, you can use the methods in the OS_HTTP_REQUEST extension (and possibly
the TCP and IP extensions). Using OS_HTTP_RESPONSE in a request context will have
unpredictable results.