26 lines
557 B
Python
26 lines
557 B
Python
# -*- coding: utf-8 -*-
|
|
import os
|
|
import sys
|
|
|
|
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../")
|
|
|
|
from volcengine.example.dcdn import ak, sk
|
|
from volcengine.dcdn.DCDNService import DCDNService
|
|
|
|
if __name__ == '__main__':
|
|
svc = DCDNService()
|
|
|
|
# call below method if you dont set ak and sk in $HOME/.volc/config
|
|
svc.set_ak(ak)
|
|
svc.set_sk(sk)
|
|
|
|
body = {
|
|
"TaskType": "refresh_url",
|
|
"Urls": [
|
|
"www.test.com"
|
|
]
|
|
}
|
|
|
|
resp = svc.create_purge_prefetch_task(body)
|
|
print(resp)
|