-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
33 lines (27 loc) · 1.15 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import cdn_api_client
username = 'YOUR_API_USERNAME';
password = 'YOUR_API_PASSWORD';
cdn_id = 'YOUR_CDN_SERVICE_ID';
if __name__ == '__main__':
client = cdn_api_client.CDNsunCdnApiClient({ 'username': username,
'password': password })
response = client.get({ 'url': 'cdns' })
print(response)
response = client.get({ 'url': 'cdns/' + str(cdn_id) + '/reports',
'data': {
'type': 'GB',
'period': '4h'
}
})
print(response)
response = client.post({ 'url': 'cdns/' + str(cdn_id) + '/purge',
'data': {
'purge_paths': [
'/path1.img',
'/path2.img'
]
}
})
print(response)
response = client.get({ 'url': 'cdns/' + str(cdn_id) })
print(response)