You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Jonathan Hurley <jh...@hortonworks.com> on 2014/10/29 16:17:05 UTC

Review Request 27331: Show all properties for source subresource in alert_definitions API response

-----------------------------------------------------------
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


Re: Review Request 27331: Show all properties for source subresource in alert_definitions API response

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27331/#review58990
-----------------------------------------------------------

Ship it!


Ship It!

- Nate Cole


On Oct. 29, 2014, 11:17 a.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27331/
> -----------------------------------------------------------
> 
> (Updated Oct. 29, 2014, 11:17 a.m.)
> 
> 
> 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
> 
>