Bug 1231345 - [Docs] [REST] Rest API documentation lists two events with the same event code: 524
Summary: [Docs] [REST] Rest API documentation lists two events with the same event cod...
Keywords:
Status: CLOSED DUPLICATE of bug 1122727
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: Documentation
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-3.6.1
: 3.6.1
Assignee: rhev-docs@redhat.com
QA Contact:
URL:
Whiteboard: docs
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-12 18:43 UTC by Joe Rafaniello
Modified: 2016-02-10 18:56 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Build: CSProcessor Builder Version 1.10 Build Name: 20664, Developer Guide-3.2-1 Build Date: 13-08-2013 17:03:22 Topic ID: 9076-365086 [Specified]
Last Closed: 2015-11-12 07:44:37 UTC
oVirt Team: Docs
Target Upstream Version:


Attachments (Terms of Use)

Description Joe Rafaniello 2015-06-12 18:43:57 UTC
Title: Event Codes

Describe the issue: The rest api documentation lists two events with the 524 vent code.  It's unclear if this is a documentation bug, a code bug, or expected behavior.  I'm not sure which is correct.

The documentation found here [1] has these two entries in table E.1:

524	AUTO_SUSPEND_VM
524	HOST_DOMAIN_DELAY_INTERVAL

[1] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.2/html-single/Developer_Guide/index.html
Suggestions for improvement:


Additional information:

Comment 1 Juan Hernández 2015-06-15 08:29:20 UTC
I think that it is a bug in the documentation, as there isn't any "AUTO_SUSPEND_VM" event in the code.

To obtain an up to date list of event codes and names use the following Java program:

---8<---
// Save to a ListAuditLogTypes.java file.
import org.ovirt.engine.core.common.AuditLogType;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class ListAuditLogTypes {
    public static void main(String[] args) {
        List<AuditLogType> types = new ArrayList<>();
        Collections.addAll(types, AuditLogType.values());
        Collections.sort(
            types,
            new Comparator<AuditLogType>() {
                @Override
                public int compare(AuditLogType left, AuditLogType right) {
                    return Integer.compare(left.getValue(), right.getValue());
                }
            }
        );
        for (AuditLogType type : types) {
            System.out.printf("%s\t%s\n", type.getValue(), type.name());
        }
    }
}
--->8---

Save this to a ListAuitLogTypes.java file and compile it with the following command (in a machine where RHEV-M is installed):

  $ javac -cp /usr/share/java/ovirt-engine/common.jar ListAuditLogTypes.java

Then run it with the following command:

  $ java -cp /usr/share/java/ovirt-engine/common.jar:. ListAuditLogTypes

It should produce a list of the event codes and names, sorted by event code:

  0       UNASSIGNED
  1       VDC_START
  2       VDC_STOP
  12      VDS_FAILURE
  ...

Comment 2 Joe Rafaniello 2015-06-15 14:51:44 UTC
Juan, thank you!

Comment 3 Yaniv Lavi 2015-11-12 07:44:37 UTC

*** This bug has been marked as a duplicate of bug 1122727 ***


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