Skip to content

Instantly share code, notes, and snippets.

@hvnsweeting
Created September 14, 2012 05:24
Show Gist options
  • Save hvnsweeting/3719962 to your computer and use it in GitHub Desktop.
Save hvnsweeting/3719962 to your computer and use it in GitHub Desktop.
import requests
import json
HOST = "http://0.0.0.0:8080/create"
rules = [{"ip" : "123.123.123.123", "type":"all"},
{"ip" : "192.168.4.130" , "type" : "all"},
{"ip" : "192.168.3.182" , "type" : "all"},
{"ip" : "123.30.53.12" , "type" : "all"},
{"ip" : "222.255.27.156" , "type" : "all"},
{"ip" : "1.2.3.4", "type" : "ftp"},
{"ip" : "100.1.0.8", "type" : "ftp"},
]
data = {"email" : "vpn-admin@vccloud.vn", "id" : "4", "type" : ["editor","admin"], "rules" : rules}
r = requests.post(HOST, data=json.dumps(data))
print r.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment