Am trying Cloudera Manager APIs with the help of Python in AWS. I was trying to execute some commands in the Zookeeper Command Line Interface after executing the script 'zkCli.sh'. I have tried using the below command using subprocess and am able to login to the zookeeper cli.
subprocess.call('ssh -o StrictHostKeyChecking=no -t -t -i /home/ec2-user/key.pem ec2-user@xx.xx.xx.xx "sudo /opt/cloudera/parcels/CDH/lib/zookeeper/bin/zkCli.sh"', shell=True)
Can anybody help me to execute other commands in the zookeeper cli (say 'ls /') using the same subprocess.
Is there any other methods to achieve the above case in Python ?