域名管理接口
更新时间:2026-11-06
域名管理接口
创建加速域名接口
您可以参考API文档获取参数的详细信息:创建加速域名接口
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'siteId' => 1,
4 'domain' => '1.test-sdk-eo.baidu.com',
5 'originConfig' => array(
6 array(
7 'addr' => '1.2.3.4', // IP 类型源站
8 'httpPort' => 80,
9 'type' => 'IP',
10 'upstreamProtocol' => 'http',
11 'host' => 'test.eo.com',
12 ),
13 ),
14);
15
16$resp = $client->createDomain($config);
17print_r($resp);
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'siteId' => 1,
4 'domain' => '1.test-sdk-eo.baidu.com',
5 'originConfig' => array(
6 array(
7 'addr' => 'test.origin.com', // 域名类型源站
8 'httpPort' => 80,
9 'type' => 'DOMAIN',
10 'upstreamProtocol' => 'http',
11 'host' => 'test.eo.com',
12 ),
13 ),
14);
15
16$resp = $client->createDomain($config);
17print_r($resp);
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'siteId' => 1,
4 'domain' => '1.test-sdk-eo.baidu.com',
5 'originConfig' => array(
6 array(
7 'type' => 'BUCKET',
8 'addr' => 'test.bucket', // 对象存储类型源站
9 'backup' => false,
10 'host' => 'test.eo.com',
11 'upstreamProtocol' => 'http',
12 'thirdBucketAuth' => array(
13 'authType' => 'bos',
14 'enabled' => true,
15 ),
16 'httpPort' => 80,
17 ),
18 ),
19);
20
21$resp = $client->createDomain($config);
22print_r($resp);
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'siteId' => 1,
4 'domain' => '1.test-sdk-eo.baidu.com',
5 'originPoolId' => 'geo_30RjuhwJ7anZ', // 源站池类型源站
6 'upstreamProtocol' => 'http',
7 'httpPort' => 80,
8);
9
10$resp = $client->createDomain($config);
11print_r($resp);
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'siteId' => 1,
4 'domain' => 'a.test.com',
5 'loadBalanceId' => 'eo_lb_30RjuhwJ7anZ', // 负载均衡类型源站
6 'upstreamProtocol' => 'http',
7 'httpPort' => 80,
8);
9
10$resp = $client->createDomain($config);
11print_r($resp);
查询域名配置接口
您可以参考API文档获取参数的详细信息:查询域名配置接口
PHP
1$client = new EoClient($EO_CONFIG);
2$resp = $client->getDomainConfig('1.test-sdk-eo.baidu.com');
3print_r($resp);
更新域名配置接口
您可以参考API文档获取参数的详细信息:更新域名配置接口
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'domain' => '1.test-sdk-eo.baidu.com',
4 'config' => array(
5 'loadBalanceId' => 'eo_lb_cBDWrpmrxO0B', // 更新为负载均衡源站
6 'upstreamProtocol' => 'http',
7 'httpPort' => 80,
8 ),
9 'site' => 'test-sdk-eo.baidu.com',
10);
11
12$resp = $client->updateDomainConfig($config);
13print_r($resp);
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'domain' => '1.test.com',
4 'config' => array(
5 'originConfig' => array(
6 array(
7 'addr' => '1.2.3.4', // 更新 IP 源站 + IPv6 + HTTPS
8 'type' => 'IP',
9 'host' => 'test.host.com',
10 'httpPort' => 80,
11 'upstreamProtocol' => 'http',
12 ),
13 ),
14 'ipv6Dispatch' => array(
15 'enable' => 'ON',
16 ),
17 'httpsEnabled' => 'ON',
18 'certId' => 'xxx',
19 ),
20);
21
22$resp = $client->updateDomainConfig($config);
23print_r($resp);
查询域名列表接口
您可以参考API文档获取参数的详细信息:查询域名列表接口
PHP
1$client = new EoClient($EO_CONFIG);
2$query = array(
3 'siteId' => 1, // 按站点ID查询
4 'pageNo' => 1,
5 'pageSize' => 10,
6);
7
8$resp = $client->getDomainsWithConfig($query);
9print_r($resp);
PHP
1$client = new EoClient($EO_CONFIG);
2$resp = $client->getDomainsWithConfig(array());
3print_r($resp);
启用加速域名接口
您可以参考API文档获取参数的详细信息:启用加速域名接口
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'domains' => array(
4 '1.test-sdk-eo.baidu.com',
5 '2.test-sdk-eo.baidu.com',
6 ),
7);
8
9$resp = $client->startDomain($config);
10print_r($resp);
停用加速域名接口
您可以参考API文档获取参数的详细信息:停用加速域名接口
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'domain' => '1.test-sdk-eo.baidu.com',
4);
5
6$resp = $client->stopDomain($config);
7print_r($resp);
删除加速域名接口
您可以参考API文档获取参数的详细信息:删除加速域名接口
PHP
1$client = new EoClient($EO_CONFIG);
2$config = array(
3 'domains' => array(
4 '1.test-sdk-eo.baidu.com',
5 '2.test-sdk-eo.baidu.com',
6 ),
7);
8
9$resp = $client->deleteDomain($config);
10print_r($resp);
评价此篇文章
