Authored by root

添加demo注释

... ... @@ -4,7 +4,8 @@
"""
修改腾讯云七层负载均衡器的权重
demo: python lb_switch.py --secretid=AKID6**************dwpKK --secretkey=ACJk9**************sQaW --lb_name=ytx-switch-test --domain=search.yohoops.org --hostname=search-service-az2 --weight=10
demo(命令行参数): python lb_switch.py --secretid=AKID6**************dwpKK --secretkey=ACJk9**************sQaW --lb_name=ytx-switch-test --domain=search.yohoops.org --hostname=search-service-az2 --weight=10
demo(模块): python lb_switch.py --secretid=AKID6**************dwpKK --secretkey=ACJk9**************sQaW --module=search_to_az2
@see doc: https://cloud.tencent.com/document/product/214/8978
... ... @@ -34,7 +35,7 @@ if __name__ == "__main__":
#执行模块
print '模块{0}已匹配'.format(args.module)
module = json.load(open(module_file))
for lb_id in module.keys:
for lb_id in module.keys():
if module[lb_id].has_key("domain") and module[lb_id]["domain"]:
modify_alb_weight(args.secretid, args.secretkey, lb_id, module[lb_id]["domain"], ip_weight_dict=module[lb_id]["mappings"], default_weight=args.default_weight)
else:
... ...