incubator-ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mahadev Konar <maha...@hortonworks.com>
Subject Re: get service content fail
Date Mon, 10 Jun 2013 07:51:48 GMT
Juby,
 I think its mostly bash interpreting the &.
 Just put single quotes around your url:
  curl -u admin:admin -X GET -i *'*
http://10.1.191.20:8080/api/v1/clusters/ambari5f/configurations?type=mapred-site&tag=version1
*'*
* *The above should work.

mahadev
On Sun, Jun 9, 2013 at 7:41 PM, jbuy0710 <juby0710@gmail.com> wrote:

> Hi
>
> I try the following command to get the information of service content
>   curl -u admin:admin -X GET -i
> http://10.1.191.20:8080/api/v1/clusters/ambari5f/configurations?type=mapred-site&tag=version1
>
> The expected result is
>
> {
>
>   "href" : "
> http://10.1.191.20:8080/api/v1/clusters/ambari5f/configurations?type=mapred-site&tag=version1
> ",
>
>   "items" : [
>
>     {
>
>       "href" : "
> http://10.1.191.20:8080/api/v1/clusters/ambari5f/configurations?type=mapred-site&tag=version1
> ",
>
>       "tag" : "version1",
>
>       "type" : "mapred-site",
>
>       "Config" : {
>
>         "cluster_name" : "ambari5f"
>
>       },
>
>       "properties" : {
>
>         "mapred.reduce.tasks.speculative.execution" : "false",
>
>         "mapred.tasktracker.map.tasks.maximum" : "4",
>
>         "mapred.hosts.exclude" : "/etc/hadoop/mapred.exclude",
>
>         "mapreduce.tasktracker.group" : "hadoop",
>
> .
>
> .
>
> .
>
> But  the result I got lost the property section.
>
> {
>
>   "href" : "
> http://10.1.191.20:8080/api/v1/clusters/ambari5f/configurations?type=mapred-site
> ",
>
>   "items" : [
>
>     {
>
>       "href" : "
> http://10.1.191.20:8080/api/v1/clusters/ambari5f/configurations?type=mapred-site&tag=version1
> ",
>
>       "tag" : "version1",
>
>       "type" : "mapred-site",
>
>       "Config" : {
>
>         "cluster_name" : "ambari5f"
>
>       }
>
>     }
>
>   ]
>
> }
>
> [1]+  Done                    curl -u admin:admin -X GET -i
> http://10.1.191.20:8080/api/v1/clusters/ambari5f/configurations?type=mapred-site
>
>
>
> The problem seems only occurs when getting service content using curl to
> get the information.
>
> I try to use the browser to get the information of configuration , and
>  the result is as expected.
>
> Using the other command like the following will get the correct result,
> too.
>
> curl -u admin:admin -X GET -i
> http://10.1.191.20:8080/api/v1/clusters/ambari5f/services/HDFS/components/DATANODE
>
> {
>
>   "href" : "
> http://10.1.191.20:8080/api/v1/clusters/ambari5f/services/HDFS/components/DATANODE
> ",
>
>   "ServiceComponentInfo" : {
>
>     "cluster_name" : "ambari5f",
>
>     "component_name" : "DATANODE",
>
>     "state" : "STARTED",
>
>     "service_name" : "HDFS",
>
>     "desired_configs" : { }
>
>   },
>
>   "host_components" : [
>
>     {
>
>       "href" : "
> http://10.1.191.20:8080/api/v1/clusters/ambari5f/hosts/ambariserver.ambari/host_components/DATANODE
> ",
>
>       "HostRoles" : {
>
>         "cluster_name" : "ambari5f",
>
>         "component_name" : "DATANODE",
>
>         "host_name" : "ambariserver.ambari"
>
>       }
>
>     }
>
>   ]
>
>

Mime
View raw message