Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-7778

Alerts: Expose Alert Notices via REST APIs

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: ambari-server
    • Labels:
      None

      Description

      For every outbound notification, Ambari currently keeps track of the dispatch state (PENDING, DELIVERED, FAILURE). This data needs to be exposed via the REST APIs so that it can be queried.

      http://localhost:8080/api/v1/clusters/c1/alert_notices?fields=*
      http://localhost:8080/api/v1/clusters/c1/alert_notices?AlertNotice/notification_state=DELIVERED&fields=*
      
      {
        "href" : "http://localhost:8080/api/v1/clusters/c1/alert_notices?fields=*",
        "items" : [
          {
            "href" : "http://localhost:8080/api/v1/clusters/c1/alert_notices/1",
            "AlertNotice" : {
              "cluster_name" : "c1",
              "history_id" : 1,
              "id" : 1,
              "notification_state" : "DELIVERED",
              "service_name" : "HDFS",
              "target_id" : 1,
              "target_name" : "Administrators",
              "uuid" : "106ecdb4-0970-4c50-22d3-706d53571321"
            }
          },
          {
            "href" : "http://localhost:8080/api/v1/clusters/c1/alert_notices/2",
            "AlertNotice" : {
              "cluster_name" : "c1",
              "history_id" : 2,
              "id" : 2,
              "notification_state" : "DELIVERED",
              "service_name" : "HDFS",
              "target_id" : 1,
              "target_name" : "Administrators",
              "uuid" : "fffecdb4-0970-4dd0-22d3-706d53571321"
            }
          }
        ]
      }
      
      1. AMBARI-7778.patch
        83 kB
        Jonathan Hurley

        Issue Links

          Activity

          Hide
          hadoopqa Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12675000/AMBARI-7778.patch
          against trunk revision .

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 4 new or modified test files.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in ambari-server.

          Test results: https://builds.apache.org/job/Ambari-trunk-test-patch/207//testReport/
          Console output: https://builds.apache.org/job/Ambari-trunk-test-patch/207//console

          This message is automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12675000/AMBARI-7778.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 4 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in ambari-server. Test results: https://builds.apache.org/job/Ambari-trunk-test-patch/207//testReport/ Console output: https://builds.apache.org/job/Ambari-trunk-test-patch/207//console This message is automatically generated.
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Ambari-trunk-Commit #598 (See https://builds.apache.org/job/Ambari-trunk-Commit/598/)
          AMBARI-7778 - Alerts: Expose Alert Notices via REST APIs (jonathanhurley) (jhurley: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=3befc557a9550f0bff5fce85eacd985b57707138)

          • ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertNoticeResourceDefinition.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProvider.java
          • ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertDefinitionEntity.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
          • ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/AlertNoticeRequest.java
          • ambari-server/src/test/java/org/apache/ambari/server/orm/AlertDaoHelper.java
          • ambari-server/src/main/java/org/apache/ambari/server/events/listeners/AlertReceivedListener.java
          • ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertHistoryEntity_.java
          • ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertTargetEntity_.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceService.java
          • ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProviderTest.java
          • ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProviderTest.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertNoticeService.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProvider.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/DefaultProviderModule.java
          • ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
          • ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertNoticeEntity_.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Ambari-trunk-Commit #598 (See https://builds.apache.org/job/Ambari-trunk-Commit/598/ ) AMBARI-7778 - Alerts: Expose Alert Notices via REST APIs (jonathanhurley) (jhurley: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=3befc557a9550f0bff5fce85eacd985b57707138 ) ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertNoticeResourceDefinition.java ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProvider.java ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertDefinitionEntity.java ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java ambari-server/src/main/java/org/apache/ambari/server/controller/AlertNoticeRequest.java ambari-server/src/test/java/org/apache/ambari/server/orm/AlertDaoHelper.java ambari-server/src/main/java/org/apache/ambari/server/events/listeners/AlertReceivedListener.java ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertHistoryEntity_.java ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertTargetEntity_.java ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceService.java ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProviderTest.java ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertNoticeResourceProviderTest.java ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertNoticeService.java ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertHistoryResourceProvider.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/DefaultProviderModule.java ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertNoticeEntity_.java ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java

            People

            • Assignee:
              jonathan.hurley Jonathan Hurley
              Reporter:
              jonathan.hurley Jonathan Hurley
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development