Code Monkey home page Code Monkey logo

Comments (7)

kavyanekkalapu avatar kavyanekkalapu commented on July 17, 2024

cc @Fryguy

from manageiq-api.

kavyanekkalapu avatar kavyanekkalapu commented on July 17, 2024

@miq-bot assign @Fryguy

from manageiq-api.

Fryguy avatar Fryguy commented on July 17, 2024

So, as discussed, we should drop the Timelines tab from the server diagnostics as those are redundant with just navigating to the server's VM and looking at the timelines there. This is in ManageIQ/manageiq-ui-classic#7940


For the upper portion, the dropdown data comes from EventStream.events_groups and EventStream::GROUP_LEVELS, so we need to expose that over the API.

I think the tricky part is that while we have the EventStream.group_and_level method that was built for lookup purposes (to handle regexes, for example), the UI built their own lookup stuff in app/controllers/application_controller/timelines/options.rb. An event has a virtual column for the group, so that may be sufficient, if the event record from the API is queried. However, we may want some options for the events API to filter by group and level, where we can do the work on the API side to filter them out.

from manageiq-api.

Fryguy avatar Fryguy commented on July 17, 2024

Discussed a bit with @jrafanie...


For the dropdowns, something like this would be expected

OPTIONS /api/event_streams

{
  "EmsEvent": {
    "description": "Management Events",
    "group_names": {
      vm_operation: "Vm Operations",
      ...
    },
    "group_levels": {
      critical: "Critical",
      ...
    } 
  },
  "MiqEvent": {
    "description": "Policy Events",
    "group_names": {}
    "group_levels": {
      success: "Success",
      failure: "Failure"
    } 
...

The MiqEvent group names are MiqEventDefinitionSet.pluck(:name, :description).to_h, and the EmsEvent group names are already available in EventStream.event_groups.

We should create a consistent interface at the model level of each of these (and perhaps all of the other subclasses of EmsEvent as a follow up) that can return this group and level information. Then the API can roughly do EmsEvent.subclasses.map { |c| [c.name, c.group_and_level_details] }.to_h


For the querying we already have the event_streams endpoint, and it can filter on group_level, group_name, timestamp, etc. For example:

/api/event_streams?expand=resources&attributes=group,group_level,group_name&filter[]=host_id=25&filter[]=group_level=critical

We may want to have event stream as a subcollection on host and vms if they are not there already.


One other small feature is that the calendar shown defaults its value to the "last event" timestamp that was collected (via the method first_and_last_event. However, considering we are planning to change that date portion of the timelines UI, I'm not certain we need that anymore. If we do it can be added as a follow up somehow.

from manageiq-api.

jrafanie avatar jrafanie commented on July 17, 2024

Test that you can filter event_streams based on group_names/group_levels which are different for each EventStream subclass. For example, group names such as ems_operation/host_operations/compliance (MiqEvent) in addition to the EmsEvent ones: addition/configuration/console. Same for group levels: sucess/failure (MiqEvent) and critical/detail/warning (EmsEvent).

This works: http://localhost:3000/api/event_streams?expand=resources&attributes=group,group_level,group_name,id,event_type,message,ems_id,type&filter[]=group_level=critical&filter[]=or%20group_level=detail&limit=5000&offset=3000

(ignore the limit/offset, that's what I needed to get the correct records to come back in my test)

RESPONSE:

{
    "name": "event_streams",
    "count": 3770,
    "subcount": 770,
    "subquery_count": 3770,
    "pages": 4,
    "resources": [
        {
            "href": "http://localhost:3000/api/event_streams/6420780",
            "id": "6420780",
            "event_type": "request_starting",
            "message": null,
            "ems_id": null,
            "type": "RequestEvent",
            "group": "other",
            "group_level": "detail",
            "group_name": "Other"
        },
...
        {
            "href": "http://localhost:3000/api/event_streams/8534148",
            "id": "8534148",
            "event_type": "HOST_AVAILABLE_UPDATES_FAILED",
            "message": "Failed to check for available updates on host dell-r420-05 with message 'Failed to run check-update of host '10.8.96.15'.'.",
            "ems_id": "56",
            "type": "EmsEvent",
            "group": "other",
            "group_level": "detail",
            "group_name": "Other"
        },
        {
            "href": "http://localhost:3000/api/event_streams/8534149",
            "id": "8534149",
            "event_type": "VmCreatedEvent",
            "message": "Failed to check for available updates on host dell-r420-04 with message 'Failed to run check-update of host '10.8.96.14'.'.",
            "ems_id": "56",
            "type": "EmsEvent",
            "group": "addition",
            "group_level": "critical",
            "group_name": "Creation/Addition"
        }
    ],
    "actions": [
        {
            "name": "query",
            "method": "post",
            "href": "http://localhost:3000/api/event_streams"
        }
    ],
    "links": {
        "self": "http://localhost:3000/api/event_streams?expand=resources&attributes=group,group_level,group_name,id,event_type,message,ems_id,type&filter[]=group_level=critical&filter[]=or%20group_level=detail&limit=5000&offset=3000",
        "previous": "http://localhost:3000/api/event_streams?expand=resources&attributes=group,group_level,group_name,id,event_type,message,ems_id,type&filter[]=group_level=critical&filter[]=or%20group_level=detail&limit=5000&offset=2000",
        "first": "http://localhost:3000/api/event_streams?expand=resources&attributes=group,group_level,group_name,id,event_type,message,ems_id,type&filter[]=group_level=critical&filter[]=or%20group_level=detail&limit=5000&offset=0",
        "last": "http://localhost:3000/api/event_streams?expand=resources&attributes=group,group_level,group_name,id,event_type,message,ems_id,type&filter[]=group_level=critical&filter[]=or%20group_level=detail&limit=5000&offset=3000"
    }
}

from manageiq-api.

miq-bot avatar miq-bot commented on July 17, 2024

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

from manageiq-api.

miq-bot avatar miq-bot commented on July 17, 2024

This issue has been automatically closed because it has not been updated for at least 3 months.

Feel free to reopen this issue if this issue is still valid.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

from manageiq-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.