incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject [1/4] AMBARI-3073. Amabri Client refactoring -2. (Subin via mahadev)
Date Tue, 10 Sep 2013 18:11:07 GMT
Updated Branches:
  refs/heads/trunk a4a26da76 -> dd5b2aa46


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/dd5b2aa4/ambari-client/src/test/python/json/get_cluster_services.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/get_cluster_services.json b/ambari-client/src/test/python/json/get_cluster_services.json
new file mode 100755
index 0000000..53bb2da
--- /dev/null
+++ b/ambari-client/src/test/python/json/get_cluster_services.json
@@ -0,0 +1,120 @@
+{
+  "href" : "http://localhost:8080/api/v1/clusters/test1/services?fields=*",
+  "items" : [
+    {
+      "href" : "http://localhost:8080/api/v1/clusters/test1/services/GANGLIA",
+      "ServiceInfo" : {
+        "cluster_name" : "test1",
+        "state" : "STARTED",
+        "service_name" : "GANGLIA",
+        "desired_configs" : {
+          "global" : "version1"
+        }
+      },
+      "components" : [
+        {
+          "href" : "http://localhost:8080/api/v1/clusters/test1/services/GANGLIA/components/GANGLIA_MONITOR",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "test1",
+            "component_name" : "GANGLIA_MONITOR",
+            "service_name" : "GANGLIA"
+          }
+        },
+        {
+          "href" : "http://localhost:8080/api/v1/clusters/test1/services/GANGLIA/components/GANGLIA_SERVER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "test1",
+            "component_name" : "GANGLIA_SERVER",
+            "service_name" : "GANGLIA"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://localhost:8080/api/v1/clusters/test1/services/MAPREDUCE",
+      "ServiceInfo" : {
+        "cluster_name" : "test1",
+        "state" : "STARTED",
+        "service_name" : "MAPREDUCE",
+        "desired_configs" : {
+          "mapred-site" : "version1",
+          "global" : "version1",
+          "core-site" : "version1"
+        }
+      },
+      "components" : [
+        {
+          "href" : "http://localhost:8080/api/v1/clusters/test1/services/MAPREDUCE/components/TASKTRACKER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "test1",
+            "component_name" : "TASKTRACKER",
+            "service_name" : "MAPREDUCE"
+          }
+        },
+        {
+          "href" : "http://localhost:8080/api/v1/clusters/test1/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "test1",
+            "component_name" : "MAPREDUCE_CLIENT",
+            "service_name" : "MAPREDUCE"
+          }
+        },
+        {
+          "href" : "http://localhost:8080/api/v1/clusters/test1/services/MAPREDUCE/components/JOBTRACKER",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "test1",
+            "component_name" : "JOBTRACKER",
+            "service_name" : "MAPREDUCE"
+          }
+        }
+      ]
+    },
+    {
+      "href" : "http://localhost:8080/api/v1/clusters/test1/services/HDFS",
+      "ServiceInfo" : {
+        "cluster_name" : "test1",
+        "state" : "STARTED",
+        "service_name" : "HDFS",
+        "desired_configs" : {
+          "global" : "version1",
+          "hdfs-site" : "version1",
+          "core-site" : "version1"
+        }
+      },
+      "components" : [
+        {
+          "href" : "http://localhost:8080/api/v1/clusters/test1/services/HDFS/components/SECONDARY_NAMENODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "test1",
+            "component_name" : "SECONDARY_NAMENODE",
+            "service_name" : "HDFS"
+          }
+        },
+        {
+          "href" : "http://localhost:8080/api/v1/clusters/test1/services/HDFS/components/HDFS_CLIENT",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "test1",
+            "component_name" : "HDFS_CLIENT",
+            "service_name" : "HDFS"
+          }
+        },
+        {
+          "href" : "http://localhost:8080/api/v1/clusters/test1/services/HDFS/components/NAMENODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "test1",
+            "component_name" : "NAMENODE",
+            "service_name" : "HDFS"
+          }
+        },
+        {
+          "href" : "http://localhost:8080/api/v1/clusters/test1/services/HDFS/components/DATANODE",
+          "ServiceComponentInfo" : {
+            "cluster_name" : "test1",
+            "component_name" : "DATANODE",
+            "service_name" : "HDFS"
+          }
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/dd5b2aa4/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
new file mode 100755
index 0000000..709b94b
--- /dev/null
+++ b/ambari-client/src/test/python/json/get_host_component.json
@@ -0,0 +1,41 @@
+{
+  "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/incubator-ambari/blob/dd5b2aa4/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
new file mode 100755
index 0000000..94a3027
--- /dev/null
+++ b/ambari-client/src/test/python/json/get_host_components.json
@@ -0,0 +1,60 @@
+{
+  "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/incubator-ambari/blob/dd5b2aa4/ambari-client/src/test/python/json/get_service.json
----------------------------------------------------------------------
diff --git a/ambari-client/src/test/python/json/get_service.json b/ambari-client/src/test/python/json/get_service.json
old mode 100644
new mode 100755

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/dd5b2aa4/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
new file mode 100755
index 0000000..3e993cd
--- /dev/null
+++ b/ambari-client/src/test/python/json/get_service_component.json
@@ -0,0 +1,108 @@
+{
+  "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/incubator-ambari/blob/dd5b2aa4/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
new file mode 100755
index 0000000..967bcbd
--- /dev/null
+++ b/ambari-client/src/test/python/json/get_service_components.json
@@ -0,0 +1,133 @@
+{
+  "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/incubator-ambari/blob/dd5b2aa4/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
old mode 100644
new mode 100755


Mime
View raw message