@Shravan Kumar,
You can use the below API for Turn ON and Turn OFF respectively
curl -k -u <username>:<password> -H "X-Requested-By:ambari" -i -X PUT -d '{"RequestInfo":{"context":"Turn On Maintenance Mode for SNameNode"},"Body":{"HostRoles":{"maintenance_state":"ON"}}}' http://{ambari-host}:{ambari-port}/api/v1/clusters/{clustername}/hosts/{hostname}/host_components/SE...
curl -k -u <username>:<password> -H "X-Requested-By:ambari" -i -X PUT -d '{"RequestInfo":{"context":"Turn Off Maintenance Mode for SNameNode"},"Body":{"HostRoles":{"maintenance_state":"OFF"}}}' http://{ambari-host}:{ambari-port}/api/v1/clusters/{clustername}/hosts/{hostname}/host_components/SE...
Replace the ambari-host,ambari-port , clustername and hostname placeholders with the original value.
Thanks,
Aditya