Create API request for my vps script
Budget: $10 – $30 USD
Hello everyone
I have a python script located on my VPS
and in order to run it I use the following code on my python script :
import paramiko
cmd = ("/home/dist/dist/mysoftware")
ssh=paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect("myvpsip",22,'root','mypassword')
stdin,stdout,stderr=ssh.exec_command(cmd)
outlines=stdout.read()
print(outlines)
Is it possible to create an API or something like that, so instead of doing all this, I just want a "link" or request, so I could run the software like this :
import requests
url2 = "myip (or domain name)/apikey/home/mysoftware"
r = requests.get(url=url2)
print(r)
Thanks
I have a python script located on my VPS
and in order to run it I use the following code on my python script :
import paramiko
cmd = ("/home/dist/dist/mysoftware")
ssh=paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect("myvpsip",22,'root','mypassword')
stdin,stdout,stderr=ssh.exec_command(cmd)
outlines=stdout.read()
print(outlines)
Is it possible to create an API or something like that, so instead of doing all this, I just want a "link" or request, so I could run the software like this :
import requests
url2 = "myip (or domain name)/apikey/home/mysoftware"
r = requests.get(url=url2)
print(r)
Thanks