域名管理接口
更新时间:2026-11-04
域名管理接口
创建加速域名接口
您可以参考API文档获取参数的详细信息:创建加速域名接口
Python
1 def test_create_domain(eo_client):
2 """
3 create an accelerated domain with IP origin
4 """
5 response = eo_client.create_domain(
6 domain='a.test.com',
7 siteId=1,
8 originConfig=[
9 {'addr': '1.2.3.4', 'httpPort': 80, 'type': 'IP',
10 'upstreamProtocol': 'http', 'host': 'test.eo.com'}
11 ])
12 print(response)
Python
1 def test_create_domain_with_origin_pool(eo_client):
2 """
3 create an accelerated domain with origin pool
4 """
5 response = eo_client.create_domain(
6 domain='a.test.com',
7 siteId=1,
8 originPoolId='geo_30RjuhwJ7anZ',
9 upstreamProtocol='http',
10 httpPort=80)
11 print(response)
查询域名配置接口
您可以参考API文档获取参数的详细信息:查询域名配置接口
Python
1 def test_query_domain_config(eo_client):
2 """
3 query the config of an accelerated domain
4 """
5 response = eo_client.query_domain_config(domain='1.test.com')
6 print(response)
更新域名配置接口
您可以参考API文档获取参数的详细信息:更新域名配置接口
Python
1 def test_update_domain_config(eo_client):
2 """
3 update the config of an accelerated domain
4 """
5 response = eo_client.update_domain_config(
6 domain='1.test.com',
7 config={
8 'originConfig': [
9 {'addr': '1.2.3.4', 'type': 'IP', 'host': 'test.host.com',
10 'httpPort': 80, 'upstreamProtocol': 'http'}
11 ],
12 'ipv6Dispatch': {'enable': 'ON'},
13 'httpsEnabled': 'ON',
14 'certId': 'xxx'
15 })
16 print(response)
查询域名列表接口
您可以参考API文档获取参数的详细信息:查询域名列表接口
Python
1 def test_query_domains_with_config(eo_client):
2 """
3 query the accelerated domain list with simple config
4 """
5 response = eo_client.query_domains_with_config(
6 siteId=1,
7 pageNo=1,
8 pageSize=10)
9 print(response)
启用加速域名接口
您可以参考API文档获取参数的详细信息:启用加速域名接口
Python
1 def test_start_domain(eo_client):
2 """
3 start accelerated domains
4 """
5 response = eo_client.start_domain(domains=['1.test.com', '2.test.com'])
6 print(response)
停用加速域名接口
您可以参考API文档获取参数的详细信息:停用加速域名接口
Python
1 def test_stop_domain(eo_client):
2 """
3 stop a single accelerated domain
4 """
5 response = eo_client.stop_domain(domain='1.test.com')
6 print(response)
删除加速域名接口
您可以参考API文档获取参数的详细信息:删除加速域名接口
Python
1 def test_delete_domain(eo_client):
2 """
3 delete a single accelerated domain
4 """
5 response = eo_client.delete_domain(domain='1.test.com')
6 print(response)
评价此篇文章
