an asl appetizer asl!. overview what is asl? what can i do with asl? demo

Post on 26-Mar-2015

222 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

An ASL Appetizer

ASL!

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 Embedded in all of the InCharge binaries

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

InCharge Binary

What are the InCharge binaries?

sm_server SAMIP AM/PM

NPM

sm_adapter

Trap Adapter

Syslog Adapter

EMOM Adapter

sm_trapd

brstart Broker

InCharge Binary

What are the InCharge binaries?

sm_server

sm_adapter

sm_trapd

brstart

Platform Binary

A Peek Inside….

Client API

Server API

ModelModelModel

ReposASLInterpreter

CorrelationEngine

ASL Threads

sm_whatever…

What can ASL do?

Interact with a remote repository

Client API

Server API

Repos

sm_whatever…routers = getInstances(“Router”);foreach r (routers) { rObj = object(“Router”, r);}

Client

Server

sm_adapter –s REMOTE_SERVER

Interact with the local repository

Client API

Server API

Repos

sm_whatever…routers = self->getInstances(“Router”);foreach r (routers) { rObj = self->object(“Router”, r);}

sm_adapter

Subscribe to Topology and/or Events

Client API

Server API

Repos

sm_whatever…START { timeStamp : integer fs “NOTIFY” fs class : word fs instance : word fs event : word fs conf : integer fs}

Client

Server

sm_adapter –-subscribe=.*::.*::.*/pae

Read/Parse a file

Client API

Server API

Repos

sm_whatever…START { h : word c : word ..eol} do { adp->addPending(h,c,”Read from file”);}

plan_r.afnoc.mil poefluid.gnt.mil poeessence.brk.mil poe

sm_adapter --file=jdr.txt

Write to a file

Client API

Server API

Repos

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

Router gw1-i-fw-001Host im2-i-fms-001

sm_adapter –m sm_actions

Launch other ASL threads

Client API

Server API

Repos

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

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 product’s ‘doc/pdf’ directory

top related