Bug 1414406 - API system.schedulePackageInstallByNevra and system.schedulePackageRemoveByNevra has wrong documentation
Summary: API system.schedulePackageInstallByNevra and system.schedulePackageRemoveByNe...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 580
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Dobes
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks: sat580-low
TreeView+ depends on / blocked
 
Reported: 2017-01-18 12:33 UTC by Ales Dujicek
Modified: 2017-06-21 12:09 UTC (History)
1 user (show)

Fixed In Version: spacewalk-java-2.5.14-83
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-21 12:09:32 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Ales Dujicek 2017-01-18 12:33:41 UTC
Description of problem:


both variants of schedulePackageInstallByNevra and schedulePackageRemoveByNevra 
API has wrong parameters description in documentation


for example:
<satelite>/rhn/apidoc/handlers/SystemHandler.jsp#schedulePackageInstallByNevra

list of api function parameters:

    string sessionKey
    array:
        int - serverId
    array:
        struct - Package nevra
            string "package_name"
            string "package_epoch"
            string "package_version"
            string "package_release"
            string "package_arch"
    array:
        int - packageId
    dateTime.iso8601 earliestOccurrence


but call

dat = xmlrpclib.DateTime(datetime.datetime.today())
client.system.schedulePackageInstallByNevra(key, system_id, [
        {
                "package_name": 'abrt-desktop',
                "package_epoch": '0',
                "package_version": '2.0.8',
                "package_release": '40.el6',
                "package_arch": 'x86_64'
}], [], dat)

produces

xmlrpclib.Fault: <Fault -1: 'redstone.xmlrpc.XmlRpcFault: Could not find method: schedulePackageInstallByNevra in class: com.redhat.rhn.frontend.xmlrpc.system.SystemHandler with params: [com.redhat.rhn.domain.user.legacy.UserImpl, java.lang.Integer, redstone.xmlrpc.XmlRpcArray, redstone.xmlrpc.XmlRpcArray, java.util.Date]'>


function definition has no "array: int - packageId" parameter

java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
public Long schedulePackageInstallByNevra(User loggedInUser, final Integer sid,
            List<Map<String, String>> packageNevraList, Date earliestOccurrence)


Version-Release number of selected component (if applicable):
spacewalk-java-2.5.14-46.el6sat.noarch

How reproducible:
always

Comment 1 Lukáš Hellebrandt 2017-05-10 10:16:42 UTC
PR: https://github.com/spacewalkproject/spacewalk/pull/539

Comment 2 Jan Dobes 2017-05-10 11:24:39 UTC
fixed in spacewalk master:

32509cf0debe1ab346de9029653958a528d1e2c6

Comment 5 Lukáš Hellebrandt 2017-05-18 12:31:31 UTC
This is merely a comment/docs change, so verifying with spacewalk-java-2.5.14-84.el6sat.noarch .

Both versions of both API calls now do not have the packageId argument shown in API help anymore.


Note You need to log in before you can comment on or make changes to this bug.