源站池接口
更新时间:2026-11-04
源站池接口
创建源站池接口
您可以参考API文档获取参数的详细信息:创建源站池接口
Python
1def test_create_origin_pool(eo_client):
2 """
3 create an origin pool of a site
4 """
5 origin_pool = {
6 'name': 'test',
7 'originConfig': [
8 {
9 'addr': 'your.bos.bucket1.name',
10 'type': 'BUCKET',
11 'host': 'test.host.com',
12 'weight': 50,
13 'thirdBucketAuth': {'authType': 'bos', 'enabled': False}
14 },
15 {
16 'addr': 'test.s3.com',
17 'type': 'DOMAIN',
18 'host': 'test.host.com',
19 'weight': 50,
20 'thirdBucketAuth': {
21 'authType': 'aws_v4',
22 'enabled': True,
23 'ak': 'your ak',
24 'sk': 'your sk',
25 'bucket': 'your bucket'
26 }
27 },
28 {'addr': 'test.origin.com', 'type': 'DOMAIN', 'weight': 50,
29 'host': 'test.host.com'},
30 {'addr': '1.2.3.4', 'type': 'IP', 'weight': 50,
31 'host': 'test.host.com'}
32 ]
33 }
34 response = eo_client.create_origin_pool(
35 site='test-sdk-eo.baidu.com',
36 originPool=origin_pool)
37 print(response)
查询源站池接口
您可以参考API文档获取参数的详细信息:查询源站池接口
Python
1def test_query_origin_pool(eo_client):
2 """
3 query the origin pools of a site
4 """
5 response = eo_client.query_origin_pool(
6 site='test-sdk-eo.baidu.com',
7 originPoolId='geo_LGKm6ryALtnO')
8 print(response)
修改源站池接口
您可以参考API文档获取参数的详细信息:修改源站池接口
Python
1def test_update_origin_pool(eo_client):
2 """
3 update an origin pool of a site
4 """
5 origin_pool = {
6 'name': 'test',
7 'originConfig': [
8 {'addr': 'test.origin.com', 'type': 'DOMAIN', 'weight': 50,
9 'host': 'test.host.com'},
10 {'addr': '1.2.3.4', 'type': 'IP', 'weight': 50,
11 'host': 'test.host.com'}
12 ]
13 }
14 response = eo_client.update_origin_pool(
15 site='test-sdk-eo.baidu.com',
16 originPoolId='geo_LGKm6ryALtnO',
17 originPool=origin_pool)
18 print(response)
删除源站池接口
您可以参考API文档获取参数的详细信息:删除源站池接口
Python
1def test_delete_origin_pool(eo_client):
2 """
3 delete an origin pool of a site
4 """
5 response = eo_client.delete_origin_pool(
6 site='test-sdk-eo.baidu.com',
7 originPoolId='geo_tZhP32iF2mWU')
8 print(response)
评价此篇文章
