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.

how to use Ambari API to add host to new config group

how to use Ambari API to add host to new config group

I create the following ambari rest api in order to add the machine worker03.sys11.com to group_name from default group

 

Ambari server is - master02.sys11.com
Cluster name – HDP
Machine name to add to new group - worker03.sys11.com

 

 

But when I am running the following API

 

curl 'http://master02.sys11.com:8080/api/v1/clusters/HDP/config_groups' -u admin:admin -H "X-Requested-By: ambari" -i -X POST --data '[{"ConfigGroup":{"group_name":"custom_group","tag":"YARN","description":"This is a custom group","desired_configs":[],"hosts":[{"host_name":"worker03.sys11.com"}]}}]'

 

 

we get

 

 

HTTP/1.1 500 Server Error
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Pragma: no-cache
Set-Cookie: AMBARISESSIONID=i4190t4h27yk10awbqkm1fpmi;Path=/;HttpOnly
User: admin
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 48

{
"status": 500,
"message": "Server Error"

 

 

Where we are wrong?

 

reference - https://community.cloudera.com/t5/Support-Questions/how-to-use-Ambari-API-to-add-host-to-config-grou...

Michael-Bronson
Don't have an account?
Coming from Hortonworks? Activate your account here