You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Dmytro Sen <ds...@hortonworks.com> on 2014/07/25 21:27:58 UTC

Review Request 23940: Create custom action to validate configs

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

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


Re: Review Request 23940: Create custom action to validate configs

Posted by Dmytro Sen <ds...@hortonworks.com>.

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


Re: Review Request 23940: Create custom action to validate configs

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23940/#review48834
-----------------------------------------------------------


How about adding operation level info to API call ? Otherwise, hosts in MM will be skipped.

- Dmitro Lisnichenko


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


Re: Review Request 23940: Create custom action to validate configs

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23940/#review48838
-----------------------------------------------------------

Ship it!


code looks good, maybe let's add some tests

- Dmitro Lisnichenko


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


Re: Review Request 23940: Create custom action to validate configs

Posted by Dmytro Sen <ds...@hortonworks.com>.

> On July 30, 2014, 6:05 p.m., Sid Wagle wrote:
> > ambari-server/src/main/resources/custom_actions/validate_configs.py, line 395
> > <https://reviews.apache.org/r/23940/diff/2/?file=645895#file645895line395>
> >
> >     If user doesn't exist, how will the API user find out?
> >     
> >     We should have a way to provide reason for this validation failure in the API response.

We check if (user exists and is a member of specified group) or (can be created)


- Dmytro


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


On July 31, 2014, 8:50 a.m., Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23940/
> -----------------------------------------------------------
> 
> (Updated July 31, 2014, 8:50 a.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 
>   ambari-server/src/test/python/TestValidateConfigs.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
> 
>


Re: Review Request 23940: Create custom action to validate configs

Posted by Sid Wagle <sw...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23940/#review49135
-----------------------------------------------------------



ambari-server/src/main/resources/custom_actions/validate_configs.py
<https://reviews.apache.org/r/23940/#comment85977>

    If user doesn't exist, how will the API user find out?
    
    We should have a way to provide reason for this validation failure in the API response.


- Sid Wagle


On July 30, 2014, 4:39 p.m., Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23940/
> -----------------------------------------------------------
> 
> (Updated July 30, 2014, 4:39 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 
>   ambari-server/src/test/python/TestValidateConfigs.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
> 
>


Re: Review Request 23940: Create custom action to validate configs

Posted by Sid Wagle <sw...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23940/#review49229
-----------------------------------------------------------

Ship it!


Ship It!

- Sid Wagle


On July 31, 2014, 8:50 a.m., Dmytro Sen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23940/
> -----------------------------------------------------------
> 
> (Updated July 31, 2014, 8:50 a.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 
>   ambari-server/src/test/python/TestValidateConfigs.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
> 
>


Re: Review Request 23940: Create custom action to validate configs

Posted by Dmytro Sen <ds...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23940/
-----------------------------------------------------------

(Updated July 31, 2014, 8:50 a.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 (updated)
-----

  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 
  ambari-server/src/test/python/TestValidateConfigs.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


Re: Review Request 23940: Create custom action to validate configs

Posted by Dmytro Sen <ds...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23940/
-----------------------------------------------------------

(Updated July 30, 2014, 4:39 p.m.)


Review request for Ambari, Dmitro Lisnichenko and Sid Wagle.


Changes
-------

Final version. Checks required directories and users for all services for HDP2.1 and HDP1.3.3


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


Repository: ambari


Description
-------

Create custom action validate_configs


Diffs (updated)
-----

  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 
  ambari-server/src/test/python/TestValidateConfigs.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