Skip to main content
mike_bronson7
Gold ⭐️⭐️⭐️
Jun 15, 2020 12:11 PM UTC
Solved

how to find number of CPU core on datanode machine by ambari rest API

Hi all

 

 

I am running the following ambari API in order to find the CPU count on data node machine

 

 

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

 

we get the error about:

 

 

{

  "status" : 400,

  "message" : "The properties [host_compnents/HostRoles/component_name] specified in the request or predicate are not supported for the resource type Host."

 

 

The target is to find the number of cpu on data node machine as we can do it on datanode linux machine

 

nproc

16

mike_bronson7
Gold ⭐️⭐️⭐️
Jun 15, 2020 12:23 PM UTC

 

the API is


curl -sH "X-Requested-By: ambari" -u admin:admin http://AMBARI_SERVER_FQDN:8080/api/v1/hosts/DATA_NODE_FQDN | grep cpu

Michael-Bronson

1 reply

mike_bronson7
mike_bronson7AuthorAnswer
Gold ⭐️⭐️⭐️
Jun 15, 2020 12:23 PM UTC

 

the API is


curl -sH "X-Requested-By: ambari" -u admin:admin http://AMBARI_SERVER_FQDN:8080/api/v1/hosts/DATA_NODE_FQDN | grep cpu

Translate
Michael-Bronson