Thanks Sumit for pointing the error. It returns all the properties info and I am able to grep the info .
After grepping it returns the namenode URL returns like this. "dfs.namenode.http-address" : "awsdcdpmn01.dpst.internal:50070", Thanks Anand On Mon, Jul 13, 2015 at 6:18 AM Sumit Mohanty <[email protected]> wrote: > You need to put the URL in quotes as "&" is being treated as special > character. > > > e.g. " > http://ec2-xx-xx-xxx-xx.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/configurations?type=hdfs-site&tag=1 > " > ------------------------------ > *From:* Anandha L Ranganathan <[email protected]> > *Sent:* Sunday, July 12, 2015 10:32 PM > > *To:* [email protected] > *Subject:* Re: Service endpoints URLs using Ambari APIs > > > > The response I get is this. > { > "href" : " > http://xxxxx.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/configurations?type=hdfs-site > ", > "items" : [ > { > "href" : " > http://ec2-xx-xx-xxx-xx.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/configurations?type=hdfs-site&tag=1 > ", > "tag" : "1", > "type" : "hdfs-site", > "version" : 1, > "Config" : { > "cluster_name" : "dc" > } > } > ] > } > > > > On Sun, Jul 12, 2015 at 10:59 AM Sumit Mohanty <[email protected]> > wrote: > >> What do you get when you use >> >> >> >> http://ambari-server-host.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/configurations?type=hdfs-site >> <http://ambari-server-host.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/configurations?type=hdfs-site&tag=1> >> >> ------------------------------ >> *From:* Anandha L Ranganathan <[email protected]> >> *Sent:* Sunday, July 12, 2015 12:23 AM >> *To:* [email protected] >> *Subject:* Re: Service endpoints URLs using Ambari APIs >> >> Thanks sumit for the quick reply. Here is the output I received. >> I don't see any http property in the config . >> >> I am using Ambari 2.0 version. >> >> 1) Retrieve tag info. >> curl -u user:xxxxxx >> http://ambari-server-host.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/hosts/awsdcdpmn01.dpst.internal/host_components/NAMENODE?fields=HostRoles/actual_configs/hdfs-site >> { >> "href" : " >> http://ambari-server-host.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/hosts/awsdcdpmn01.dpst.internal/host_components/NAMENODE?fields=HostRoles/actual_configs/hdfs-site >> ", >> "HostRoles" : { >> "cluster_name" : "dc", >> "component_name" : "NAMENODE", >> "host_name" : "awsdcdpmn01.dpst.internal", >> "actual_configs" : { >> "hdfs-site" : { >> "default" : "1" >> } >> } >> }, >> "host" : { >> "href" : " >> http://ambari-server-host.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/hosts/awsdcdpmn01.dpst.internal >> " >> } >> >> >> 2) Get the config info. >> curl -u user:xxxx >> http://ambari-server-host.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/configurations?type=hdfs-site&tag=1 >> >> { >> "href" : " >> http://ambari-server-host.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/configurations?type=hdfs-site >> ", >> "items" : [ >> { >> "href" : " >> http://ambari-server-host.us-west-2.compute.amazonaws.com:8080/api/v1/clusters/dc/configurations?type=hdfs-site&tag=1 >> ", >> "tag" : "1", >> "type" : "hdfs-site", >> "version" : 1, >> "Config" : { >> "cluster_name" : "dc" >> } >> } >> ] >> } >> >> >> >> >> >> On Sat, Jul 11, 2015 at 9:21 PM Sumit Mohanty <[email protected]> >> wrote: >> >>> Unfortunately, there is no single API for this. You need to merge data >>> from more than one API >>> >>> >>> * API to get the host(s) where the service is deployed (e.g. >>> http://ambari-server-host:8080/api/v1/clusters/c1/hosts/smc201-1.c.pramod-thangali.internal/host_components/NAMENODE?fields=HostRoles/actual_configs/hdfs-site >>> <http://smc201-1.c.pramod-thangali.internal:8080/api/v1/clusters/c1/hosts/smc201-1.c.pramod-thangali.internal/host_components/NAMENODE?fields=HostRoles/actual_configs/hdfs-site> >>> ) >>> >>> -- pick the tag for the actual config >>> >>> * Get the config and grep the property (e.g. >>> http://ambari-server-host:8080/api/v1/clusters/c1/configurations?type=hdfs-site&tag=version1436499674556 >>> <http://smc201-1.c.pramod-thangali.internal:8080/api/v1/clusters/c1/configurations?type=hdfs-site&tag=version1436499674556> >>> ) >>> >>> -- pick the correct property (e.g. dfs.namenode.http-address) >>> >>> >>> -Sumit >>> ------------------------------ >>> *From:* Anandha L Ranganathan <[email protected]> >>> *Sent:* Saturday, July 11, 2015 7:09 PM >>> *To:* [email protected] >>> *Subject:* Service endpoints URLs using Ambari APIs >>> >>> I am looking for an API that will provide all the service endpoints >>> of the components that are installed using Ambari >>> >>> >>> The api should return something like this. >>> >>> ResourceManager Logs = http://hostname1:8088/ >>> namenode = http://hostname:50070 >>> oozie = http://hostname2:11000 >>> It could be single API or multiple API call , anything is fine. >>> >>> Is there any API does exists ? >>> >>> >>> >>> >>>
