#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import json
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.request import CommonRequest
import datetime,time
currentGt=4 # max add
dev="eth0" #set dev
devio=0 #0 out / 1 in
key=[<ccessKeyId>,<accessSecret>] #key
ecsformat,autopay,ecsid = ['cn-shenzhen' , 'true' , 'i-wz9c913ulnzfabbtm22d'] #ecsinfo
ecsinfo=ecsformat,autopay,ecsid
ecsidlist=[ecsid]
############################################################## 逻辑部分
def main():
while 1==1:
current,currentuse,Judge=getCurrentUseNetwork(key,ecsformat,ecsidlist)
Oder = 1024
if int(Judge) > 950 and int(Judge) <= 1000:
date=datetime.datetime.now()
start_time=(2019,date.strftime("%m"),date.strftime("%d"),date.strftime("%H"),date.strftime("%M"),00)
start,stop=start_end(start_time, 4)
aliyunpay(key,ecsinfo,start,stop,currentuse + currentGt)
Oder=currentuse + currentGt
time.sleep(250)
elif int(Judge) > 1000 :
date=datetime.datetime.now()
start_time=(2019,date.strftime("%m"),date.strftim