Created 03-01-2016 04:36 PM
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.
Created 03-01-2016 04:39 PM
The back ticks around the text cause the command to execute and the output is put in place of the command text. So you get the fully qualified hostname of the machine where the command is being executed placed into the command. If you run this snippet from a shell that is not on the Ambari server, you will get an error because the command is being sent to the local machine.
Created 03-01-2016 04:39 PM
it means fully qualified domain name of the host. I think it was just to explain that full FQDN goes in the URL. I don't think it works as valid curl command as is but I've been surprised before @Ram D
Created 03-01-2016 04:39 PM
@Ram D where did you get this example?
Created 03-01-2016 04:48 PM
Created 03-01-2016 04:52 PM
@Ram D I think Terry answered it best.
Created 03-01-2016 04:39 PM
The back ticks around the text cause the command to execute and the output is put in place of the command text. So you get the fully qualified hostname of the machine where the command is being executed placed into the command. If you run this snippet from a shell that is not on the Ambari server, you will get an error because the command is being sent to the local machine.