Need to create/push scripts to HPSA via pytwist code from a managed server
I am new to this forum and am looking forward to hear from you on my query.
I have a requirement to push new server scripts to HPSA va pytwist API... i see that the pytwist can be run from a managed server in hpsa .Can any of you help me out with this setup ?
Similarly i should be able to pull the script information from hpsa via pytwist, add new scripts (to a specific folder), update existing scripts, etc.
You should look into the methods available in the ServerScriptService interface under opt.opsware.script.
I believe you'll find everything you need in there.
I did have a look at the methods in there ... to create a server script..
but am not quite sure as to how to write it and call the service and how to provide the arguments, attributes, etc... for Create Server script. Thought someone mght have already worked on it and can provide me an example of how it can be done.
You can find examples of different twist clients here: https://softwaresupport.softwaregrp.com/km/KM00417670
Also there is a whole chapter of the online doc dedicated to development on SA. I believe you will find this section useful: https://docs.microfocus.com/itom/Server_Automation:2018.08/API_Unified/pytwist_1
Can you also provide me with any examples around the serverscript service using pytwist ? or guide me on where to find them? I have the code to search for a specific script, pull all the scripts etc... but i want a pytwist code to upload a new script to SA.
Dimiter Todorov's repository on GitHub is good reference for Twister-based Python scripts.
This one seems to handle executing/creating scripts:
That script references his function library:
As a side note, using the API via the Web Services interface allows you to run code from
any device on the network.
Thanks for the github links. I see there is a code related to create/execute scripts in it. will tweak it a bit and try it out to see if it works for me. Thanks again ! 🙂