Having a file create_queue.sh with above statements and execute a command something like: solacectl cli create_queue.sh.
Is there any option to achieve this?
If you are in a location, where you can start cli (eg with: “docker exec -it solace bash”), you can also do:
cli -A -s [SCRIPT_NAME]
Beware: cli is not able to replace any variables (eg your queue name in your example) - if you want do that, you have to do that outside the cli (I would do that in the calling bash script and write the cli-script-file with the correct queue name)
If you need configuration on the Message VPN level (queues, ACLs …) then a good option may be to use SEMPv2 via e.g. Ansible. Ansible then takes care of doing variable substitutions such as broker connection parameters and queue names.
There are some examples/open source projects for Ansible:
Agreed… you should really be using the RESTful SEMPv2 management API, rather than scripting CLI scripts and trying to execute them remotely. It’s much safer, cleaner, and doesn’t run the the risk of leaving the system in a weird/bad state if a CLI script fails halfway through a configuration item. CLI scripts were great 10 years ago, but SEMPv2 is very much the recommended way of going now.
For your example, here’s how you can create a queue with SEMP in a single command:
Can you please create a separate question for this? It will likely get more eyes on it and result in a quicker response than commenting at the end of this thread.