Support Questions
Find answers, ask questions, and share your expertise

Ambari REST API commands(PUT) does not trigger starting services.

Highlighted

Ambari REST API commands(PUT) does not trigger starting services.

New Contributor

When I try to GET command like below, I have got the response without problem.

--Request--

curl -u admin:<pass> -X GET http://<server>:8080/api/v1clusters/<cluster>/services/HDFS

--

 

But when I try to PUT operation like below to start each service, it will return the code 200 but the service does not start and on background operation.

--Request--

curl -u admin:<pass> -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Starting service via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' http://<server>:8080/api/v1clusters/<cluster>/services/HDFS

--

 

--Response--

Starting HDFS
HTTP/1.1 200 OK
Date: Fri, 12 Jun 2020 09:54:54 GMT
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-store
Pragma: no-cache
Set-Cookie: AMBARISESSIONID=node0vuyxytqmxdwkcmu54ukt46ha21.node0;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: admin
Content-Type: text/plain;charset=utf-8
X-Content-Type-Options: nosniff
Content-Length: 0

--

Does anyone have how to fix this behavior?