到期通知可控制是否atall
parent
4793be47ea
commit
ce0f5adb62
|
@ -88,11 +88,11 @@ def exp(account,collect_days,notify_days,notify_amount):
|
||||||
if exp_config['switch'] and exp_config.get('wecom',False):
|
if exp_config['switch'] and exp_config.get('wecom',False):
|
||||||
notify.wecom(wecomwh,content)
|
notify.wecom(wecomwh,content)
|
||||||
if exp_config['switch'] and exp_config.get('dingding',False):
|
if exp_config['switch'] and exp_config.get('dingding',False):
|
||||||
notify.dingding(dingdingwh,content)
|
notify.dingding(dingdingwh,content,isatall)
|
||||||
if exp_config['switch'] and exp_config.get('feishu',False):
|
if exp_config['switch'] and exp_config.get('feishu',False):
|
||||||
title = '阿里云资源到期通知'
|
title = '阿里云资源到期通知'
|
||||||
md = content
|
md = content
|
||||||
notify.feishu(feishuwh,title,md)
|
notify.feishu(feishuwh,title,md,isatall)
|
||||||
#print(f"=====【阿里云:余额与到期日统计结束:{account}】", flush=True)
|
#print(f"=====【阿里云:余额与到期日统计结束:{account}】", flush=True)
|
||||||
|
|
||||||
def group(account):
|
def group(account):
|
||||||
|
|
|
@ -64,6 +64,7 @@ def exp(account,collect_days,notify_days,notify_amount):
|
||||||
wecomwh = exp_config.get('wecomwh','')
|
wecomwh = exp_config.get('wecomwh','')
|
||||||
dingdingwh = exp_config.get('dingdingwh','')
|
dingdingwh = exp_config.get('dingdingwh','')
|
||||||
feishuwh = exp_config.get('feishuwh','')
|
feishuwh = exp_config.get('feishuwh','')
|
||||||
|
isatall = exp_config.get('isatall', True)
|
||||||
if notify_dict != {}:
|
if notify_dict != {}:
|
||||||
msg = [f'### 华为云账号 {account}:\n### 以下资源到期日小于 {notify_days} 天:']
|
msg = [f'### 华为云账号 {account}:\n### 以下资源到期日小于 {notify_days} 天:']
|
||||||
for k,v in notify_dict.items():
|
for k,v in notify_dict.items():
|
||||||
|
@ -72,21 +73,21 @@ def exp(account,collect_days,notify_days,notify_amount):
|
||||||
if exp_config['switch'] and exp_config.get('wecom',False):
|
if exp_config['switch'] and exp_config.get('wecom',False):
|
||||||
notify.wecom(wecomwh,content)
|
notify.wecom(wecomwh,content)
|
||||||
if exp_config['switch'] and exp_config.get('dingding',False):
|
if exp_config['switch'] and exp_config.get('dingding',False):
|
||||||
notify.dingding(dingdingwh,content)
|
notify.dingding(dingdingwh,content,isatall)
|
||||||
if exp_config['switch'] and exp_config.get('feishu',False):
|
if exp_config['switch'] and exp_config.get('feishu',False):
|
||||||
title = '华为云资源到期通知'
|
title = '华为云资源到期通知'
|
||||||
md = content
|
md = content
|
||||||
notify.feishu(feishuwh,title,md)
|
notify.feishu(feishuwh,title,md,isatall)
|
||||||
if amount_dict != {}:
|
if amount_dict != {}:
|
||||||
content = f'### 华为云账号 {account}:\n### 可用余额:<font color=\"#ff0000\">{amount}</font> 元'
|
content = f'### 华为云账号 {account}:\n### 可用余额:<font color=\"#ff0000\">{amount}</font> 元'
|
||||||
if exp_config['switch'] and exp_config.get('wecom',False):
|
if exp_config['switch'] and exp_config.get('wecom',False):
|
||||||
notify.wecom(wecomwh,content)
|
notify.wecom(wecomwh,content)
|
||||||
if exp_config['switch'] and exp_config.get('dingding',False):
|
if exp_config['switch'] and exp_config.get('dingding',False):
|
||||||
notify.dingding(dingdingwh,content)
|
notify.dingding(dingdingwh,content,isatall)
|
||||||
if exp_config['switch'] and exp_config.get('feishu',False):
|
if exp_config['switch'] and exp_config.get('feishu',False):
|
||||||
title = '华为云余额不足通知'
|
title = '华为云余额不足通知'
|
||||||
md = content
|
md = content
|
||||||
notify.feishu(feishuwh,title,md)
|
notify.feishu(feishuwh,title,md,isatall)
|
||||||
|
|
||||||
except exceptions.ClientRequestException as e:
|
except exceptions.ClientRequestException as e:
|
||||||
print(e.status_code)
|
print(e.status_code)
|
||||||
|
|
|
@ -54,6 +54,7 @@ def exp(account,collect_days,notify_days,notify_amount):
|
||||||
wecomwh = exp_config.get('wecomwh','')
|
wecomwh = exp_config.get('wecomwh','')
|
||||||
dingdingwh = exp_config.get('dingdingwh','')
|
dingdingwh = exp_config.get('dingdingwh','')
|
||||||
feishuwh = exp_config.get('feishuwh','')
|
feishuwh = exp_config.get('feishuwh','')
|
||||||
|
isatall = exp_config.get('isatall', True)
|
||||||
if notify_dict != {}:
|
if notify_dict != {}:
|
||||||
msg = [f'### 腾讯云账号 {account}:\n### 以下资源到期日小于 {notify_days} 天:']
|
msg = [f'### 腾讯云账号 {account}:\n### 以下资源到期日小于 {notify_days} 天:']
|
||||||
for k,v in notify_dict.items():
|
for k,v in notify_dict.items():
|
||||||
|
@ -62,21 +63,21 @@ def exp(account,collect_days,notify_days,notify_amount):
|
||||||
if exp_config['switch'] and exp_config.get('wecom',False):
|
if exp_config['switch'] and exp_config.get('wecom',False):
|
||||||
notify.wecom(wecomwh,content)
|
notify.wecom(wecomwh,content)
|
||||||
if exp_config['switch'] and exp_config.get('dingding',False):
|
if exp_config['switch'] and exp_config.get('dingding',False):
|
||||||
notify.dingding(dingdingwh,content)
|
notify.dingding(dingdingwh,content,isatall)
|
||||||
if exp_config['switch'] and exp_config.get('feishu',False):
|
if exp_config['switch'] and exp_config.get('feishu',False):
|
||||||
title = '腾讯云资源到期通知'
|
title = '腾讯云资源到期通知'
|
||||||
md = content
|
md = content
|
||||||
notify.feishu(feishuwh,title,md)
|
notify.feishu(feishuwh,title,md,isatall)
|
||||||
if amount_dict != {}:
|
if amount_dict != {}:
|
||||||
content = f'### 腾讯云账号 {account}:\n### 可用余额:<font color=\"#ff0000\">{amount}</font> 元'
|
content = f'### 腾讯云账号 {account}:\n### 可用余额:<font color=\"#ff0000\">{amount}</font> 元'
|
||||||
if exp_config['switch'] and exp_config.get('wecom',False):
|
if exp_config['switch'] and exp_config.get('wecom',False):
|
||||||
notify.wecom(wecomwh,content)
|
notify.wecom(wecomwh,content)
|
||||||
if exp_config['switch'] and exp_config.get('dingding',False):
|
if exp_config['switch'] and exp_config.get('dingding',False):
|
||||||
notify.dingding(dingdingwh,content)
|
notify.dingding(dingdingwh,content,isatall)
|
||||||
if exp_config['switch'] and exp_config.get('feishu',False):
|
if exp_config['switch'] and exp_config.get('feishu',False):
|
||||||
title = '腾讯云余额不足通知'
|
title = '腾讯云余额不足通知'
|
||||||
md = content
|
md = content
|
||||||
notify.feishu(feishuwh,title,md)
|
notify.feishu(feishuwh,title,md,isatall)
|
||||||
except TencentCloudSDKException as err:
|
except TencentCloudSDKException as err:
|
||||||
print(err)
|
print(err)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue