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

Alerts: Create Group and Target REST Endpoints

    Details

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

      Description

      Add the initial REST endpoints for interacting with alert targets and groups.

        Issue Links

          Activity

          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Ambari-trunk-Commit #492 (See https://builds.apache.org/job/Ambari-trunk-Commit/492/)
          AMBARI-7021 - Alerts: Create Group and Target REST Endpoints (jonathanhurley) (jhurley: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=4a4644b882c9a0d39b249db5a106f7075cb0c93d)

          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertGroup.java
          • ambari-server/src/main/resources/key_properties.json
          • ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertTargetService.java
          • ambari-server/src/main/resources/properties.json
          • ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertGroupService.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
          • ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py
          • ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
          • ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py
          • ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProviderTest.java
          • ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertTarget.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProvider.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
          • ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertGroupResourceDefinition.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/TargetType.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertTargetResourceDefinition.java
          • ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProviderTest.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Ambari-trunk-Commit #492 (See https://builds.apache.org/job/Ambari-trunk-Commit/492/ ) AMBARI-7021 - Alerts: Create Group and Target REST Endpoints (jonathanhurley) (jhurley: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=4a4644b882c9a0d39b249db5a106f7075cb0c93d ) ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertGroup.java ambari-server/src/main/resources/key_properties.json ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertTargetService.java ambari-server/src/main/resources/properties.json ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertGroupService.java ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProviderTest.java ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertTarget.java ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProvider.java ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java ambari-server/src/test/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostTest.java ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertGroupResourceDefinition.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/TargetType.java ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertTargetResourceProvider.java ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertTargetResourceDefinition.java ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProviderTest.java ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
          Hide
          jonathan.hurley Jonathan Hurley added a comment -

          Example of the AlertGroup endpoints:

          GET api/v1/clusters/c1/alert_groups

          {
            "href" : "http://localhost:8080/api/v1/clusters/c1/alert_groups",
            "items" : [
              {
                "href" : "http://localhost:8080/api/v1/clusters/c1/alert_groups/3",
                "AlertGroup" : {
                  "cluster_name" : "c1",
                  "default" : false,
                  "id" : 3,
                  "name" : "HDFS Critical Ones"
                }
              },
              {
                "href" : "http://localhost:8080/api/v1/clusters/c1/alert_groups/10",
                "AlertGroup" : {
                  "cluster_name" : "c1",
                  "default" : false,
                  "id" : 10,
                  "name" : "Test"
                }
              }
            ]
          }
          

          GET api/v1/clusters/c1/alert_groups/10

          {
            "href" : "http://localhost:8080/api/v1/clusters/c1/alert_groups/10",
            "AlertGroup" : {
              "cluster_name" : "c1",
              "default" : false,
              "definitions" : [
                {
                  "name" : "namenode_process",
                  "label" : "NameNode Process",
                  "service_name" : "HDFS",
                  "component_name" : "NAMENODE",
                  "id" : 4
                },
                {
                  "name" : "secondary_namenode_process",
                  "label" : "Secondary NameNode Process",
                  "service_name" : "HDFS",
                  "component_name" : "SECONDARY_NAMENODE",
                  "id" : 2
                },
                {
                  "name" : "datanode_process",
                  "label" : "DateNode Process",
                  "service_name" : "HDFS",
                  "component_name" : "DATANODE",
                  "id" : 3
                }
              ],
              "id" : 10,
              "name" : "Test",
              "targets" : [
                {
                  "name" : "Administrators",
                  "properties" : null,
                  "id" : 4,
                  "description" : "The Admins",
                  "notification_type" : "EMAIL"
                }
              ]
            }
          }
          

          GET v1/alert_targets

          {
            "href" : "http://localhost:8080/api/v1/alert_targets",
            "items" : [
              {
                "href" : "http://localhost:8080/api/v1/alert_targets/4",
                "AlertTarget" : {
                  "id" : 4,
                  "name" : "Administrators"
                }
              }
            ]
          }
          

          GET v1/alert_targets/4

          {
            "href" : "http://localhost:8080/api/v1/alert_targets/4",
            "AlertTarget" : {
              "description" : "The Admins",
              "id" : 4,
              "name" : "Administrators",
              "notification_type" : "EMAIL",
              "properties" : null
            }
          }
          
          Show
          jonathan.hurley Jonathan Hurley added a comment - Example of the AlertGroup endpoints: GET api/v1/clusters/c1/alert_groups { "href" : "http: //localhost:8080/api/v1/clusters/c1/alert_groups" , "items" : [ { "href" : "http: //localhost:8080/api/v1/clusters/c1/alert_groups/3" , "AlertGroup" : { "cluster_name" : "c1" , " default " : false , "id" : 3, "name" : "HDFS Critical Ones" } }, { "href" : "http: //localhost:8080/api/v1/clusters/c1/alert_groups/10" , "AlertGroup" : { "cluster_name" : "c1" , " default " : false , "id" : 10, "name" : "Test" } } ] } GET api/v1/clusters/c1/alert_groups/10 { "href" : "http: //localhost:8080/api/v1/clusters/c1/alert_groups/10" , "AlertGroup" : { "cluster_name" : "c1" , " default " : false , "definitions" : [ { "name" : "namenode_process" , "label" : "NameNode Process " , "service_name" : "HDFS" , "component_name" : "NAMENODE" , "id" : 4 }, { "name" : "secondary_namenode_process" , "label" : "Secondary NameNode Process " , "service_name" : "HDFS" , "component_name" : "SECONDARY_NAMENODE" , "id" : 2 }, { "name" : "datanode_process" , "label" : "DateNode Process " , "service_name" : "HDFS" , "component_name" : "DATANODE" , "id" : 3 } ], "id" : 10, "name" : "Test" , "targets" : [ { "name" : "Administrators" , "properties" : null , "id" : 4, "description" : "The Admins" , "notification_type" : "EMAIL" } ] } } GET v1/alert_targets { "href" : "http: //localhost:8080/api/v1/alert_targets" , "items" : [ { "href" : "http: //localhost:8080/api/v1/alert_targets/4" , "AlertTarget" : { "id" : 4, "name" : "Administrators" } } ] } GET v1/alert_targets/4 { "href" : "http: //localhost:8080/api/v1/alert_targets/4" , "AlertTarget" : { "description" : "The Admins" , "id" : 4, "name" : "Administrators" , "notification_type" : "EMAIL" , "properties" : null } }

            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