Support Questions

Find answers, ask questions, and share your expertise

Is there any possibility to decommission the node through REST API?

avatar
Expert Contributor

I am looking to decommission the node through REST API.

1 ACCEPTED SOLUTION
4 REPLIES 4

avatar
Master Mentor

avatar
Expert Contributor

Thank you @Artem Ervits.

avatar
Expert Contributor

curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari'-X PUT -d

'{"RequestInfo": {"context" :"Start HDFS via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}'

http://`hostname -f`:8080/api/v1/clusters/$CLUSTER_NAME/services/HDFS

In the above curl command, what is the meaning for "hostname -f". I am new to usage of REST APIs, it may be a stupid question. I would like to get clear idea for the above command.

avatar
Master Mentor

@Ram D ah ok, yes in this example you will get FQDN of the server name for URL. I didn't know you can do that in curl command but basically if you run hostname -f as Linux command, you will get FQDN of your host. In context of the curl command, it will populate the URL programmatically with FQDN instead of using the node name explicitly.