Bug 1482501 - system.listSystemEvents API call doesn't return all items from system's history
Summary: system.listSystemEvents API call doesn't return all items from system's history
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 580
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gennadii Altukhov
QA Contact: Martin Korbel
URL:
Whiteboard:
Depends On:
Blocks: sat58-errata sat58-nth
TreeView+ depends on / blocked
 
Reported: 2017-08-17 12:33 UTC by Radovan Drazny
Modified: 2018-02-05 13:56 UTC (History)
4 users (show)

Fixed In Version: spacewalk-java-2.5.14-108-sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-05 13:56:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0274 0 normal SHIPPED_LIVE Red Hat Satellite 5.8.0 bug fix update 2018-02-09 23:18:15 UTC

Description Radovan Drazny 2017-08-17 12:33:50 UTC
Description of problem:
When comparing history displayed in the WebUI (../rhn/systems/details/history/History.do?sid=SID&) and list of history items returned by system.listSystemEvents API call, the API call is missing all items with status (n/a). 

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

How reproducible:
always


Steps to Reproduce:
1. Register a new system to a Satellite server
2. Check the ../rhn/systems/details/history/History.do?sid=SID& for the the system
3. Run client.system.listSystemEvents(key, SID) API call.

Actual results:
While there are two system events in the WebUI ("subscribed to channel rhel-x86_64-server-X" and  "added system entitlement"), result of the API call is empty.

Expected results:
API call returns a list containing same items as displayed in the WebUI. 

Additional info:
API call currently returns only items with a exit status (non n/a status). If you schedule a package install on the newly registered system, run rhn_check on the client, and then run system.listSystemEvents API call, you will get list containing only one item (package install that just finished). WebUI will contain three system items, of course (reg, entitlement and package install).

Comment 1 Jiří Dostál 2017-08-17 14:18:18 UTC
I suppose the behavior is correct. In UI when you visit '/rhn/schedule/*', you can list real *scheduled* events. On page '/rhn/systems/details/history/History.do' you get system event history, including items describing "what happened to the system" ie. "Subscription via Token". And I think System History != Events. API to get System History is getEventHistory(key, system_id). 

However, it is quite confusing in API documentation, where we have "List all system events for given server. This includes *all* events for the server since it was registered". 

It'd be nice to update API docs to keep it clear. Keeping BZ opened for docs update.

Comment 2 Tomas Lestach 2017-08-18 11:29:17 UTC
Jiri, feel free to update the docs within this BZ.

Comment 3 Gennadii Altukhov 2017-11-29 09:47:01 UTC
upstream fix, spacewalk.git:
c2e06af6f535f67660beda6eafa1fc6272a43a3c

Comment 6 Martin Korbel 2018-01-12 10:32:10 UTC
VERIFIED on spacewalk-java-2.5.14-108

listSystemEvents
List system actions of the specified type that were *scheduled* against the given server. "actionType" should be exactly the string returned in the action_type field from the listSystemEvents(sessionKey, serverId) method. For example, 'Package Install' or 'Initiate a kickstart for a virtual guest.' Note: see also system.getEventHistory method which returns a history of all events.

Comment 9 errata-xmlrpc 2018-02-05 13:56:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0274


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