RaphAlv Respected Contributor.
Respected Contributor.

Remove Software Automate Calls

Trying to automate the software removal by method tru SA, according to help/usage goes below:
/opsw/Server/@/<myserver>/method/startUninstallSoftware --help

So far I understood, that requires
software policy name, containing software to remove?
the installables (which I guess is exactly the MSI/EXE) from the inventory pushed by bs_software run?
userTag ???
notification ???
schedule is when job starts, but what format is this?

Could you please inform an instance of this? There is no documentation inside 'HP SA - Developer Guide.pdf' concerning this action.


4 Replies
Micro Focus Expert
Micro Focus Expert

Re: Remove Software Automate Calls

A software uninstall works the same way as a software install.  I don't an uninstall example to hand but I do have an install.   I would suggest you code in python for this activity instead of trying to use the OGFS api's and shell script to do the same task.

The API is documented in more detail via  https://coreip/twister  the same Java API documentation is applicable to pytwist and the OGFS methods you just need to do a little conversion.

import pytwist
from pytwist.com.opsware.swmgmt import SoftwareInstallJobArgument
from pytwist.com.opsware.swmgmt import InstallableAttachableEntry
from pytwist.com.opsware.pkg import ZIPRef
from pytwist.com.opsware.server import ServerRef
t = pytwist.twistserver.TwistServer()
t.authenticate("user", "password")
s = SoftwareInstallJobArgument()
e = InstallableAttachableEntry()
print t.swmgmt.SoftwarePolicyService.startInstallSoftware(s)

 A Job schedule can be setup like this

import time
from pytwist.com.opsware.job import JobSchedule
jobSchedule = JobSchedule()
jobSchedule.setStartDate(long(time.time() + 60)) # run it 1 minute from now

 The userTag is just some arbitrary piece of data you wish to be associated with the JOB you are submitting to SA.   This might be your companies internal TICKET number associated with the request.

Michael_it Honored Contributor.
Honored Contributor.

Re: Remove Software Automate Calls

./startUninstallSoftware installables:i="com.opsware.pkg.ZIPRef:<packageobjectid>" userTag=deinstall3


when you call startUninstallPackage   within the path of the server (e.g. /opsw/Server/@/<servername>/method) you don't need to specify self. self is only needed when you start the method from /opsw/api/com/opsware/.....


the installables takes an array of packages you want to remove :i says you specify them by id. as installables accepts different types packages you need to specify the exact type of the reference object

e.g. com.opsware.pkg.ZIPRef


see twister api Doc




ID is the objectID of the package


userTag is just a name for the job will show up in Ticket ID of the Job


RaphAlv Respected Contributor.
Respected Contributor.

Re: Remove Software Automate Calls

Thanks Michael
packageobjectid could be gathered by 'method/getInstalledSoftware', at least that's the reason to list software details. In https://coreserverip/twister/docs/index.html there is no field of Id.
Basically MSI type collects some of the below, anyway trying to code something with WMIC utility to remove

method/getInstalledSoftware outcome is...
packageName="Microsoft Visual Studio Setup Configuration"
name="Microsoft Visual Studio Setup Configuration"
displayName="Microsoft Visual Studio Setup Configuration"
beginDate="2017/10/18 15:34:40.000"

Michael_it Honored Contributor.
Honored Contributor.

Re: Remove Software Automate Calls

if i get it correctly you try to desinstall a software which was not managed by SA. so installed outside of SA.

the function startUninstallSoftware is deinstalling software that has a package representation in SA. i dont think you can deinstall "unmanaged" SW that way. in case of an MSI you might be able to get it done by first creating a package represenation in SA get SA to recognize its already installed…. a proper MSI should not be installed again… then you could use uninstall…. but when you really just want to get it deinstalled call msiexec /uninstall <file.msi> 

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.