The FlexRAID Expression Language
Starting with FlexRAID 2.0 preview build 9
This is for all those users that have either:
– been using the scripting feature of FlexRAID in version 1.4
– or been wishing for a powerful way to script FlexRAID’s operations
You are all herein served.
Note: expression scripts can only be scheduled. However, you can schedule them to run “now”.
Expression scripts are a powerful way to create an execution workflow.
- [@config <RAID config name>]
- [@queued <true|false>]
- @execute <executable|@task <create|verify|validate|quick-validate|update>>
- [@param <value>]
- …
- [@param <value>]
- [@in <working directory>]
- [@interactive @wait <wait time before response> @response <response>]
- …
- [@interactive @wait <wait time before response> @response <response>]
- [@error <@run <expression script name>|@email <message>|@sms <message>>]
- …
- [@error <@run <expression script name>|@email <message>|@sms <message>>]
- [@success <@run <expression script name>|@email <message>|@sms <message>>]
- …
- [@success <@run <expression script name>|@email <message>|@sms <message>>]
[]: means optional element or value… when value, the first listed value is the default value
<>: value must be provided
|: separates the possible values
@: expression keyword
…: the expression can repeat multiple times (one or more)
@config: the RAID configuration name to execute against (required if the executable is a RAID task or if the execution is to be queued based on the context of a RAID configuration)
@queued: whether to queue the execution if another task is running against the named RAID configuration… if false, the script will abort
@execute: the executable or FlexRAID task to run… the executable can also be a DOS or Shell script (required)
@param: a parameter value to pass to the executable as argument or to the task as task property (e.g., @param verifyStart=20GB)
Executables (as opposed to RAID tasks) can have these additional expressions:
@in: the working directory when running an executable
@interactive: for interactive scripts, you can automate responding the prompts
@wait: when in interactive mode, the time in milliseconds to wait before responding. FlexRAID cannot really detect a prompt from your script or executable. Therefore, you must time the interaction and know when a response is needed.
@response: when in interactive mode, the response text to pass to the executable
@error: what to do on error (an exit code > 0 equals error for scripts)
@success: what to do on success
@run: the next expression script to run (expression scripts can be chained – watch out for recursions!)
@email: send an e-mail notification
@sms: send an SMS notification
** All keywords are case insensitive
** RAID configuration names are case sensitive
Revisions
- August 28, 2012 @ 01:12:51 [Current Revision] by Brahim
- August 28, 2012 @ 01:12:47 [Autosave] by Brahim
- September 2, 2011 @ 09:49:17 by Brahim
- June 24, 2011 @ 14:39:02 by xliv
- June 2, 2011 @ 07:26:04 by Brahim
- June 2, 2011 @ 07:12:22 by Brahim
- June 2, 2011 @ 07:08:13 by Brahim
- June 2, 2011 @ 07:08:11 by Brahim
- June 2, 2011 @ 07:06:40 by Brahim
- June 2, 2011 @ 07:06:36 by Brahim
- June 2, 2011 @ 07:06:14 by Brahim
Would be good to have a list of params for each of the tasks. Otherwise how do we know which params are available and what their type is?
The list of available parameters is provide here: http://wiki.flexraid.com/2011/10/12/command-execute/
Is there a collection of Expression Scripts around? I know there have to be some really useful ones out there people have created.
It would definitely be good idea to have a place where scripts are listed. If nothing else, they will serve as example by which others could write their own. See this thread: http://forum.flexraid.com/index.php/topic,5030.0.html