[ https://issues.apache.org/jira/browse/AMBARI-8623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14242190#comment-14242190 ]
Hudson commented on AMBARI-8623: -------------------------------- SUCCESS: Integrated in Ambari-trunk-Commit-docker #449 (See [https://builds.apache.org/job/Ambari-trunk-Commit-docker/449/]) AMBARI-8623 - Alert Host Count Summary Exposed Via Cluster Endpoint (jonathanhurley) (jhurley: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=a51afbe54e1588b945dc1d879e3298dc829e5c04) * ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertHostSummaryDTO.java * ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertSummaryPropertyProvider.java * ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java * ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertsDAOTest.java * ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java > Alert Host Count Summary Exposed Via Cluster Endpoint > ----------------------------------------------------- > > Key: AMBARI-8623 > URL: https://issues.apache.org/jira/browse/AMBARI-8623 > Project: Ambari > Issue Type: Task > Components: alerts, ambari-server > Affects Versions: 2.0.0 > Reporter: Jonathan Hurley > Assignee: Jonathan Hurley > Fix For: 2.0.0 > > Attachments: AMBARI-8623.patch > > > In Ambari-1.7.0 the cluster endpoint used to have a summary of host-counts by > severity. We need such a field in Ambari-2.0.0. > {code} > alerts: { > summary: { > CRITICAL: 1, > OK: 4, > PASSIVE: 0, > WARNING: 0 > } > } > {code} > The alerts_summary structure currently returned by the 2.0.0 API are the > summary counts of alerts in the system, not those of the hosts. There are > alerts that don't have a host (such as aggregate alerts). > In order to expose the host alert count, there are two ways to do this: > 1) Add a new field to the cluster endpoint; something like > {{alerts_host_summary}} > {noformat} > http://localhost:8080/api/v1/clusters/c1?fields=alerts_host_summary > { > "href" : > "http://localhost:8080/api/v1/clusters/c1?fields=alerts_host_summary", > "Clusters" : { > "cluster_name" : "c1", > "version" : "HDP-2.2" > }, > "alerts_host_summary" : { > "CRITICAL" : 1, > "OK" : 41, > "UNKNOWN" : 0, > "WARNING" : 0 > } > } > {noformat} > 2) Provide a new formatter to display the alerts formatted by host: > {noformat} > http://localhost:8080/api/v1/clusters/c1/alerts?format=hostSummary > { > "href" : > "http://localhost:8080/api/v1/clusters/c1/alerts?format=hostSummary", > "alerts_summary" : { > "CRITICAL" : { > "count" : 1, > "original_timestamp" : 1418150735812 > }, > "OK" : { > "count" : 41, > "original_timestamp" : 1418151145325 > }, > "UNKNOWN" : { > "count" : 0, > "original_timestamp" : 0 > }, > "WARNING" : { > "count" : 0, > "original_timestamp" : 0 > } > } > } > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)