Non-interactive way of declaring devices

Hi,

is it possible to declare a device via the command line?
I would like to get the testing of my device servers automated. Declaring the device in jive is currently the step I have to do manually.

Note: Using SQL on the database is only a last resort for me and not really nice.
Hi Thomas,
A python script could be a good solution.
The database device server exposes everything you need to implement the tool you need.
I'm even sure that a pythonista from the community will attached a piece of code to this topic for you.
N.
Edited 7 years ago
Hi,

I think that tango_admin should be enough. `–add-server` option is also fine for adding devices to a device server already declared in the DB.


$ tango_admin –help

Usage: 
 –help                 Prints this help 
 –ping-database        [max_time (s)] Ping database 
 –check-device <dev>    Check if the device is defined in DB
 –add-server <exec/inst> <class> <dev list (comma separated)>   Add a server in DB
 –delete-server <exec/inst> [–with-properties]   Delete a server from DB
 –check-server <exec/inst>   Check if a device server is defined in DB
 –add-property <dev> <prop_name> <prop_value (comma separated for array)>    Add a device property in DB
 –delete-property <dev> <prop_name>   Delete a device property from DB 
 –tac-enabled Check if the TAC (Tango Access Control) is enabled
 –ping-device <dev> [max_time (s)] Check if the device is running
 –ping-network [max_time (s)] [-v] Ping network

Cheers,
Zibi
PyTango provide all the methods to do so from the python shell.

The fandango api provides a single command to create devices and assign them properties

import fandango as fn
fn.tango.add_new_device('Server/Instance','Class','your/device/name')
fn.tango.put_device_property('your/device/name','Property','Value')

You can also call them from shell:


:> fandango.sh add_new_device Server/Instance Class your/device/name
:> fandango.sh put_device_property your/device/name Property Value

To start it on any host managed by Starter:

:> tango_servers yourhost start Server/Instance
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Edited 7 years ago
Holà Pythonistas!
I now know what tango_admin is made for smile
N.
Thanks all! I knew there is something already available. I'll try tango_admin and report back if there are any issues.
 
Register or login to create to post a reply.