Ambari API call failing -install host component
I am trying to install components using a python script. Based loosely upon the community example I found here:
https://github.com/datagulp/hdp_utilities/blob/master/autoScale.sh
At the step where I get a list of components from another compute node, then try to replicate, I can add each component onto a node with a POST successfully. I can see the components being added. But when I try to then do a PUT to set the state of each one to INSTALLED, it fails.
curl -u user1 -i -H "X-Requested-By:ambari" -X PUT -d '{"HostRoles": {"state":"INSTALLED"}}' http://my-ambari-host:8080/api/v1/clusters/my-cluster/hosts/my-host/host_components/ATLAS_CLIENT
{
"status" : 400,
"message" : "java.lang.IllegalArgumentException: Missing KDC administrator credentials.\nThe KDC administrator credentials must be set as a persisted or temporary credential resource.This may be done by issuing a POST to the /api/v1/clusters/:clusterName/credentials/kdc.admin.credential API entry point with the following payload:\n{\n \"Credential\" : {\n \"principal\" : \"(PRINCIPAL)\", \"key\" : \"(PASSWORD)\", \"type\" : \"(persisted|temporary)\"}\n }\n}"
}

