ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject [02/12] AMBARI-5482. Integrate Ambari Shell. (Janos Matyas and Krisztian Horvath via yusaku)
Date Sat, 31 May 2014 07:21:06 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/componentmodel_get_metrics.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/componentmodel_get_metrics.json b/ambari-client/src/test/python/json/componentmodel_get_metrics.json
deleted file mode 100644
index 5623d8b..0000000
--- a/ambari-client/src/test/python/json/componentmodel_get_metrics.json
+++ /dev/null
@@ -1,133 +0,0 @@
-{
-    "href" : "http://192.168.64.101:8080/api/v1/clusters/cl1/hosts/myhost/host_components/DATANODE?fields=metrics",
-    "HostRoles" : {
-        "cluster_name" : "cl1",
-        "component_name" : "DATANODE",
-        "host_name" : "myhost"
-    },
-    "host" : {
-        "href" : "http://192.168.64.101:8080/api/v1/clusters/cl1/hosts/myhost"
-    },
-    "metrics" : {
-        "boottime" : 1.383131209E9,
-        "cpu" : {
-            "cpu_aidle" : 0.0,
-            "cpu_idle" : 85.73,
-            "cpu_nice" : 0.0,
-            "cpu_num" : 1.0,
-            "cpu_speed" : 2967.0,
-            "cpu_system" : 6.84583333333,
-            "cpu_user" : 7.42888888889,
-            "cpu_wio" : 0.00416666666667
-        },
-        "dfs" : {
-            "FSNamesystem" : {
-                "HttpPort" : null,
-                "NamenodeAddress" : "{\"myhost\":\"BP-442795920-192.168.64.101-1383132565020\"}",
-                "RpcPort" : "8010",
-                "Version" : "2.2.0.2.0.6.0-76",
-                "VolumeInfo" : "{\"/hadoop/hdfs/data/current\":{\"freeSpace\":495195869184,\"usedSpace\":345120768,\"reservedSpace\":1073741824}}"
-            },
-            "datanode" : {
-                "blockChecksumOp_avg_time" : 0.0,
-                "blockChecksumOp_num_ops" : 0.0,
-                "blockReports_avg_time" : 6.0,
-                "blockReports_num_ops" : 0.0,
-                "block_verification_failures" : 0.0,
-                "blocks_get_local_pathinfo" : 0.0,
-                "blocks_read" : 0.0,
-                "blocks_removed" : 0.0,
-                "blocks_replicated" : 0.0,
-                "blocks_verified" : 0.0,
-                "blocks_written" : 0.0,
-                "bytes_read" : 0.0,
-                "bytes_written" : 0.0,
-                "copyBlockOp_avg_time" : 0.0,
-                "copyBlockOp_num_ops" : 0.0,
-                "heartBeats_avg_time" : 1.69166666667,
-                "heartBeats_num_ops" : 0.336481481481,
-                "readBlockOp_avg_time" : 0.0,
-                "readBlockOp_num_ops" : 0.0,
-                "reads_from_local_client" : 0.0,
-                "reads_from_remote_client" : 0.0,
-                "replaceBlockOp_avg_time" : 0.0,
-                "replaceBlockOp_num_ops" : 0.0,
-                "writeBlockOp_avg_time" : 13.8969072165,
-                "writeBlockOp_num_ops" : 0.0,
-                "writes_from_local_client" : 0.0,
-                "writes_from_remote_client" : 0.0
-            }
-        },
-        "disk" : {
-            "disk_free" : 495.645,
-            "disk_total" : 525.79,
-            "part_max_used" : 11.6
-        },
-        "jvm" : {
-            "HeapMemoryMax" : 1037959168,
-            "HeapMemoryUsed" : 11395264,
-            "NonHeapMemoryMax" : 136314880,
-            "NonHeapMemoryUsed" : 30798600,
-            "gcCount" : 0.0111111111111,
-            "gcTimeMillis" : 388,
-            "logError" : 0.0,
-            "logFatal" : 0.0,
-            "logInfo" : 0.0,
-            "logWarn" : 0.0,
-            "memHeapCommittedM" : 28.5625,
-            "memHeapUsedM" : 11.7175731111,
-            "memNonHeapCommittedM" : 29.625,
-            "memNonHeapUsedM" : 29.36007675,
-            "threadsBlocked" : 0.0,
-            "threadsNew" : 0.0,
-            "threadsRunnable" : 8.04166666667,
-            "threadsTerminated" : 0.0,
-            "threadsTimedWaiting" : 8.91666666667,
-            "threadsWaiting" : 18.0
-        },
-        "load" : {
-            "load_fifteen" : 0.0692222222222,
-            "load_five" : 0.0592777777778,
-            "load_one" : 0.0125555555556
-        },
-        "memory" : {
-            "mem_buffers" : 23914.2666667,
-            "mem_cached" : 160191.855556,
-            "mem_free" : 183983.855556,
-            "mem_shared" : 0.0,
-            "mem_total" : 1922680.0,
-            "swap_free" : 2593920.0,
-            "swap_total" : 2621432.0
-        },
-        "network" : {
-            "bytes_in" : 30989.8874167,
-            "bytes_out" : 98799.6742778,
-            "pkts_in" : 44.9822222222,
-            "pkts_out" : 214.358916667
-        },
-        "process" : {
-            "proc_run" : 2.0,
-            "proc_total" : 682.397222222
-        },
-        "rpc" : {
-            "NumOpenConnections" : 0.0,
-            "ReceivedBytes" : 0.0,
-            "RpcProcessingTime_avg_time" : 0.0,
-            "RpcProcessingTime_num_ops" : 0.0,
-            "RpcQueueTime_avg_time" : 0.0,
-            "RpcQueueTime_num_ops" : 0.0,
-            "SentBytes" : 0.0,
-            "callQueueLen" : 0.0,
-            "rpcAuthenticationFailures" : 0.0,
-            "rpcAuthenticationSuccesses" : 0.0,
-            "rpcAuthorizationFailures" : 0.0,
-            "rpcAuthorizationSuccesses" : 0.0
-        },
-        "ugi" : {
-            "loginFailure_avg_time" : 0.0,
-            "loginFailure_num_ops" : 0.0,
-            "loginSuccess_avg_time" : 0.0,
-            "loginSuccess_num_ops" : 0.0
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/get_cluster_service.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/get_cluster_service.json b/ambari-client/src/test/python/json/get_cluster_service.json
deleted file mode 100755
index 5b78e05..0000000
--- a/ambari-client/src/test/python/json/get_cluster_service.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/v1/clusters/test6/services/GANGLIA",
-  "ServiceInfo" : {
-    "cluster_name" : "test6",
-    "service_name" : "GANGLIA",
-    "state" : "INSTALLED",
-    "desired_configs" : { }
-  },
-  "components" : [
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/services/GANGLIA/components/GANGLIA_MONITOR",
-      "ServiceComponentInfo" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "service_name" : "GANGLIA"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/services/GANGLIA/components/GANGLIA_SERVER",
-      "ServiceComponentInfo" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_SERVER",
-        "service_name" : "GANGLIA"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/get_components_from_stack.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/get_components_from_stack.json b/ambari-client/src/test/python/json/get_components_from_stack.json
deleted file mode 100644
index 55a9c09..0000000
--- a/ambari-client/src/test/python/json/get_components_from_stack.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/v1/stacks2/HDP/versions/2.0.5/stackServices/YARN/serviceComponents?fields=*",
-  "items" : [
-    {
-      "href" : "http://localhost:8080/api/v1/stacks2/HDP/versions/2.0.5/stackServices/YARN/serviceComponents/NODEMANAGER",
-      "StackServiceComponents" : {
-        "component_category" : "SLAVE",
-        "component_name" : "NODEMANAGER",
-        "is_client" : false,
-        "is_master" : false,
-        "service_name" : "YARN",
-        "stack_name" : "HDP",
-        "stack_version" : "2.0.5"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/stacks2/HDP/versions/2.0.5/stackServices/YARN/serviceComponents/RESOURCEMANAGER",
-      "StackServiceComponents" : {
-        "component_category" : "MASTER",
-        "component_name" : "RESOURCEMANAGER",
-        "is_client" : false,
-        "is_master" : true,
-        "service_name" : "YARN",
-        "stack_name" : "HDP",
-        "stack_version" : "2.0.5"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/stacks2/HDP/versions/2.0.5/stackServices/YARN/serviceComponents/YARN_CLIENT",
-      "StackServiceComponents" : {
-        "component_category" : "CLIENT",
-        "component_name" : "YARN_CLIENT",
-        "is_client" : true,
-        "is_master" : false,
-        "service_name" : "YARN",
-        "stack_name" : "HDP",
-        "stack_version" : "2.0.5"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/get_host_component.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/get_host_component.json b/ambari-client/src/test/python/json/get_host_component.json
deleted file mode 100755
index 709b94b..0000000
--- a/ambari-client/src/test/python/json/get_host_component.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components/NAMENODE",
-  "HostRoles" : {
-    "cluster_name" : "test6",
-    "component_name" : "NAMENODE",
-    "desired_stack_id" : "HDP-1.3.0",
-    "desired_state" : "INSTALLED",
-    "host_name" : "r01wn01",
-    "stack_id" : "HDP-1.3.0",
-    "state" : "INSTALLED",
-    "actual_configs" : {
-      "core-site" : {
-        "tag" : "version1"
-      },
-      "global" : {
-        "tag" : "version1"
-      },
-      "hdfs-site" : {
-        "tag" : "version1"
-      },
-      "mapred-site" : {
-        "tag" : "version1"
-      }
-    },
-    "configs" : { },
-    "desired_configs" : { }
-  },
-  "host" : {
-    "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01"
-  },
-  "component" : [
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/services/HDFS/components/NAMENODE",
-      "ServiceComponentInfo" : {
-        "cluster_name" : "test6",
-        "component_name" : "NAMENODE",
-        "service_name" : "HDFS"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/get_host_components.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/get_host_components.json b/ambari-client/src/test/python/json/get_host_components.json
deleted file mode 100755
index 94a3027..0000000
--- a/ambari-client/src/test/python/json/get_host_components.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components?ServiceComponentInfo",
-  "items" : [
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "r01wn01"
-      },
-      "host" : {
-        "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components/GANGLIA_SERVER",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_SERVER",
-        "host_name" : "r01wn01"
-      },
-      "host" : {
-        "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components/MAPREDUCE_CLIENT",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "MAPREDUCE_CLIENT",
-        "host_name" : "r01wn01"
-      },
-      "host" : {
-        "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components/NAGIOS_SERVER",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "NAGIOS_SERVER",
-        "host_name" : "r01wn01"
-      },
-      "host" : {
-        "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components/NAMENODE",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "NAMENODE",
-        "host_name" : "r01wn01"
-      },
-      "host" : {
-        "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/get_service_component.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/get_service_component.json b/ambari-client/src/test/python/json/get_service_component.json
deleted file mode 100755
index 3e993cd..0000000
--- a/ambari-client/src/test/python/json/get_service_component.json
+++ /dev/null
@@ -1,108 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/v1/clusters/test6/services/GANGLIA/components/GANGLIA_MONITOR",
-  "ServiceComponentInfo" : {
-    "cluster_name" : "test6",
-    "component_name" : "GANGLIA_MONITOR",
-    "service_name" : "GANGLIA",
-    "state" : "INSTALLED",
-    "desired_configs" : { }
-  },
-  "host_components" : [
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-83/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "apspal44-83"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-84/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "apspal44-84"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-85/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "apspal44-85"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-86/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "apspal44-86"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-87/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "apspal44-87"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-88/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "apspal44-88"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-89/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "apspal44-89"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01hn01/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "r01hn01"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01mgt/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "r01mgt"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "r01wn01"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn02/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "r01wn02"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn03/host_components/GANGLIA_MONITOR",
-      "HostRoles" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "host_name" : "r01wn03"
-      }
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/get_service_components.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/get_service_components.json b/ambari-client/src/test/python/json/get_service_components.json
deleted file mode 100755
index 967bcbd..0000000
--- a/ambari-client/src/test/python/json/get_service_components.json
+++ /dev/null
@@ -1,133 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/v1/clusters/test6/services/GANGLIA/components?fields=*",
-  "items" : [
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/services/GANGLIA/components/GANGLIA_MONITOR",
-      "ServiceComponentInfo" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_MONITOR",
-        "service_name" : "GANGLIA",
-        "state" : "INSTALLED",
-        "desired_configs" : { }
-      },
-      "host_components" : [
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-83/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "apspal44-83"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-84/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "apspal44-84"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-85/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "apspal44-85"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-86/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "apspal44-86"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-87/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "apspal44-87"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-88/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "apspal44-88"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/apspal44-89/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "apspal44-89"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01hn01/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "r01hn01"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01mgt/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "r01mgt"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "r01wn01"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn02/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "r01wn02"
-          }
-        },
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn03/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "r01wn03"
-          }
-        }
-      ]
-    },
-    {
-      "href" : "http://localhost:8080/api/v1/clusters/test6/services/GANGLIA/components/GANGLIA_SERVER",
-      "ServiceComponentInfo" : {
-        "cluster_name" : "test6",
-        "component_name" : "GANGLIA_SERVER",
-        "service_name" : "GANGLIA",
-        "state" : "INSTALLED",
-        "desired_configs" : { }
-      },
-      "host_components" : [
-        {
-          "href" : "http://localhost:8080/api/v1/clusters/test6/hosts/r01wn01/host_components/GANGLIA_SERVER",
-          "HostRoles" : {
-            "cluster_name" : "test6",
-            "component_name" : "GANGLIA_SERVER",
-            "host_name" : "r01wn01"
-          }
-        }
-      ]
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/hostmodel_get_host_component.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/hostmodel_get_host_component.json b/ambari-client/src/test/python/json/hostmodel_get_host_component.json
deleted file mode 100644
index 436cfda..0000000
--- a/ambari-client/src/test/python/json/hostmodel_get_host_component.json
+++ /dev/null
@@ -1,181 +0,0 @@
-{
-    "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/DATANODE",
-    "HostRoles" : {
-        "cluster_name" : "cl1",
-        "component_name" : "DATANODE",
-        "desired_stack_id" : "HDP-2.0.6",
-        "desired_state" : "STARTED",
-        "host_name" : "myhost",
-        "stack_id" : "HDP-2.0.6",
-        "state" : "STARTED",
-        "actual_configs" : {
-            "capacity-scheduler" : {
-                "tag" : "version1"
-            },
-            "core-site" : {
-                "tag" : "version1"
-            },
-            "global" : {
-                "tag" : "version1"
-            },
-            "hbase-site" : {
-                "tag" : "version1"
-            },
-            "hdfs-site" : {
-                "tag" : "version1"
-            },
-            "hive-site" : {
-                "tag" : "version1"
-            },
-            "mapred-site" : {
-                "tag" : "version1"
-            },
-            "oozie-site" : {
-                "tag" : "version1"
-            },
-            "webhcat-site" : {
-                "tag" : "version1"
-            },
-            "yarn-site" : {
-                "tag" : "version1"
-            }
-        },
-        "configs" : { },
-        "desired_configs" : { }
-    },
-    "host" : {
-        "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-    },
-    "metrics" : {
-        "boottime" : 1.383131209E9,
-        "cpu" : {
-            "cpu_aidle" : 0.0,
-            "cpu_idle" : 86.7238888889,
-            "cpu_nice" : 0.0,
-            "cpu_num" : 1.0,
-            "cpu_speed" : 2967.0,
-            "cpu_system" : 6.43527777778,
-            "cpu_user" : 6.81722222222,
-            "cpu_wio" : 0.0263888888889
-        },
-        "dfs" : {
-            "FSNamesystem" : {
-                "HttpPort" : null,
-                "NamenodeAddress" : "{\"myhost\":\"BP-442795920-192.168.64.101-1383132565020\"}",
-                "RpcPort" : "8010",
-                "Version" : "2.2.0.2.0.6.0-76",
-                "VolumeInfo" : "{\"/hadoop/hdfs/data/current\":{\"freeSpace\":495195308032,\"usedSpace\":345120768,\"reservedSpace\":1073741824}}"
-            },
-            "datanode" : {
-                "blockChecksumOp_avg_time" : 0.0,
-                "blockChecksumOp_num_ops" : 0.0,
-                "blockReports_avg_time" : 6.0,
-                "blockReports_num_ops" : 0.0,
-                "block_verification_failures" : 0.0,
-                "blocks_get_local_pathinfo" : 0.0,
-                "blocks_read" : 0.0,
-                "blocks_removed" : 0.0,
-                "blocks_replicated" : 0.0,
-                "blocks_verified" : 0.0,
-                "blocks_written" : 0.0,
-                "bytes_read" : 0.0,
-                "bytes_written" : 0.0,
-                "copyBlockOp_avg_time" : 0.0,
-                "copyBlockOp_num_ops" : 0.0,
-                "heartBeats_avg_time" : 1.29537037037,
-                "heartBeats_num_ops" : 0.330833333333,
-                "readBlockOp_avg_time" : 0.0,
-                "readBlockOp_num_ops" : 0.0,
-                "reads_from_local_client" : 0.0,
-                "reads_from_remote_client" : 0.0,
-                "replaceBlockOp_avg_time" : 0.0,
-                "replaceBlockOp_num_ops" : 0.0,
-                "writeBlockOp_avg_time" : 13.8969072165,
-                "writeBlockOp_num_ops" : 0.0,
-                "writes_from_local_client" : 0.0,
-                "writes_from_remote_client" : 0.0
-            }
-        },
-        "disk" : {
-            "disk_free" : 495.644319444,
-            "disk_total" : 525.79,
-            "part_max_used" : 11.6
-        },
-        "jvm" : {
-            "HeapMemoryMax" : 1037959168,
-            "HeapMemoryUsed" : 15927976,
-            "NonHeapMemoryMax" : 136314880,
-            "NonHeapMemoryUsed" : 30819952,
-            "gcCount" : 0.0127777777778,
-            "gcTimeMillis" : 409,
-            "logError" : 0.0,
-            "logFatal" : 0.0,
-            "logInfo" : 0.0,
-            "logWarn" : 0.0,
-            "memHeapCommittedM" : 28.5625,
-            "memHeapUsedM" : 11.6042887139,
-            "memNonHeapCommittedM" : 29.625,
-            "memNonHeapUsedM" : 29.3762000417,
-            "threadsBlocked" : 0.0,
-            "threadsNew" : 0.0,
-            "threadsRunnable" : 8.0,
-            "threadsTerminated" : 0.0,
-            "threadsTimedWaiting" : 9.0,
-            "threadsWaiting" : 18.0
-        },
-        "load" : {
-            "load_fifteen" : 0.19775,
-            "load_five" : 0.211194444444,
-            "load_one" : 0.156638888889
-        },
-        "memory" : {
-            "mem_buffers" : 25446.6,
-            "mem_cached" : 160915.911111,
-            "mem_free" : 176156.088889,
-            "mem_shared" : 0.0,
-            "mem_total" : 1922680.0,
-            "swap_free" : 2593928.0,
-            "swap_total" : 2621432.0
-        },
-        "network" : {
-            "bytes_in" : 31580.1931111,
-            "bytes_out" : 102086.367833,
-            "pkts_in" : 45.7961111111,
-            "pkts_out" : 216.703472222
-        },
-        "process" : {
-            "proc_run" : 2.21111111111,
-            "proc_total" : 681.766666667
-        },
-        "rpc" : {
-            "NumOpenConnections" : 0.0,
-            "ReceivedBytes" : 0.0,
-            "RpcProcessingTime_avg_time" : 0.0,
-            "RpcProcessingTime_num_ops" : 0.0,
-            "RpcQueueTime_avg_time" : 0.0,
-            "RpcQueueTime_num_ops" : 0.0,
-            "SentBytes" : 0.0,
-            "callQueueLen" : 0.0,
-            "rpcAuthenticationFailures" : 0.0,
-            "rpcAuthenticationSuccesses" : 0.0,
-            "rpcAuthorizationFailures" : 0.0,
-            "rpcAuthorizationSuccesses" : 0.0
-        },
-        "ugi" : {
-            "loginFailure_avg_time" : 0.0,
-            "loginFailure_num_ops" : 0.0,
-            "loginSuccess_avg_time" : 0.0,
-            "loginSuccess_num_ops" : 0.0
-        }
-    },
-    "component" : [
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/services/HDFS/components/DATANODE",
-            "ServiceComponentInfo" : {
-                "cluster_name" : "cl1",
-                "component_name" : "DATANODE",
-                "service_name" : "HDFS"
-            }
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/hostmodel_get_host_components.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/hostmodel_get_host_components.json b/ambari-client/src/test/python/json/hostmodel_get_host_components.json
deleted file mode 100644
index 8148d18..0000000
--- a/ambari-client/src/test/python/json/hostmodel_get_host_components.json
+++ /dev/null
@@ -1,222 +0,0 @@
-{
-    "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components?fields=HostRoles/state",
-    "items" : [
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/DATANODE",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "DATANODE",
-                "host_name" : "myhost",
-                "state" : "STARTED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/GANGLIA_MONITOR",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "GANGLIA_MONITOR",
-                "host_name" : "myhost",
-                "state" : "STARTED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/HBASE_CLIENT",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "HBASE_CLIENT",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/HBASE_MASTER",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "HBASE_MASTER",
-                "ha_status" : "active",
-                "host_name" : "myhost",
-                "state" : "STARTED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/HBASE_REGIONSERVER",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "HBASE_REGIONSERVER",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/HCAT",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "HCAT",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/HDFS_CLIENT",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "HDFS_CLIENT",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/HIVE_CLIENT",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "HIVE_CLIENT",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/MAPREDUCE2_CLIENT",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "MAPREDUCE2_CLIENT",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/NAMENODE",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "NAMENODE",
-                "host_name" : "myhost",
-                "state" : "STARTED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/NODEMANAGER",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "NODEMANAGER",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/OOZIE_CLIENT",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "OOZIE_CLIENT",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/PIG",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "PIG",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/RESOURCEMANAGER",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "RESOURCEMANAGER",
-                "host_name" : "myhost",
-                "state" : "STARTED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/SQOOP",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "SQOOP",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/YARN_CLIENT",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "YARN_CLIENT",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/ZOOKEEPER_CLIENT",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "ZOOKEEPER_CLIENT",
-                "host_name" : "myhost",
-                "state" : "INSTALLED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        },
-        {
-            "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost/host_components/ZOOKEEPER_SERVER",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "ZOOKEEPER_SERVER",
-                "host_name" : "myhost",
-                "state" : "STARTED"
-            },
-            "host" : {
-                "href" : "http://myhost:8080/api/v1/clusters/cl1/hosts/myhost"
-            }
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/servicemodel_get_component.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/servicemodel_get_component.json b/ambari-client/src/test/python/json/servicemodel_get_component.json
deleted file mode 100644
index c6cbd08..0000000
--- a/ambari-client/src/test/python/json/servicemodel_get_component.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-    "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/services/GANGLIA/components/GANGLIA_SERVER",
-    "ServiceComponentInfo" : {
-        "cluster_name" : "cl1",
-        "component_name" : "GANGLIA_SERVER",
-        "service_name" : "GANGLIA",
-        "state" : "STARTED",
-        "desired_configs" : { }
-    },
-    "host_components" : [
-        {
-            "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/hosts/c6402.ambari.apache.org/host_components/GANGLIA_SERVER",
-            "HostRoles" : {
-                "cluster_name" : "cl1",
-                "component_name" : "GANGLIA_SERVER",
-                "host_name" : "c6402.ambari.apache.org"
-            }
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/servicemodel_get_components.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/servicemodel_get_components.json b/ambari-client/src/test/python/json/servicemodel_get_components.json
deleted file mode 100644
index b9efe73..0000000
--- a/ambari-client/src/test/python/json/servicemodel_get_components.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
-  "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/services/GANGLIA/components?fields=*",
-  "items" : [
-    {
-      "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/services/GANGLIA/components/GANGLIA_MONITOR",
-      "ServiceComponentInfo" : {
-        "cluster_name" : "cl1",
-        "component_name" : "GANGLIA_MONITOR",
-        "service_name" : "GANGLIA",
-        "state" : "STARTED",
-        "desired_configs" : { }
-      },
-      "host_components" : [
-        {
-          "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/hosts/c6401.ambari.apache.org/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "cl1",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "c6401.ambari.apache.org"
-          }
-        },
-        {
-          "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/hosts/c6402.ambari.apache.org/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "cl1",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "c6402.ambari.apache.org"
-          }
-        },
-        {
-          "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/hosts/c6403.ambari.apache.org/host_components/GANGLIA_MONITOR",
-          "HostRoles" : {
-            "cluster_name" : "cl1",
-            "component_name" : "GANGLIA_MONITOR",
-            "host_name" : "c6403.ambari.apache.org"
-          }
-        }
-      ]
-    },
-    {
-      "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/services/GANGLIA/components/GANGLIA_SERVER",
-      "ServiceComponentInfo" : {
-        "cluster_name" : "cl1",
-        "component_name" : "GANGLIA_SERVER",
-        "service_name" : "GANGLIA",
-        "state" : "INSTALLED",
-        "desired_configs" : { }
-      },
-      "host_components" : [
-        {
-          "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/hosts/c6402.ambari.apache.org/host_components/GANGLIA_SERVER",
-          "HostRoles" : {
-            "cluster_name" : "cl1",
-            "component_name" : "GANGLIA_SERVER",
-            "host_name" : "c6402.ambari.apache.org"
-          }
-        }
-      ]
-    }
-  ]
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/status_error_with_message.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/status_error_with_message.json b/ambari-client/src/test/python/json/status_error_with_message.json
deleted file mode 100644
index 69ca96d..0000000
--- a/ambari-client/src/test/python/json/status_error_with_message.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-    "status" : 400,
-    "message" : "java.lang.IllegalArgumentException: No enum const class org.apache.ambari.server.state.State.ILLEGAL_STATE"
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/json/status_ok_with_id.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/status_ok_with_id.json b/ambari-client/src/test/python/json/status_ok_with_id.json
deleted file mode 100644
index c805e38..0000000
--- a/ambari-client/src/test/python/json/status_ok_with_id.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-    "href" : "http://localhost:8080/api/v1/clusters/test1/requests/19",
-    "Requests" : {
-        "id" : 19,
-        "status" : "InProgress"
-    }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/unitTests.py
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/unitTests.py b/ambari-client/src/test/python/unitTests.py
deleted file mode 100755
index eadfade..0000000
--- a/ambari-client/src/test/python/unitTests.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env python
-
-'''
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-'''
-
-import unittest
-import doctest
-from os.path import dirname, split, isdir
-import logging.handlers
-import logging
-
-LOG_FILE_NAME='tests.log'
-SELECTED_PREFIX = "_"
-PY_EXT='.py'
-
-class TestAgent(unittest.TestSuite):
-  def run(self, result):
-    run = unittest.TestSuite.run
-    run(self, result)
-    return result
-
-
-def parent_dir(path):
-  if isdir(path):
-    if path.endswith(os.sep):
-      path = os.path.dirname(path)
-    parent_dir = os.path.dirname(path)
-  else:
-    parent_dir = os.path.dirname(os.path.dirname(path))
-
-  return parent_dir
-
-
-def all_tests_suite():
-
-
-  src_dir = os.getcwd()
-  files_list=os.listdir(src_dir)
-  tests_list = []
-
-  logger.info('------------------------TESTS LIST:-------------------------------------')
-  # If test with special name exists, run only this test
-  selected_test = None
-  for file_name in files_list:
-    if file_name.endswith(PY_EXT) and not file_name == __file__ and file_name.startswith(SELECTED_PREFIX):
-      logger.info("Running only selected test " + str(file_name))
-      selected_test = file_name
-  if selected_test is not None:
-      tests_list.append(selected_test.replace(PY_EXT, ''))
-  else:
-    for file_name in files_list:
-      if file_name.endswith(PY_EXT) and not file_name == __file__:
-        logger.info(file_name)
-        tests_list.append(file_name.replace(PY_EXT, ''))
-  logger.info('------------------------------------------------------------------------')
-
-  suite = unittest.TestLoader().loadTestsFromNames(tests_list)
-  return TestAgent([suite])
-
-def main():
-
-  logger.info('------------------------------------------------------------------------')
-  logger.info('PYTHON AGENT TESTS')
-  logger.info('------------------------------------------------------------------------')
-  runner = unittest.TextTestRunner(verbosity=2, stream=sys.stdout)
-  suite = all_tests_suite()
-  result = runner.run(suite)
-  for error in result.errors:
-    logger.error('Failed test:' + error[0]._testMethodName + '\n' + error[1])
-  for failure in result.failures:
-    logger.error('Failed test:' + failure[0]._testMethodName + '\n' + failure[1])
-  status = result.wasSuccessful()
-
-  if not status:
-    logger.error('-----------------------------------------------------------------------')
-    logger.error('Python unit tests failed')
-    logger.error('Find detailed logs in ' + path)
-    logger.error('-----------------------------------------------------------------------')
-    exit(1)
-  else:
-    logger.info('------------------------------------------------------------------------')
-    logger.info('Python unit tests finished succesfully')
-    logger.info('------------------------------------------------------------------------')
-
-if __name__ == '__main__':
-  import os
-  import sys
-  import io
-  sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
-  sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + os.sep + 'main' + os.sep + 'python')
-  sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + os.sep + 'main' + os.sep + 'python' + os.sep + 'ambari_agent')
-  logger = logging.getLogger()
-  logger.setLevel(logging.INFO)
-  formatter = logging.Formatter("[%(levelname)s] %(message)s")
-  src_dir = os.getcwd()
-  target_dir = parent_dir(parent_dir(parent_dir(src_dir))) + os.sep + 'target'
-  if not os.path.exists(target_dir):
-    os.mkdir(target_dir)
-  path = target_dir + os.sep + LOG_FILE_NAME
-  file=open(path, "w")
-  consoleLog = logging.StreamHandler(file)
-  consoleLog.setFormatter(formatter)
-  logger.addHandler(consoleLog)
-  main()

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-client/src/test/python/utils/HttpClientInvoker.py
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/utils/HttpClientInvoker.py b/ambari-client/src/test/python/utils/HttpClientInvoker.py
deleted file mode 100644
index dd753b2..0000000
--- a/ambari-client/src/test/python/utils/HttpClientInvoker.py
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/env python
-
-'''
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-'''
-import logging
-import unittest
-class HttpClientInvoker():
-  @staticmethod
-  def http_client_invoke_side_effects(*args, **kwargs):
-      localss = locals()
-      logger = logging.getLogger()
-      logger.info(localss)
-      http_method = args[0]
-      url = args[1]
-      payload = kwargs.get("payload",None)
-
-      mocked_code = 200 
-      mocked_content = "text/plain"
-      
-      if http_method == "GET":
-        # ClusterModel mocking
-        if url == "//clusters/test1":
-          mocked_response = open('json/clustermodel_get_cluster.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test1/hosts/myhost":
-          mocked_response = open('json/clustermodel_get_host.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test1/hosts?fields=*":
-          mocked_response = open('json/clustermodel_get_all_hosts.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test1/configurations?type=global&tag=version1":
-          mocked_response = open('json/clustermodel_get_global_config.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test1/configurations?type=core-site&tag=version1":
-          mocked_response = open('json/clustermodel_get_core_site_config.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test1/configurations?type=hdfs-site&tag=version1":
-          mocked_response = open('json/clustermodel_get_hdfs_site_config.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test1/configurations?type=mapred-site&tag=version1":
-          mocked_response = open('json/clustermodel_get_mapred_site_config.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        # HostModel mocking
-        elif url == '//clusters/test1/hosts/myhost/host_components/DATANODE':
-          mocked_response = open('json/hostmodel_get_host_component.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == '//clusters/test1/hosts/myhost/host_components?fields=HostRoles/state':
-          mocked_response = open('json/hostmodel_get_host_components.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        # ComponentModel mocking
-        elif url == "//clusters/cl1/hosts/myhost/host_components/DATANODE?fields=metrics":
-          mocked_response = open('json/componentmodel_get_metrics.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        # ServiceModel mocking
-        elif url == "//clusters/test1/services/GANGLIA/components?fields=*":
-          mocked_response = open('json/servicemodel_get_components.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test1/services/GANGLIA/components/GANGLIA_SERVER":
-          mocked_response = open('json/servicemodel_get_component.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        # AmbariClient mocking
-        elif url == "//clusters":
-          mocked_response = open('json/ambariclient_get_all_clusters.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//hosts":
-          mocked_response = open('json/ambariclient_get_all_hosts.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//hosts/dev06.hortonworks.com":
-          mocked_response = open('json/ambariclient_get_host.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//stacks2/HDP/versions/1.3.0/stackServices/HDFS/configurations?fields=*":
-          mocked_response = open('json/ambariclient_get_config.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//stacks2/HDP/versions/1.3.0/stackServices/HDFS/serviceComponents?fields=*":
-          mocked_response = open('json/ambariclient_get_components.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        # others
-        elif url == "//clusters/test1/services/GANGLIA":
-          mocked_response = open('json/clustermodel_get_service.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test1/services?fields=*":
-          mocked_response = open('json/clustermodel_get_all_services.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//stacks2/HDP/versions/2.0.5/stackServices/HDFS/serviceComponents?fields=*":
-          mocked_response = open('json/get_components_from_stack.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test6/services/GANGLIA":
-          mocked_response = open('json/get_cluster_service.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test6/hosts/r01wn01/host_components/NAMENODE":
-          mocked_response = open('json/get_host_component.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test6/hosts/r01wn01/host_components?ServiceComponentInfo":
-          mocked_response = open('json/get_host_components.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test6/services/GANGLIA/components/GANGLIA_MONITOR":
-          mocked_response = open('json/get_service_component.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == "//clusters/test6/services/GANGLIA/components?fields=*":
-          mocked_response = open('json/get_service_components.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        else:
-          print "Unknown get request on url: %s" % url
-      elif http_method == "DELETE":
-        # ClusterModel
-        if url == "//clusters/test1/hosts/deleted_nonexistant_cluster":
-          mocked_response = open('json/clustermodel_error_deleting_host.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        else: # DELETE (generally does not require any response)
-          return "", mocked_code , mocked_content
-      elif http_method == "POST":
-        # AmbariClient
-        if url == "//bootstrap":
-          mocked_response = open('json/ambariclient_bootstrap_hosts.json', 'r').read()
-          return mocked_response, mocked_code , mocked_content
-        elif url == '//clusters/test1/hosts?Hosts/host_name=myhost':
-          mocked_code = 201
-          return "", mocked_code , mocked_content
-        else: # POST (generally does not require any response)
-          return "", mocked_code , mocked_content
-      else: # PUT (generally does not require any response)
-        # ServiceModel mocking
-        if url == "//clusters/test1/services/GANGLIA":
-          payload_stop = {'ServiceInfo': {'state': 'INSTALLED'}}
-          payload_started = {'ServiceInfo': {'state': 'STARTED'}}
-          payload_illegal = {'ServiceInfo': {'state': 'ILLEGAL_STATE'}}
-          if payload_stop == payload:
-            mocked_response = open('json/status_ok_with_id.json', 'r').read()
-            return mocked_response, mocked_code , mocked_content
-          elif payload_started == payload:
-            mocked_response = open('json/status_ok_with_id.json', 'r').read()
-            return mocked_response, mocked_code , mocked_content
-          elif payload_illegal == payload:
-            mocked_response = open('json/status_error_with_message.json', 'r').read()
-            return mocked_response, mocked_code , mocked_content
-        else:
-          return "", mocked_code , mocked_content
-        
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-project/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 4f9e9db..0d32510 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -12,7 +12,8 @@
   See the License for the specific language governing permissions and
   limitations under the License. See accompanying LICENSE file.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0                       http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0                       http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.ambari</groupId>
@@ -46,6 +47,14 @@
       <id>EclipseLink</id>
       <url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
     </repository>
+    <repository>
+      <id>spring-milestones</id>
+      <name>Spring Milestones</name>
+      <url>http://repo.spring.io/milestone</url>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+    </repository>
   </repositories>
   <profiles>
     <profile>
@@ -102,7 +111,7 @@
         <artifactId>guice-servlet</artifactId>
         <version>3.0</version>
       </dependency>
-       <dependency>
+      <dependency>
         <groupId>org.codehaus.jettison</groupId>
         <artifactId>jettison</artifactId>
         <version>1.1</version>
@@ -164,19 +173,19 @@
         <version>1.3.1.RELEASE</version>
       </dependency>
       <dependency>
-      <groupId>org.apache.directory.server</groupId>
-      <artifactId>apacheds-core</artifactId>
-      <version>1.5.5</version>
+        <groupId>org.apache.directory.server</groupId>
+        <artifactId>apacheds-core</artifactId>
+        <version>1.5.5</version>
       </dependency>
       <dependency>
-      <groupId>org.apache.directory.server</groupId>
-      <artifactId>apacheds-protocol-ldap</artifactId>
-      <version>1.5.5</version>
+        <groupId>org.apache.directory.server</groupId>
+        <artifactId>apacheds-protocol-ldap</artifactId>
+        <version>1.5.5</version>
       </dependency>
       <dependency>
-      <groupId>org.apache.directory.shared</groupId>
-      <artifactId>shared-ldap</artifactId>
-      <version>0.9.17</version>
+        <groupId>org.apache.directory.shared</groupId>
+        <artifactId>shared-ldap</artifactId>
+        <version>0.9.17</version>
       </dependency>
       <dependency>
         <groupId>org.slf4j</groupId>
@@ -213,7 +222,7 @@
         <artifactId>mockito-core</artifactId>
         <version>1.8.5</version>
       </dependency>
-       <dependency>
+      <dependency>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-server</artifactId>
         <version>7.6.7.v20120910</version>
@@ -366,6 +375,41 @@
         <artifactId>junit</artifactId>
         <version>4.10</version>
       </dependency>
+      <dependency>
+        <groupId>org.springframework.shell</groupId>
+        <artifactId>spring-shell</artifactId>
+        <version>1.1.0.RC3</version>
+      </dependency>
+      <dependency>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter</artifactId>
+        <version>1.0.2.RELEASE</version>
+      </dependency>
+      <dependency>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-test</artifactId>
+        <version>1.0.2.RELEASE</version>
+      </dependency>
+      <dependency>
+        <groupId>com.github.lalyos</groupId>
+        <artifactId>jfiglet</artifactId>
+        <version>0.0.3</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.groovy</groupId>
+        <artifactId>groovy-all</artifactId>
+        <version>2.1.8</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.groovy.modules.http-builder</groupId>
+        <artifactId>http-builder</artifactId>
+        <version>0.7.1</version>
+      </dependency>
+      <dependency>
+        <groupId>jline</groupId>
+        <artifactId>jline</artifactId>
+        <version>2.11</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
   <build>
@@ -418,9 +462,9 @@
           </execution>
         </executions>
         <configuration>
-            <controlDir>${basedir}/src/main/package/deb/control</controlDir>
+          <controlDir>${basedir}/src/main/package/deb/control</controlDir>
         </configuration>
-        </plugin>
+      </plugin>
     </plugins>
   </build>
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-shell/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-shell/pom.xml b/ambari-shell/pom.xml
new file mode 100644
index 0000000..80e7cad
--- /dev/null
+++ b/ambari-shell/pom.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0"?>
+<!-- Licensed under the Apache License, Version 2.0 (the "License"); you
+  may not use this file except in compliance with the License. You may obtain
+  a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
+  required by applicable law or agreed to in writing, software distributed
+  under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+  OR CONDITIONS OF ANY KIND, either express or implied. See the License for
+  the specific language governing permissions and limitations under the License.
+  See accompanying LICENSE file. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.apache.ambari</groupId>
+    <artifactId>ambari-project</artifactId>
+    <version>1.3.0-SNAPSHOT</version>
+    <relativePath>../ambari-project</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ambari</groupId>
+  <artifactId>ambari-shell</artifactId>
+  <packaging>jar</packaging>
+  <name>Ambari Shell</name>
+  <version>1.3.0-SNAPSHOT</version>
+  <description>Ambari Shell</description>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <start-class>org.apache.ambari.shell.AmbariShell</start-class>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.shell</groupId>
+      <artifactId>spring-shell</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter-test</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.github.lalyos</groupId>
+      <artifactId>jfiglet</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>2.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ambari</groupId>
+      <artifactId>groovy-client</artifactId>
+      <version>1.3.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <version>1.9.5</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>jline</groupId>
+      <artifactId>jline</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.0</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>src/main/resources/elephant.txt</exclude>
+            <exclude>src/test/resources/2columns</exclude>
+            <exclude>src/test/resources/3columns</exclude>
+            <exclude>src/test/resources/testBlueprint.json</exclude>
+          </excludes>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>test</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <skipAssembly>true</skipAssembly>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+        <version>1.0.2.RELEASE</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>repackage</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <mainClass>${start-class}</mainClass>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-shell/src/main/java/org/apache/ambari/shell/AmbariShell.java
----------------------------------------------------------------------
diff --git a/ambari-shell/src/main/java/org/apache/ambari/shell/AmbariShell.java b/ambari-shell/src/main/java/org/apache/ambari/shell/AmbariShell.java
new file mode 100644
index 0000000..02269a8
--- /dev/null
+++ b/ambari-shell/src/main/java/org/apache/ambari/shell/AmbariShell.java
@@ -0,0 +1,110 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.shell;
+
+import org.apache.ambari.groovy.client.AmbariClient;
+import org.apache.ambari.shell.model.AmbariContext;
+import org.apache.ambari.shell.model.Hints;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.shell.CommandLine;
+import org.springframework.shell.core.JLineShellComponent;
+import org.springframework.shell.event.ShellStatus;
+import org.springframework.shell.event.ShellStatusListener;
+
+/**
+ * Shell bootstrap.
+ */
+@Configuration
+@ComponentScan(basePackageClasses = {AmbariShell.class})
+public class AmbariShell implements CommandLineRunner, ShellStatusListener {
+
+  @Autowired
+  private CommandLine commandLine;
+  @Autowired
+  private JLineShellComponent shell;
+  @Autowired
+  private AmbariContext context;
+  @Autowired
+  private AmbariClient client;
+
+  @Override
+  public void run(String... arg) throws Exception {
+    String[] shellCommandsToExecute = commandLine.getShellCommandsToExecute();
+    if (shellCommandsToExecute != null) {
+      for (String cmd : shellCommandsToExecute) {
+        if (!shell.executeScriptLine(cmd)) {
+          break;
+        }
+      }
+    } else {
+      shell.addShellStatusListener(this);
+      shell.start();
+      shell.promptLoop();
+      shell.waitForComplete();
+    }
+  }
+
+  @Override
+  public void onShellStatusChange(ShellStatus oldStatus, ShellStatus newStatus) {
+    if (newStatus.getStatus() == ShellStatus.Status.STARTED) {
+      try {
+        String cluster = client.getClusterName();
+        boolean available = client.isBlueprintAvailable();
+        if (cluster == null) {
+          if (available) {
+            context.setHint(Hints.BUILD_CLUSTER);
+          } else {
+            context.setHint(Hints.ADD_BLUEPRINT);
+          }
+        } else {
+          context.setHint(Hints.PROGRESS);
+        }
+        context.setCluster(cluster);
+        context.setBlueprintsAvailable(available);
+      } catch (Exception e) {
+        System.out.println(e.getMessage());
+        shell.executeCommand("quit");
+      }
+    }
+  }
+
+
+  public static void main(String[] args) {
+    if (args.length == 0) {
+      System.out.println(
+        "\nAmbari Shell: Interactive command line tool for managing Apache Ambari.\n\n" +
+          "Usage:\n" +
+          "  java -jar ambari-shell.jar                  : Starts Ambari Shell in interactive mode.\n" +
+          "  java -jar ambari-shell.jar --cmdfile=<FILE> : Ambari Shell executes commands read from the file.\n\n" +
+          "Options:\n" +
+          "  --ambari.host=<HOSTNAME>       Hostname of the Ambari Server [default: localhost].\n" +
+          "  --ambari.port=<PORT>           Port of the Ambari Server [default: 8080].\n" +
+          "  --ambari.user=<USER>           Username of the Ambari admin [default: admin].\n" +
+          "  --ambari.password=<PASSWORD>   Password of the Ambari admin [default: admin].\n\n" +
+          "Note:\n" +
+          "  At least one option is mandatory."
+      );
+      System.exit(1);
+    }
+    new SpringApplicationBuilder(AmbariShell.class).showBanner(false).run(args);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-shell/src/main/java/org/apache/ambari/shell/commands/BasicCommands.java
----------------------------------------------------------------------
diff --git a/ambari-shell/src/main/java/org/apache/ambari/shell/commands/BasicCommands.java b/ambari-shell/src/main/java/org/apache/ambari/shell/commands/BasicCommands.java
new file mode 100644
index 0000000..8fd6c9f
--- /dev/null
+++ b/ambari-shell/src/main/java/org/apache/ambari/shell/commands/BasicCommands.java
@@ -0,0 +1,173 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.shell.commands;
+
+import static org.apache.ambari.shell.support.TableRenderer.renderMapValueMap;
+import static org.apache.ambari.shell.support.TableRenderer.renderSingleMap;
+
+import org.apache.ambari.groovy.client.AmbariClient;
+import org.apache.ambari.shell.model.AmbariContext;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+import org.springframework.stereotype.Component;
+
+/**
+ * Basic commands used in the shell. Delegating the commands
+ * to the Ambari Server via a Groovy based client.
+ *
+ * @see org.apache.ambari.groovy.client.AmbariClient
+ */
+@Component
+public class BasicCommands implements CommandMarker {
+
+  private AmbariClient client;
+  private AmbariContext context;
+
+  @Autowired
+  public BasicCommands(AmbariClient client, AmbariContext context) {
+    this.client = client;
+    this.context = context;
+  }
+
+  /**
+   * Checks whether the tasks command is available or not.
+   *
+   * @return true if its available false otherwise
+   */
+  @CliAvailabilityIndicator("tasks")
+  public boolean isTasksCommandAvailable() {
+    return context.isConnectedToCluster();
+  }
+
+  /**
+   * Prints the tasks of the Ambari Server.
+   *
+   * @param id id of the request
+   * @return task list
+   */
+  @CliCommand(value = "tasks", help = "Lists the Ambari tasks")
+  public String tasks(
+    @CliOption(key = "id", mandatory = false, help = "Id of the request; default is: 1", unspecifiedDefaultValue = "1") String id) {
+    return renderSingleMap(client.getTaskMap(id), "TASK", "STATUS");
+  }
+
+  /**
+   * Checks whether the service list command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("service list")
+  public boolean isServiceListCommandAvailable() {
+    return context.isConnectedToCluster();
+  }
+
+  /**
+   * Prints the available service list of the Ambari Server.
+   *
+   * @return service list
+   */
+  @CliCommand(value = "service list", help = "Lists the available services")
+  public String servicesList() {
+    return renderSingleMap(client.getServicesMap(), "SERVICE", "STATE");
+  }
+
+  /**
+   * Checks whether the service components command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("service components")
+  public boolean isServiceComponentsCommandAvailable() {
+    return context.isConnectedToCluster();
+  }
+
+  /**
+   * Prints the service components of the Ambari Server.
+   *
+   * @return service component list
+   */
+  @CliCommand(value = "service components", help = "Lists all services with their components")
+  public String serviceComponents() {
+    return renderMapValueMap(client.getServiceComponentsMap(), "SERVICE", "COMPONENT", "STATE");
+  }
+
+  /**
+   * Checks whether the debug on command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("debug on")
+  public boolean isDebugOnCommandAvailable() {
+    return !client.isDebugEnabled();
+  }
+
+  /**
+   * Turns the debug on. From now on users will see the URLs of the API calls.
+   *
+   * @return status message
+   */
+  @CliCommand(value = "debug on", help = "Shows the URL of the API calls")
+  public String debugOn() {
+    client.setDebugEnabled(true);
+    return "debug enabled";
+  }
+
+  /**
+   * Checks whether the debug off command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("debug off")
+  public boolean isDebugOffCommandAvailable() {
+    return client.isDebugEnabled();
+  }
+
+  /**
+   * Turns the debug off. URLs are not visible anymore.
+   *
+   * @return status message
+   */
+  @CliCommand(value = "debug off", help = "Stops showing the URL of the API calls")
+  public String debugOff() {
+    client.setDebugEnabled(false);
+    return "debug disabled";
+  }
+
+  /**
+   * Checks whether the hint command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("hint")
+  public boolean isHintCommandAvailable() {
+    return true;
+  }
+
+  /**
+   * Provides some hints what you can do in the current context.
+   *
+   * @return hint message
+   */
+  @CliCommand(value = "hint", help = "Shows some hints")
+  public String hint() {
+    return context.getHint();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/11dd9df8/ambari-shell/src/main/java/org/apache/ambari/shell/commands/BlueprintCommands.java
----------------------------------------------------------------------
diff --git a/ambari-shell/src/main/java/org/apache/ambari/shell/commands/BlueprintCommands.java b/ambari-shell/src/main/java/org/apache/ambari/shell/commands/BlueprintCommands.java
new file mode 100644
index 0000000..68ab343
--- /dev/null
+++ b/ambari-shell/src/main/java/org/apache/ambari/shell/commands/BlueprintCommands.java
@@ -0,0 +1,184 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.shell.commands;
+
+import static org.apache.ambari.shell.support.TableRenderer.renderMultiValueMap;
+import static org.apache.ambari.shell.support.TableRenderer.renderSingleMap;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+
+import org.apache.ambari.groovy.client.AmbariClient;
+import org.apache.ambari.shell.model.AmbariContext;
+import org.apache.ambari.shell.model.Hints;
+import org.apache.commons.io.IOUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+import org.springframework.stereotype.Component;
+
+/**
+ * Blueprint related commands used in the shell.
+ *
+ * @see org.apache.ambari.groovy.client.AmbariClient
+ */
+@Component
+public class BlueprintCommands implements CommandMarker {
+
+  private AmbariClient client;
+  private AmbariContext context;
+
+  @Autowired
+  public BlueprintCommands(AmbariClient client, AmbariContext context) {
+    this.client = client;
+    this.context = context;
+  }
+
+  /**
+   * Checks whether the blueprints command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("blueprint list")
+  public boolean isBlueprintListCommandAvailable() {
+    return context.areBlueprintsAvailable();
+  }
+
+  /**
+   * Prints all the blueprints.
+   *
+   * @return list of blueprints
+   */
+  @CliCommand(value = "blueprint list", help = "Lists all known blueprints")
+  public String listBlueprints() {
+    return renderSingleMap(client.getBlueprintsMap(), "BLUEPRINT", "STACK");
+  }
+
+  /**
+   * Checks whether the blueprint show command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator(value = "blueprint show")
+  public boolean isBlueprintShowCommandAvailable() {
+    return context.areBlueprintsAvailable();
+  }
+
+  /**
+   * Shows the requested blueprint's details.
+   *
+   * @param id id of the blueprint
+   * @return blueprint as formatted table
+   */
+  @CliCommand(value = "blueprint show", help = "Shows the blueprint by its id")
+  public String showBlueprint(
+    @CliOption(key = "id", mandatory = true, help = "Id of the blueprint") String id) {
+    return renderMultiValueMap(client.getBlueprintMap(id), "HOSTGROUP", "COMPONENT");
+  }
+
+  /**
+   * Checks whether the blueprint add command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator(value = "blueprint add")
+  public boolean isBlueprintAddCommandAvailable() {
+    return true;
+  }
+
+  /**
+   * Adds a blueprint to the Ambari server either through an URL or from a file.
+   * If both specified the file takes precedence.
+   *
+   * @param url  -optional, URL containing the blueprint json
+   * @param file - optional, file containing the blueprint json
+   * @return status message
+   */
+  @CliCommand(value = "blueprint add", help = "Add a new blueprint with either --url or --file")
+  public String addBlueprint(
+    @CliOption(key = "url", mandatory = false, help = "URL of the blueprint to download from") String url,
+    @CliOption(key = "file", mandatory = false, help = "File which contains the blueprint") File file) {
+    String message;
+    try {
+      String json = file == null ? readContent(url) : readContent(file);
+      if (json != null) {
+        client.addBlueprint(json);
+        message = "Blueprint added";
+        context.setHint(Hints.BUILD_CLUSTER);
+        context.setBlueprintsAvailable(true);
+      } else {
+        message = "No blueprint specified";
+      }
+    } catch (Exception e) {
+      message = "Cannot add blueprint: " + e.getMessage();
+    }
+    return message;
+  }
+
+  /**
+   * Checks whether the blueprint defaults command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator(value = "blueprint defaults")
+  public boolean isBlueprintDefaultsAddCommandAvailable() {
+    return !context.areBlueprintsAvailable();
+  }
+
+  /**
+   * Adds two default blueprints to the Ambari server.
+   *
+   * @return status message
+   */
+  @CliCommand(value = "blueprint defaults", help = "Adds the default blueprints to Ambari")
+  public String addBlueprint() {
+    String message = "Default blueprints added";
+    try {
+      client.addDefaultBlueprints();
+      context.setHint(Hints.BUILD_CLUSTER);
+      context.setBlueprintsAvailable(true);
+    } catch (Exception e) {
+      message = "Failed to add the default blueprints: " + e.getMessage();
+    }
+    return message;
+  }
+
+  private String readContent(File file) {
+    String content = null;
+    try {
+      content = IOUtils.toString(new FileInputStream(file));
+    } catch (IOException e) {
+      // not important
+    }
+    return content;
+  }
+
+  private String readContent(String url) {
+    String content = null;
+    try {
+      content = IOUtils.toString(new URL(url));
+    } catch (IOException e) {
+      // not important
+    }
+    return content;
+  }
+}


Mime
View raw message