Narval Shell Commands¶
Introduction¶
The NARVAL shell commands have the role to communicate with the NARVAL AWS component to control an acquisition. There are two ways to use the narval shell commands :- In command prompt : 'narval_shell' command
- Within narvalconsole : 'wolf' tab
Both ways are equivalent
- In case we can't use graphical a user interface
- In automatic scripts
- To debug graphical user interfaces
Main commands¶
- Help
- Syntax : 'help command_name'
- Gives help on a shell command
- Example : help get
- return :
<result cmd="get" status="OK"> <message type="help"> <syntax>get argument_name sub_system_name</syntax> <syntax>get argument_name sub_system_name actor_name</syntax> <syntax>get arguments sub_system_name</syntax> <syntax>get arguments sub_system_name actor_name</syntax> <syntax>get sub_systems</syntax> <syntax>get actors sub_system_name</syntax> </message> </result>
- Launch
- Syntax :
- Within a xterm window :
launch sub_system_name host_name - Without a xterm window :
launch sub_system_name host_name local
- Within a xterm window :
- Initiates the sub-system
- Return
<result cmd ="launch" status ="ok" sub_system_name ="toto"> </result>
- Syntax :
- State machine commands
- Syntax : set action change_state sub_system_name (where change_state is one above)
- configure : configures the sub_system
- load : loads actors and shared libraries if needed
- initialise : initialises the actors
- start : starts the acquisition
- stop : stops the acquisition
- reset_com : resets all components
- unload : unloads shared libraries and shared libraries if some are loaded
- unconfigure : unconfigures the sub_system
- finish : finishes the acquisition and clean the system from the subsystem
- Sets state of NARVAL acquisition
- Syntax : set action change_state sub_system_name (where change_state is one above)
- Get
- Syntax :
- get argument_name sub_system_name
- get argument_name sub_system_name actor_name
- get arguments sub_system_name
- get arguments sub_system_name actor_name
- get sub_systems
- get actors sub_system_name
- Retrieves parameters values from Narval processes
- Syntax :
- Set
- Syntax :
- set argument value sub_system_name
- set argument value sub_system_name actor_name
- Set parameters values in NARVAL processes
- Syntax :
- Errors
Only in case of error, these commands can be used :- full_reset → initialised state
- partial_reset → configured state
- actor_reset → resets actors to their initial state
- commands usable only in narval_shell :
- load : loads a script located at $NARVAL_SCRIPT
- quit : exits narval_shell
Scripting¶
NARVAL shell commands can be used in scripts to automate a NARVAL acquisition- Scripts are located at : $NARVAL_SCRIPTS
- Script can have the same name than the topology file name without the extension
e.g. : $NARVAL_CONF/test.xml → $NARVAL_SCRIPTS/test - Script can have a different name than the topology file name
in that case, a complete acquisition can be launched inside narval_shell. Just type in narval_shell :load my_script
- Script can have the same name than the topology file name without the extension
- A script example can be found at :
/usr/share/doc/narval-doc/examples/run_example
SOAP request¶
SOAP requests can be used to send NARVAL shell commands to the server- Example for requests made in python
- SOAP Header example (for requests made in python)
headers = {"content-type": "text/xml", "charset": "utf-8", "SOAPAction": "Send_Command_With_Arguments"}
- SOAP Body example
<?xml version='1.0' encoding='UTF-8'?> <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <soap:Body> <tns:Send_Command_With_Arguments xmlns:n1="http://soapaws/Narval_Aws_Interface_pkg/" xmlns:tns="http://soapaws/narval_aws_def/"> <Command xsi:type="xsd:string">help get</Command> <Arguments soapenc:arrayType="n1:String_Capsule[1]" xsi:type="soapenc:Array"> <item xsi:type="n1:String_Capsule"> <String_Value xsi:type="xsd:string"></String_Value> </item> </Arguments> </tns:Send_Command_With_Arguments> </soap:Body> </soap:Envelope>
- SOAP Header example (for requests made in python)
Resources¶