170 likes | 386 Views
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
E N D
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 SAM IP AM/PM NPM 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
Correlation Engine A Peek Inside…. Server API Repos ASL Threads ASL Interpreter Model Model Model sm_whatever… Client API
Interact with a remote repository Server API Repos sm_whatever… sm_adapter –s REMOTE_SERVER Client API routers = getInstances(“Router”); foreach r (routers) { rObj = object(“Router”, r); } Server Client
Interact with the local repository Server API Repos sm_whatever… sm_adapter Client API routers = self->getInstances(“Router”); foreach r (routers) { rObj = self->object(“Router”, r); }
Subscribe to Topology and/or Events Server API Repos sm_whatever… sm_adapter –-subscribe=.*::.*::.*/pae Client API START { timeStamp : integer fs “NOTIFY” fs class : word fs instance : word fs event : word fs conf : integer fs } Server Client
Read/Parse a file Server API Repos sm_whatever… sm_adapter --file=jdr.txt Client API START { h : word c : word ..eol } do { adp->addPending(h,c,”Read from file”); } plan_r.afnoc.mil poe fluid.gnt.mil poe essence.brk.mil poe
Write to a file Server API Repos sm_whatever… sm_adapter –m sm_actions Client API 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-001 Host im2-i-fms-001
Launch other ASL threads Server API Repos sm_whatever… Client API drv = create(“GA_Driver”, “myDrv”); drv->ReadsRulesFrom = create(“GA_RuleSet, “myRules”); drv->ReadsRulesFrom->fileName=“foo.asl”; drv->start();
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