You are on page 1of 17

An ASL Appetizer

Overview

What is ASL? What can I do with ASL? Demo

What is ASL?

Adapter Scripting Language Not a general purpose language


Limited I/O (no user interaction) No library support

The native scripting language of InCharge

Unique Strengths of ASL

A Parser

Makes it easy to parse files of any format As powerful as regular expressions but easier to read!

Can connect two InCharge processes

Many built in connections are implemented in ASL


Runs inside of an InCharge server Always available in any InCharge environment

Embedded in all of the InCharge binaries


InCharge Binary

What are the InCharge binaries?


SAM IP AM/PM NPM

sm_server

sm_adapter

Syslog Adapter
EMOM Adapter

sm_trapd

Trap Adapter

brstart

Broker

InCharge Binary

What are the InCharge binaries?

sm_server

sm_adapter

Platform Binary

sm_trapd

brstart

A Peek Inside.
Server API

ASL Interpreter

ASL Threads

Repos

Correlation Engine

Model Model Model

sm_whatever
Client API

What can ASL do?

Interact with a remote repository


Server API

Repos

sm_whatever
Client API
Server

sm_adapter s REMOTE_SERVER routers = getInstances(Router); foreach r (routers) { rObj = object(Router, r); }

Client

Interact with the local repository


Server API

Repos

sm_whatever
Client API

sm_adapter routers = self->getInstances(Router); foreach r (routers) { rObj = self->object(Router, r); }

Subscribe to Topology and/or Events


Server API

Repos

sm_whatever
Client API
Server

sm_adapter -subscribe=.*::.*::.*/pae START { timeStamp : integer fs NOTIFY fs class : word fs instance : word fs event : word fs conf : integer fs }

Client

Read/Parse a file
Server API

Repos

sm_whatever
Client API plan_r.afnoc.mil fluid.gnt.mil essence.brk.mil poe poe poe

sm_adapter --file=jdr.txt START { h : word c : word ..eol } do { adp->addPending(h,c,Read from file); }

Write to a file
Server API

Repos

sm_whatever
Client API Router Host gw1-i-fw-001 im2-i-fms-001

sm_adapter m sm_actions fo = create(ACT_File, myFileObj); Fo->fileName = myAdapter.log; foreach n (getInstances(Node) { obj = object(n); fo->writeln(obj->CreatonClass.\t.n); }

Launch other ASL threads


Server API

Repos

sm_whatever
drv Client API = create(GA_Driver, myDrv); drv->ReadsRulesFrom = create(GA_RuleSet, drv->ReadsRulesFrom->fileName=foo.asl; drv->start(); myRules);

Demo

Summary

We now know what is ASL We now know what can ASL do We have seen code examples More questions.?

For Further Information

ASL Reference Guide

asl_ref.pdf

Found in products doc/pdf directory

You might also like