ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hurley" <jhur...@hortonworks.com>
Subject Review Request 27331: Show all properties for source subresource in alert_definitions API response
Date Wed, 29 Oct 2014 15:17:05 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27331/
-----------------------------------------------------------

Review request for Ambari, Aleksandr Kovalenko and Nate Cole.


Bugs: AMBARI-8018
    https://issues.apache.org/jira/browse/AMBARI-8018


Repository: ambari


Description
-------

The source subproperties should be available when the source itself is requested to be return
on an alert defintion resource:

Currently response for http://c6401.ambari.apache.org:8080/api/v1/clusters/c/alert_definitions?fields=*
is:
    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/c/alert_definitions?fields=*",
      "items" : [
        {
          "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/c/alert_definitions/1",
          "AlertDefinition" : {
            "cluster_name" : "c",
            "component_name" : "HISTORYSERVER",
            "enabled" : true,
            "id" : 1,
            "interval" : 1,
            "label" : "History Server Web UI",
            "name" : "mapreduce_history_server_webui",
            "scope" : "ANY",
            "service_name" : "MAPREDUCE2",
            "source" : {
              "type" : "WEB"
            }
          }
        }...
    }

but should be

    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/c/alert_definitions/1",
      "AlertDefinition" : {
        "cluster_name" : "c",
        "component_name" : "HISTORYSERVER",
        "enabled" : true,
        "id" : 1,
        "interval" : 1,
        "label" : "History Server Web UI",
        "name" : "mapreduce_history_server_webui",
        "scope" : "ANY",
        "service_name" : "MAPREDUCE2",
        "source" : {
          "reporting" : {
            "ok" : {
              "text" : "HTTP {0} response in {3:.4f} seconds"
            },
            "warning" : {
              "text" : "HTTP {0} response in {3:.4f} seconds"
            },
            "critical" : {
              "text" : "Connection failed to {1}:{2}"
            }
          },
          "type" : "WEB",
          "uri" : {
            "http" : "{{mapred-site/mapreduce.jobhistory.webapp.address}}",
            "https" : "{{mapred-site/mapreduce.jobhistory.webapp.https.address}}",
            "https_property" : "{{mapred-site/mapreduce.jobhistory.http.policy}}",
            "https_property_value" : "HTTPS_ONLY",
            "default_port" : 0.0
          }
        }
      }
    }


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
5d0a180 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProviderTest.java
a28fe5f 

Diff: https://reviews.apache.org/r/27331/diff/


Testing
-------

New tests added to cover:
- Ensuring that the source subproperties are present when the source is present
- Ensuring that the source subproperties are not present when the source is not present


Thanks,

Jonathan Hurley


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message