Bug 484262

Summary: API doc minor changes for system.getEventHistory
Product: Red Hat Satellite 5 Reporter: Sayli Karmarkar <skarmark>
Component: APIAssignee: Jay Dobies <jason.dobies>
Status: CLOSED CURRENTRELEASE QA Contact: Sayli Karmarkar <skarmark>
Severity: low Docs Contact:
Priority: low    
Version: 530CC: cperry, jason.dobies, jpazdziora
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:54:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 456996    

Description Sayli Karmarkar 2009-02-05 18:08:01 UTC
Description of problem:
system.getEventHistory API doc says:

Description:
Returns a list history items associated with the system, ordered from oldest to newest. 
...

Returns:

    * array:
          o struct - History Event
                + dateTime.iso8601 "completed" - Date that the event occurred (optional)
                + string "summary" - Summary of the event
                + string "details" - Details of the event


There are two minor modifications needed in the doc:

1. Description should say that it returns list of history items ordered from "newest to oldest" and NOT oldest to newest. I can see the most recent event first event in the list. 
  
2. Details do return details of the events for instant events like registration, channel subscription. However, it returns blank for scheduled events like package upgrade. Its expected as two events are entirely different types and scheduled event details can be obtained by system.listSystemEvents. However, I think we should specify it in the API doc.

Comment 1 Jay Dobies 2009-02-12 21:42:19 UTC
One thing I'd like to investigate further in the future, I'm not sure the details have to be empty for events coming out of rhnAction. Below is the relevant chunk of the query (Action_queries:system_events_history)

SELECT SA.action_id EVENT_ID,
               AType.name || ' scheduled by ' || NVL(U.login, '(none)') AS SUMMARY,
               SA.created,
               SA.pickup_time AS picked_up,
               SA.completion_time AS completed,
               AStat.name AS history_status,
               AType.label AS history_type,
               AType.name AS history_type_name,
	       NULL AS details
          FROM rhnActionType AType,
               rhnActionStatus AStat,
               rhnUser U,
               rhnAction A,
               rhnServerAction SA

I think we can change the "NULL AS details" line to pull in rhnServerAction.result_msg to use as the details.

Comment 2 Jay Dobies 2009-02-12 21:49:54 UTC
Commit: 953dd70758b05d226315531d157768c7c6d5d0c8

Updated the docs are suggested.

Comment 3 Sayli Karmarkar 2009-02-24 15:34:31 UTC
Verified.
I can see API description now as :

"Returns a list history items associated with the system, ordered from newest to oldest. Note that the details may be empty for events that were scheduled against the system (as compared to instant). For more information on such events, see the system.listSystemEvents operation."

~SayliK

Comment 4 Jan Pazdziora 2009-08-19 15:34:10 UTC
With install Satellite-5.3.0-RHEL5-re20090730.0, the /rhn/apidoc/handlers/SystemHandler.jsp#getEventHistory page says

 Method: getEventHistory
Description:
Returns a list history items associated with the system, ordered from newest to oldest. Note that the details may be empty for events that were scheduled against the system (as compared to instant). For more information on such events, see the system.listSystemEvents operation.

Parameters:

    * string sessionKey
    * int serverId

Returns:

    * array:
          o struct - History Event
                + dateTime.iso8601 "completed" - Date that the event occurred (optional)
                + string "summary" - Summary of the event
                + string "details" - Details of the event

Stage validated.

Comment 5 Brandon Perkins 2009-09-10 19:54:28 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html