code tao vps

 avatar
user_8607526207
python
2 years ago
536 B
3
Indexable
Never
import requests
api = "3LQH7PQ2LATEMYY6UVWF63LLNQE7YF5LZAWQ"
url = "https://api.vultr.com/v2/instances"
url_plan = "https://api.vultr.com/v2/plans"
headers = {"Authorization": "Bearer {}".format(api),"Content-Type": "application/json"}
data = {
"region":"ewr",
"plan":"vc2-1c-1gb",
"label":"Tao tu server",
"os_id":"387"
}
#response = requests.post(url,json=data,headers=headers)

reponse = requests.get(url_plan,json=data,headers=headers)

nhanto  =reponse.json()["plans"]["ram"]


for cur in nhanto:
	print(cur)