赞
踩
import os from openstack import connection import sys os.environ.setdefault('OS_CDN_ENDPOINT_OVERRIDE', 'https://cdn.myhuaweicloud.com/v1.0/') # CDN API url,example:https://cdn.myhuaweicloud.com/v1.0/ class REFRESH_TASK(object): def __init__(self): # AKSK Auth self.projectId = "" # Project ID of cn-north-1 self.cloud = "myhuaweicloud.com" # cdn use: cloud = "myhuaweicloud.com" self.region = "" # example: region = "cn-north-1" self.AK = "" self.SK = "" self.conn = connection.Connection( project_id=self.projectId, cloud=self.cloud, region=self.region, ak=self.AK, sk=self.SK) def refresh_create(self, _refresh_task): # print("refresh files or dirs:") task = self.conn.cdn.create_refresh_task(**_refresh_task) print(task) if __name__ == "__main__": # urls 更新的链接 urls = sys.argv[1] refresh_dir_task = { "type": "directory", "urls": [urls] } # refresh_create(refresh_file_task) refresh_task = REFRESH_TASK() refresh_task.refresh_create(refresh_dir_task)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。