Support Questions
Find answers, ask questions, and share your expertise
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 to group_name from default group


Ambari server is -
Cluster name – HDP
Machine name to add to new group -



But when I am running the following API


curl '' -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":""}]}}]'



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 -

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