Description of problem: As we prefer one issue per Bz, I am moving the customer request from Bug 910739 # Comment 3 here. Customer with case #00902410 is requesting to add following, <from API> Method: scheduleApplyErrata Description: Schedules an action to apply errata updates to multiple systems. Parameters: • string sessionKey • array: ◦int - serverId • array: ◦int - errataId Returns: • int - 1 on success, exception thrown otherwise. </from API> so the above allows for ***multiple*** serverId's in a single API call. It does return a 1 and we'd like an action id so we can get a status on which machines have been remediated. The below call is the current <from API> -------------------------------------------------------------------------------- Method: schedulePackageInstall Description: Schedule package installation for a system. Parameters: • string sessionKey • int serverId • array: ◦int - packageId • dateTime.iso8601 earliestOccurrence Returns: • int - 1 on success, exception thrown otherwise. </from API> so what we would ideally like is within a ***single*** call specify multiple system id's ***and*** get an actionID returned so we can use it to check status on ***all** systems. As you can see from the above we'd ideally like the following: from UBS> Method: schedulePackageInstall Description: Schedule package installation for multiple systems. Parameters: • string sessionKey • array: ◦int - serverId • array: ◦int - packageId Returns: • int - ID of the action scheduled, otherwise exception thrown on error </from UBS> ...and then the obvious API call that we can send the actionID (perhaps a liskPackageActions)and get a status on all systems associated with that actionID. Impact: We currently use customized tools to schedule package installs which based on the above isn't ideal as its an individual api call for each server, imaging a package install schedules for 5000+ systems. We then have another call which uses the time stamp of the scheduled job to find the systems and get the job status from them, this again is one per system. Justification: We use the "schedulePackageInstall" often on a daily basis, and is our most frequently internally used function and most important. Having the functionality outlined above would not only be beneficialy for BUS but certainly for most other customers that make use of the API.
system.scheduleApplyErrata with the option to specify list of servers and list of errata is available since Jul 2010. It was added via spacewalk commit: 1811f27e1ee15b2d099809c7d67b0f9e6e2f3f2b
system.schedulePackageInstall is to be implemented Please, include the namespace, when writing about the API calls.
TESTED on Satellite-5.7.0-RHEL6-re20141001.0 (spacewalk-java-2.3.8-28.el6sat) The method works fine good, but in documentation, there is mistake (/rhn/apidoc/handlers/SystemHandler.jsp#schedulePackageInstall). This method does not return integer, but array of integers. <API DOC> Method: schedulePackageInstall Description: Schedule package installation for a system. Parameters: string sessionKey array: int - serverId array: int - packageId dateTime.iso8601 earliestOccurrence Returns: int actionId - The action id of the scheduled action </API DOC> Reproducer: #!/usr/bin/python import xmlrpclib import datetime SATELLITE_URL = "http://localhost/rpc/api" SATELLITE_LOGIN = "admin" SATELLITE_PASSWORD = "xxx" client = xmlrpclib.Server(SATELLITE_URL, verbose=0) key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD) print "------- One system -------------" print client.system.schedulePackageInstall(key, 1000010016, [81, 3899], datetime.datetime.now()) print "------- Multi systems -------------" print client.system.schedulePackageInstall(key, [1000010016, 1000010018], [2940, 39], datetime.datetime.now()) client.auth.logout(key) Output: ------- One system ------------- 86 ------- Multi systems ------------- [87, 88]
For the record system.schedulePackageInstall was implemented in Jun 2014 ... spacewalk.git: 6b84302fec6ff558e31807e09259e02f51607c82 Fix of the issue described in Comment#3 ... spacewalk.gitL
VERIFIED on Satellite-5.7.0-RHEL6-re20141017.0 (spacewalk-java-2.3.8-44.el6sat) <API DOC> Method: schedulePackageInstall Description: Schedule package installation for a system. Parameters: string sessionKey array: int - serverId array: int - packageId dateTime.iso8601 earliestOccurrence Returns: array: int - actionId </API DOC>
*** Bug 1000033 has been marked as a duplicate of this bug. ***
Reverified with spacewalk-java-2.3.8-96.el6sat.noarch >>> systems = [1000010080, 1000010083] >>> packages = [33218, 33135] >>> print client.system.schedulePackageInstall(key, systems, packages, datetime.now() ) [1229, 1230]