阿里云自动提升临时带宽自动化脚本

#!/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

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值