ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmytro Sen" <d...@hortonworks.com>
Subject Re: Review Request 23940: Create custom action to validate configs
Date Mon, 28 Jul 2014 11:32:32 GMT


> On July 28, 2014, 10:29 a.m., Dmitro Lisnichenko wrote:
> > How about adding operation level info to API call ? Otherwise, hosts in MM will
be skipped.

MM is not applicable before we map host to some cluster.


- Dmytro


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


On July 25, 2014, 7:27 p.m., Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23940/
> -----------------------------------------------------------
> 
> (Updated July 25, 2014, 7:27 p.m.)
> 
> 
> Review request for Ambari, Dmitro Lisnichenko and Sid Wagle.
> 
> 
> Bugs: AMBARI-6625
>     https://issues.apache.org/jira/browse/AMBARI-6625
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Create custom action validate_configs
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/resources/custom_action_definitions/system_action_definitions.xml
c165fbe 
>   ambari-server/src/main/resources/custom_actions/validate_configs.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/23940/diff/
> 
> 
> Testing
> -------
> 
> manual tests
> 
> 
> Request
> {noformat}
> curl -u admin:admin -H "X-Requested-By: ambari" -X POST -d'{"RequestInfo":{"context":"Validate
configs", "action" : "validate_configs", "parameters" : {"component_configurations":{"DATANODE":{"hadoop-env"
: {"hdfs_log_dir_prefix" : "/var/11", "hadoop_pid_dir_prefix" : "/var/22", "hdfs_user" : "hdfs",
"user_group" : "rr" }}}}}, "Requests/resource_filters": [{"hosts":"c6405.ambari.apache.org,
c6406.ambari.apache.org"}]}' http://localhost:8080/api/v1/clusters/c1/requests
> {noformat}
> 
> Response
> {noformat}
> {
>   "href" : "http://localhost:8080/api/v1/clusters/c1/requests/34",
>   "Requests" : {
>     "id" : 34,
>     "status" : "InProgress"
>   }
> }
> {noformat}
> 
> Request
> {noformat}
> curl -i http://localhost:8080/api/v1/clusters/c1/requests/34
> {noformat}
> 
> Response
> {noformat}
> {
>   "href" : "http://localhost:8080/api/v1/clusters/c1/requests/34",
>   "Requests" : {
>     "aborted_task_count" : 0,
>     "cluster_name" : "c1",
>     "completed_task_count" : 2,
>     "create_time" : 1406314398061,
>     "end_time" : 1406314415515,
>     "failed_task_count" : 0,
>     "id" : 34,
>     "inputs" : "{\"component_configurations/DATANODE/hadoop-env/hdfs_user\":\"hdfs\",\"component_configurations/DATANODE/hadoop-env/user_group\":\"rr\",\"jdk_location\":\"http://dmitry-pc:8080/resources/\",\"script_type\":\"PYTHON\",\"component_configurations/DATANODE/hadoop-env/hadoop_pid_dir_prefix\":\"/var/22\",\"component_configurations/DATANODE/hadoop-env/hdfs_log_dir_prefix\":\"/var/11\",\"script\":\"validate_configs.py\",\"command_timeout\":\"60\"}",
>     "operation_level" : null,
>     "progress_percent" : 100.0,
>     "queued_task_count" : 0,
>     "request_context" : "Validate configs",
>     "request_schedule" : null,
>     "request_status" : "COMPLETED",
>     "resource_filters" : [
>       {
>         "hosts" : [
>           "c6405.ambari.apache.org",
>           "c6406.ambari.apache.org"
>         ]
>       }
>     ],
>     "start_time" : 1406314398106,
>     "task_count" : 2,
>     "timed_out_task_count" : 0,
>     "type" : "ACTION"
>   },
>   "tasks" : [
>     {
>       "href" : "http://localhost:8080/api/v1/clusters/c1/requests/34/tasks/66",
>       "Tasks" : {
>         "cluster_name" : "c1",
>         "id" : 66,
>         "request_id" : 34
>       }
>     },
>     {
>       "href" : "http://localhost:8080/api/v1/clusters/c1/requests/34/tasks/67",
>       "Tasks" : {
>         "cluster_name" : "c1",
>         "id" : 67,
>         "request_id" : 34
>       }
>     }
>   ]
> }
> {noformat}
> 
> Request
> {noformat}
>  curl -i http://localhost:8080/api/v1/clusters/c1/requests/34/tasks/66
> {noformat}
> 
> Response
> {noformat}
> {
>   "href" : "http://localhost:8080/api/v1/clusters/c1/requests/36/tasks/66",
>   "Tasks" : {
>     "attempt_cnt" : 1,
>     "cluster_name" : "c1",
>     "command" : "ACTIONEXECUTE",
>     "command_detail" : "validate_configs ACTIONEXECUTE",
>     "end_time" : 1406315904131,
>     "error_log" : null,
>     "exit_code" : 0,
>     "host_name" : "c6406.ambari.apache.org",
>     "id" : 66,
>     "output_log" : null,
>     "request_id" : 36,
>     "role" : "validate_configs",
>     "stage_id" : 1,
>     "start_time" : 1406315891870,
>     "status" : "COMPLETED",
>     "stderr" : "None",
>     "stdout" : "All configurations validated!",
>     "structured_out" : { }
>   }
> }
> {noformat}
> 
> 
> Thanks,
> 
> Dmytro Sen
> 
>


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