Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

REST API + how to get the number of CPU on each data node

SOLVED Go to solution
Highlighted

REST API + how to get the number of CPU on each data node

hi all

how to get the number of CPU on each data node by REST API?

I also tried this but get error about:

[root@master02 ~]#  curl -u admin:admin -sS -G "https://master02:8080/api/v1/clusters/HDP/services/HDFS/components/DATANODE" 
curl: (35) SSL received a record that exceeded the maximum permissible length.
Michael-Bronson
1 ACCEPTED SOLUTION

Accepted Solutions

Re: REST API + how to get the number of CPU on each data node

Super Mentor

@Michael Bronson

You can try making the following kind of API call:

# curl -H "X-Requested-By: ambari" -u admin:admin -X GET "http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/hosts?fields=Hosts/host_name,Hosts/public_host_name,Hosts/cpu_count&host_compnents/HostRoles/component_name.in(DATANODE)"

.

Please replace the following (in addition to cre4dentials)

newhwx1.example.com:8080 => Ambari Server URL

NewCluster => Your ClusterName

.

Also if you are running your Abari Server on "HTTPS" secure port then please make sure that you are are appending "-k" in the curl command like:

# curl -k -H "X-Requested-By: ambari"  ......

.

2 REPLIES 2

Re: REST API + how to get the number of CPU on each data node

Super Mentor

@Michael Bronson

You can try making the following kind of API call:

# curl -H "X-Requested-By: ambari" -u admin:admin -X GET "http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/hosts?fields=Hosts/host_name,Hosts/public_host_name,Hosts/cpu_count&host_compnents/HostRoles/component_name.in(DATANODE)"

.

Please replace the following (in addition to cre4dentials)

newhwx1.example.com:8080 => Ambari Server URL

NewCluster => Your ClusterName

.

Also if you are running your Abari Server on "HTTPS" secure port then please make sure that you are are appending "-k" in the curl command like:

# curl -k -H "X-Requested-By: ambari"  ......

.

Re: REST API + how to get the number of CPU on each data node

@Jay chould you please help me with the follwing thred - https://community.hortonworks.com/questions/226622/rest-api-how-to-verify-the-max-value-for-each-par...

Michael-Bronson