Agile deployment method with docker

This commit is contained in:
infidel
2022-12-17 01:45:33 +07:00
parent 59671130cb
commit 5d5357c57f
11 changed files with 53 additions and 7 deletions

View File

@@ -82,3 +82,29 @@ def req_ip_recommendation():
print(req_dump)
return json.dumps(req_dump)
def reg_bulk(data):
inf_s = get_session()
req_url = 'http://10.30.1.138:5000/api/new-client'
# req = inf_s.post(req_url, req_val)
for x in data:
uname = x[0]
email = x[1]
code = x[2]
org = x[3]
data = {"name":uname,"email":email,"code":code,"org":org}
# data = {"name":uname,"email":email,"allocated_ips":suggest_ips,"allowed_ips":allowed_ips,"extra_allowed_ips":[],"use_server_dns":true,"enabled":true,"preshared_key":true}
print(data)
# ret_reg=$(curl -s --location --request POST 'http://10.30.1.138:5000/new-client' \
# --header 'Content-Type: application/json' \
# --cookie .tmp-cookie \
# --data-raw '{"name":"'$uname'","email":"'$email'","allocated_ips":'$suggest_ips',"allowed_ips":["10.0.0.0/8", "192.168.100.0/24"],"extra_allowed_ips":[],"use_server_dns":true,"enabled":true,"preshared_key":true}' )