文档首页/ 内容分发网络 CDN/ API参考/ API/ 域名配置/ 查询域名配置接口 - ShowDomainFullConfig
更新时间:2026-07-20 GMT+08:00
分享

查询域名配置接口 - ShowDomainFullConfig

功能介绍

查询域名配置接口,支持查询业务类型、服务范围、备注、IPv6开关、回源方式、回源URL改写、高级回源、Range回源、回源跟随、回源是否校验Etag、回源超时时间、回源请求头、HTTPS配置、TLS版本配置、强制跳转、HSTS、HTTP/2、OCSP Stapling、QUIC、缓存规则、状态码缓存时间、防盗链、IP黑白名单、Use-Agent黑白名单、URL鉴权配置、远程鉴权配置、IP访问限频、HTTP header配置、自定义错误页面配置、智能压缩、请求限速配置、WebSocket配置、视频拖拽、回源SNI、访问URL重写、浏览器缓存过期时间、区域访问控制、客户端证书配置、TLS版本与加密套件配置。

  • 单租户调用频率:300次/min。

调用方法

请参见如何调用API

授权信息

账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。

  • 如果使用角色与策略授权,具体权限要求请参见权限和授权项
  • 如果使用身份策略授权,需具备如下身份策略权限。

    授权项

    访问级别

    资源类型(*为必须)

    条件键

    别名

    依赖的授权项

    cdn:configuration:queryDomains

    Read

    domain *

    • g:ResourceTag/<tag-key>

    • g:EnterpriseProjectId

    -

    -

URI

GET /v1.1/cdn/configuration/domains/{domain_name}/configs

表1 路径参数

参数

是否必选

参数类型

描述

domain_name

String

参数解释:

加速域名

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

表2 Query参数

参数

是否必选

参数类型

描述

enterprise_project_id

String

参数解释:

企业项目id。您可以通过调用企业项目管理服务(EPS)的查询企业项目列表接口(ListEnterpriseProject)查询企业项目id

约束限制:

当用户开启企业项目功能时,该参数生效,表示查询资源所属项目,"all"表示所有项目

取值范围:

不涉及

默认取值:

不涉及

show_special_configs

String

参数解释:

是否展示特殊配置

约束限制:

不涉及

取值范围:

auth_key: 用来查询鉴权KEY和鉴权备KEY的值

默认取值:

不涉及

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

参数解释:

用户鉴权Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

响应参数

状态码:200

表4 响应Body参数

参数

参数类型

描述

configs

ConfigsGetBody object

配置项。

表5 ConfigsGetBody

参数

参数类型

描述

business_type

String

业务类型:

  • web:网站加速;

  • download:文件下载加速;

  • video:点播加速;

  • wholesite:全站加速。

service_area

String

服务区域:

  • mainland_china:中国大陆;

  • global:全球;

  • outside_mainland_china:中国大陆境外。

remark

String

域名备注。

origin_request_header

Array of OriginRequestHeader objects

回源请求头配置。

http_response_header

Array of HttpResponseHeader objects

http header配置。

url_auth

UrlAuthGetBody object

URL鉴权查询响应体。

https

HttpGetBody object

证书配置查询响应体。

sources

Array of SourcesConfigResponseBody objects

源站配置。

origin_protocol

String

回源协议,follow:协议跟随回源,http:HTTP回源(默认),https:https回源。

origin_follow302_status

String

回源跟随,on:开启,off:关闭。

cache_rules

Array of CacheRules objects

缓存规则。

ip_filter

IpFilter object

参数解释:

IP黑白名单,对用户的请求IP地址进行过滤,从而限制访问来源

referer

RefererConfig object

参数解释:

referer黑白名单,对访问者身份进行识别和过滤,从而限制访问来源

force_redirect

ForceRedirectConfig object

参数解释:

强制客户端使用HTTPS或HTTP协议访问CDN节点

compress

Compress object

参数解释:

智能压缩,压缩网站的静态资源,缩小传输文件的大小,提升传输效率,减少带宽消耗

cache_url_parameter_filter

CacheUrlParameterFilterGetBody object

缓存url参数配置查询响应体,

说明:

此参数作为旧参数,将于近期下线。

ipv6_accelerate

Integer

ipv6设置,1:打开;0:关闭。

error_code_cache

Array of ErrorCodeCache objects

状态码缓存时间。

origin_range_status

String

Range回源,开启: on,off:关闭。

user_agent_filter

UserAgentFilter object

参数解释:

UA黑白名单,对用户请求使用的代理过滤,从而限制访问来源

origin_request_url_rewrite

Array of OriginRequestUrlRewrite objects

改写回源URL。

flexible_origin

Array of flexibleOrigins objects

高级回源。

slice_etag_status

String

回源是否校验ETag,on:开启,off:关闭。

origin_receive_timeout

Integer

回源超时时间,单位:秒。

remote_auth

commonRemoteAuth object

参数解释:

配置远程鉴权,当用户向CDN节点请求资源时,CDN将用户请求转发到客户指定的鉴权服务器,CDN根据鉴权服务器返回的结果判断是否给用户返回资源

websocket

webSocketSeek object

参数解释:

是否允许客户端使用websocket协议访问CDN节点

说明:

WebSocket功能仅对缓存规则配置为“缓存过期时间为0,缓存过期时间来源为CDN且开启强制缓存”的资源生效

video_seek

videoSeek object

参数解释:

视频拖拽配置,用户可随意拖拽播放进度且不影响观看效果

request_limit_rules

Array of RequestLimitRules objects

参数解释:

请求限速配置

ip_frequency_limit

IpFrequencyLimitQuery object

Ip访问限频。

hsts

HstsQuery object

HSTS:配置HSTS后,将强制客户端(如浏览器)使用 HTTPS 协议访问服务器,提升访问安全性。

quic

Quic object

参数解释:

QUIC协议,客户端使用QUIC协议访问CDN节点,提高了传输的安全性,减少传输和连接时的延时,避免网络拥塞

error_code_redirect_rules

Array of ErrorCodeRedirectRules objects

自定义错误页面

sni

Sni object

参数解释:

回源SNI,如果源站IP绑定了多个域名,当CDN节点以HTTPS协议访问源站时,可以设置回源SNI,指定HTTPS协议握手时使用的SNI域名

request_url_rewrite

Array of RequestUrlRewrite objects

访问URL重写。

browser_cache_rules

Array of BrowserCacheRules objects

浏览器缓存过期时间。

access_area_filter

Array of AccessAreaFilter objects

参数解释:

区域访问控制,限制某些地理位置的用户访问

说明:

由于IP归属为运营商且不定期调整,华为云虽会定期更新IP地址库,也可能存在更新滞后的情况。因此可能导致部分访问控制功能偶尔误拦截或放行、客户端请求未调度到最佳节点等情况发生

client_cert

ClientCert object

参数解释:

客户端证书配置,实现客户端与CDN节点的双向证书认证,提高网站通信安全性

https_tls_version

HttpsTlsVersion object

参数解释:

配置TLS版本及加密套件,TLS版本需要匹配合适的加密套件使用,详情可参考CDN《用户指南》文档的“TLS版本与加密套件”章节。

flow_limit_strategy

Array of FlowLimitStrategy objects

参数解释:

设置用量封顶阈值,当实际用量大于阈值时停用域名,有效预防流量盗刷或恶意攻击带来的高额账单。

说明:

由于监控数据存在时延,域名将在用量达到阈值后的10分钟左右被停用

表6 OriginRequestHeader

参数

参数类型

描述

name

String

参数解释:

设置回源请求头参数

取值范围:

  • 1-100个字符

  • 由数字,大小写字母,中划线组成

  • 只能以字母开头

value

String

参数解释:

设置回源请求头参数的值

取值范围:

  • 1-1000个字符

  • 由数字0 - 9、字符a - z、A - Z,及特殊符“.”、“-”、“_”、“*”、“#”、“!”、“&”、“+”、“|”、“^”、“~”、“'”、“"”、“/”、“:”、“;”、“,”、“=”、“@”、“?”、“<”、“>”组成

  • 当为删除动作时,可不填

  • 不支持中文

  • 不支持变量配置,如:$client_ip,$remote_port等

action

String

参数解释:

回源请求头设置类型

取值范围:

  • delete: 删除

  • set: 设置

表7 HttpResponseHeader

参数

参数类型

描述

name

String

参数解释:

设置HTTP响应头参数

取值范围:

  • 1-100个字符

  • 由数字,大小写字母,中划线组成,只能以字母开头

value

String

参数解释:

设置HTTP响应头参数的值

取值范围:

  • 1-1000个字符

  • 支持字母、数字和特定字符.-_*#!&+|^~'"/:;,=@?<>等

  • 当为删除动作时,可不填

action

String

参数解释:

设置HTTP响应头操作类型

取值范围:

  • set: 设置

  • delete: 删除

表8 UrlAuthGetBody

参数

参数类型

描述

status

String

是否开启URL鉴权,on:开启,off:关闭。

type

String

鉴权方式,

type_a:鉴权方式A,

type_b:鉴权方式B,

type_c1:鉴权方式C1,

type_c2:鉴权方式C2。

expire_time

Integer

过期时间,单位:秒。

sign_method

String

加密算法。

match_type

String

鉴权范围。

inherit_config

InheritConfigQuery object

鉴权继承,为M3U8/MPD索引文件下的TS/MP4文件添加鉴权参数,解决因鉴权不通过导致的TS/MP4文件无法播放的问题。

key

String

鉴权KEY。

backup_key

String

鉴权KEY(备)。

sign_arg

String

鉴权参数。

time_format

String

时间格式,

dec:十进制,

hex:十六进制。

time_arg

String

时间参数。

表9 InheritConfigQuery

参数

参数类型

描述

status

String

是否开启鉴权继承,on:开启,off:关闭。

inherit_type

String

参数解释:

为m3u8/mpd索引文件下的ts/mp4文件添加鉴权参数,解决因鉴权不通过导致的ts/mp4文件无法播放的问题

取值范围:

  • m3u8

  • mpd

inherit_time_type

String

鉴权继承的文件类型时间,

sys_time:当前系统时间,parent_url_time:与m3u8和mpd访问链接保持一致。

表10 HttpGetBody

参数

参数类型

描述

https_status

String

HTTPS证书是否启用,on:开启,off:关闭。

certificate_type

String

证书类型。server:国际证书;server_sm:国密证书。

certificate_source

Integer

证书来源,1:华为云托管证书,0:自有证书。2:SCM证书。

scm_certificate_id

String

SCM证书id

certificate_name

String

证书名字。

certificate_value

String

HTTPS协议使用的证书内容,PEM编码格式。

expire_time

Long

证书过期时间。

说明:

UTC时间。

enc_certificate_value

String

国密证书加密证书内容,PEM编码格式。

certificates

Array of CertificatesGetBody objects

双证书配置查询响应体。

http2_status

String

是否使用HTTP2.0,on:是,off:否。

tls_version

String

传输层安全性协议。

ocsp_stapling_status

String

是否开启ocsp stapling,on:是,off:否。

表11 CertificatesGetBody

参数

参数类型

描述

certificate_source

Integer

证书来源,0:自有证书。2:SCM证书。

scm_certificate_id

String

SCM证书id

certificate_type

String

证书类型,server:国际证书;server_sm:国密证书。

certificate_name

String

证书名字。

certificate_value

String

HTTPS协议使用的证书内容,PEM编码格式。

enc_certificate_value

String

国密证书加密证书内容,PEM编码格式。

expire_time

Long

证书过期时间。

说明:

UTC时间。

表12 SourcesConfigResponseBody

参数

参数类型

描述

origin_type

String

源站类型,

  • ipaddr:源站IP;

  • domain:源站域名;

  • obs_bucket:OBS桶域名;

  • third_bucket:第三方桶,使用该源站类型需要提交工单申请。

origin_addr

String

源站IP或者域名。

priority

Integer

源站优先级,70:主,30:备。

weight

Integer

权重,取值范围1-100。

obs_web_hosting_status

String

是否开启OBS静态网站托管,源站类型为obs_bucket时传递,off:关闭,on:开启。

http_port

Integer

HTTP端口,默认80,端口取值取值范围1-65535。

https_port

Integer

HTTPS端口,默认443,端口取值取值范围1-65535。

host_name

String

回源HOST,默认加速域名。

obs_bucket_type

String

OBS桶类型。

  • private: 私有桶(除桶ACL授权外的其他用户无桶的访问权限)。

  • public: 公有桶(任何用户都可以对桶内对象进行读操作)。

bucket_access_key

String

第三方对象存储访问密钥。

说明:

源站类型为第三方桶时必填

bucket_secret_key

String

第三方对象存储密钥。

说明:

源站类型为第三方桶时必填

bucket_region

String

第三方对象存储区域。

说明:

源站类型为第三方桶时必填

bucket_name

String

第三方对象存储名称。

说明:

源站类型为第三方桶时必填

表13 CacheRules

参数

参数类型

描述

match_type

String

参数解释:

匹配类型

取值范围:

  • all: 匹配所有文件

  • file_extension: 按文件后缀匹配

  • catalog: 按目录匹配

  • full_path: 全路径匹配

  • home_page: 按首页匹配

match_value

String

参数解释:

缓存规则匹配内容

取值范围:

不涉及

ttl

Integer

参数解释:

资源在CDN节点的缓存过期时间

取值范围:

不涉及

ttl_unit

String

参数解释:

缓存过期时间单位

取值范围:

  • s: 秒

  • m: 分

  • h: 小时

  • d: 天

priority

Integer

参数解释:

缓存规则的优先级,数值越大,优先级越高

取值范围:

1-100

follow_origin

String

参数解释:

缓存过期时间来源,设置CDN节点的缓存遵循源站还是CDN侧的配置

取值范围:

  • on: CDN节点的缓存过期时间遵循源站的设置

  • off: CDN节点的缓存过期时间遵循“缓存规则”中的“缓存过期时间”

  • min_ttl: CDN节点的缓存过期时间取缓存规则和源站二者的最小值

force_cache

String

参数解释:

强制缓存:CDN节点缓存过期时间是否忽略源站响应头Cache-Control中的no-cache、private、no-store字段

取值范围:

  • on: 打开强制缓存

  • off: 关闭强制缓存

url_parameter_type

String

参数解释:

URL参数

取值范围:

  • del_params: 忽略指定URL参数

  • reserve_params: 保留指定URL参数

  • ignore_url_params: 忽略全部URL参数

  • full_url: 使用完整URL参数

url_parameter_value

String

参数解释:

URL参数值

取值范围:

不涉及

表14 IpFilter

参数

参数类型

描述

type

String

参数解释:

IP黑白名单类型

取值范围:

  • off: 关闭IP黑白名单

  • black: IP黑名单

  • white: IP白名单

value

String

参数解释:

配置IP黑白名单

说明:

支持IPv6,支持配置IP地址和IP&掩码格式的网段

取值范围:

不涉及

表15 RefererConfig

参数

参数类型

描述

type

String

参数解释:

Referer黑白名单类型

取值范围:

  • off: 关闭Referer黑白名单

  • black: Referer黑名单

  • white: Referer白名单

value

String

参数解释:

域名或IP地址

说明:

域名、IP地址可以混合输入,支持泛域名和带端口的域名

取值范围:

不涉及

include_empty

Boolean

参数解释:

是否包含空Referer

说明:

如果是黑名单并开启该选项,则表示无referer不允许访问

如果是白名单并开启该选项,则表示无referer允许访问

取值范围:

  • true: 包含空

  • false: 不包含空

表16 ForceRedirectConfig

参数

参数类型

描述

status

String

参数解释:

强制跳转开关

取值范围:

  • on: 开启

  • off: 关闭

type

String

参数解释:

强制跳转类型

取值范围:

  • http: 强制跳转HTTP

  • https: 强制跳转HTTPS

redirect_code

Integer

参数解释:

重定向跳转码

取值范围:

  • 301

  • 302

  • 307

表17 Compress

参数

参数类型

描述

status

String

参数解释:

智能压缩开关

取值范围:

  • on: 开启

  • off: 关闭

type

String

参数解释:

智能压缩类型

取值范围:

多种智能压缩类型用“,”分隔,可选值如下:

  • gzip: gzip压缩

  • br: brotli压缩

file_type

String

参数解释:

需要压缩的文件类型

取值范围:

  • 内容总长度不可超过2000个字符

  • 单个格式不可超过50个字符

  • 多种格式用“,”分隔

compress_min_length

Integer

参数解释:

压缩区间最小范围

取值范围:

  • 文件大小范围(0MB~30MB),单位为Byte

compress_max_length

Integer

参数解释:

压缩区间最大范围

取值范围:

  • 文件大小范围(0MB~30MB),单位为Byte

表18 CacheUrlParameterFilterGetBody

参数

参数类型

描述

type

String

缓存URL参数操作类型:

  • full_url:缓存所有参数;

  • ignore_url_params:忽略所有参数;

  • del_params:忽略指定URL参数;

  • reserve_params:保留指定URL参数。

    说明:

    本接口参数有调整,参数替换如下:

    • del_params替代del_args。

    • reserve_params替代reserve_args。

value

String

参数值。

表19 ErrorCodeCache

参数

参数类型

描述

code

Integer

参数解释:

需要缓存的错误码

取值范围:

  • 3xx: 301, 302

  • 4xx: 400, 403, 404, 405, 407, 414, 416, 451

  • 5xx: 500, 501, 502, 503, 504, 509, 514

ttl

Integer

参数解释:

错误码缓存时间

取值范围:

0-31536000,单位:秒

说明:

3XX状态码缓存时间范围为0-20s

表20 UserAgentFilter

参数

参数类型

描述

type

String

参数解释:

UA黑白名单类型

取值范围:

  • off: 关闭UA黑白名单

  • black: UA黑名单

  • white: UA白名单

value

String

参数解释:

UA黑白名单内容

说明:

此参数作为旧参数,将于近期下线,建议使用ua_list字段设置UA黑白名单内容

取值范围:

  • 单条规则不超过200个字符

  • 支持数字0-9、字符a-z、A-Z,空格,及特殊符"*"、"."、"-"、"_"、"("、")"、";"、","、"/"、"'"、"#"、"!"、"@"、"$"、"^"、"&"、"+"、"="、"~"、"?"、"""、"["、"]"、"{"、"}"、""、":"、"%"

include_empty

Boolean

参数解释:

是否包含空UA

说明:

如果黑名单并开启该选项,则表示无UA不允许访问

如果是白名单并开启该选项,则表示无UA允许访问

取值范围:

true: 包含空

false:不包含空

ua_list

Array of strings

参数解释:

配置UA黑白名单

表21 OriginRequestUrlRewrite

参数

参数类型

描述

priority

Integer

参数解释:

回源URL改写规则的优先级

说明:

数值越大优先级越高,CDN按照优先级高的规则执行URL改写

取值范围:

1-100

match_type

String

参数解释:

匹配类型

取值范围:

  • all: 所有文件

  • file_path: URI路径

  • wildcard: 通配符

  • full_path: 全路径

source_url

String

参数解释:

需要替换的URI

取值范围:

  • 1-512个字符

  • 支持通配符*匹配,如:/test/*/*.mp4

  • 以正斜线(/)开头的URI,不含http(s)://头及域名

target_url

String

参数解释:

替换后的URI

取值范围:

  • 1-256个字符

  • 以正斜线(/)开头的URI,不含http(s)://头及域名

说明:

通配符 * 可通过$n捕获(n=1,2,3...,例如:/newtest/$1/$2.jpg)

表22 flexibleOrigins

参数

参数类型

描述

match_type

String

参数解释:

URI的匹配方式

取值范围:

  • file_extension: 文件后缀匹配

  • file_path: 目录路径

match_pattern

String

参数解释:

URI的匹配规则

取值范围:

1-512个字符

priority

Integer

参数解释:

优先级

说明:

数值越大优先级越高

取值范围:

1-100

back_sources

Array of backSources objects

参数解释:

配置客户端请求匹配当前规则时,CDN节点回源访问的源站

取值范围:

不涉及

表23 backSources

参数

参数类型

描述

sources_type

String

参数解释:

源站类型

取值范围:

  • ipaddr: 源站IP

  • domain: 源站域名

  • obs_bucket: OBS桶域名

ip_or_domain

String

参数解释:

源站IP或者域名

取值范围:

不涉及

obs_bucket_type

String

参数解释:

OBS桶类型

取值范围:

  • private: 私有桶

  • public: 公有桶

http_port

Integer

参数解释:

HTTP端口

取值范围:

1-65535

https_port

Integer

参数解释:

HTTPS端口

取值范围:

1-65535

表24 commonRemoteAuth

参数

参数类型

描述

remote_authentication

String

参数解释:

是否开启远程鉴权

取值范围:

  • on: 开启

  • off: 关闭

remote_auth_rules

RemoteAuthRule object

参数解释:

远程鉴权配置

表25 RemoteAuthRule

参数

参数类型

描述

auth_server

String

参数解释:

可访问的鉴权服务器地址

取值范围:

不涉及

request_method

String

参数解释:

鉴权服务器支持的请求方法

取值范围:

  • GET

  • POST

  • HEAD

file_type_setting

String

参数解释:

参与鉴权的文件类型

取值范围:

  • all: 所有文件均参与鉴权

  • specific_file: 指定类型的文件参与鉴权。示例:jpg|MP4

说明:

文件类型不区分大小写,即:jpg和JPG代表同一种文件类型,多个文件类型用“|”分隔

specified_file_type

String

参数解释:

参与鉴权的具体文件类型

取值范围:

  • 1-512个字符

  • 由大小写字母和数字构成

reserve_args_setting

String

参数解释:

参与鉴权的参数

取值范围:

  • reserve_all_args: 保留所有URL参数

  • reserve_specific_args: 保留指定URL参数

  • ignore_all_args: 忽略所有URL参数

reserve_args

String

参数解释:

设置参数

取值范围:

不涉及

add_custom_args_rules

Array of customArgs objects

参数解释:

设置CDN节点转发用户请求到远程鉴权服务器时需添加的参数

取值范围:

不涉及

reserve_headers_setting

String

参数解释:

设置CDN节点转发用户请求到远程鉴权服务器时需要添加的请求头

取值范围:

  • reserve_all_headers: 保留所有请求头参数

  • reserve_specific_headers: 保留指定请求头参数

  • ignore_all_headers: 忽略所有请求头参数

add_custom_headers_rules

Array of customArgs objects

参数解释:

请求头鉴权参数

取值范围:

不涉及

auth_success_status

String

参数解释:

设置鉴权成功时远程鉴权服务器返回给CDN节点的状态码

取值范围:

  • 2xx

  • 3xx

auth_failed_status

String

参数解释:

设置鉴权失败时远程鉴权服务器返回给CDN节点的状态码

取值范围:

  • 4xx

  • 5xx

response_status

String

参数解释:

设置鉴权失败时CDN节点返回给用户的状态码

取值范围:

  • 2xx

  • 3xx

  • 4xx

  • 5xx

timeout

Integer

参数解释:

设置鉴权超时时间,即从CDN转发鉴权请求开始,到CDN节点收到远程鉴权服务器返回的结果的时间

取值范围:

0或50-3000,单位:毫秒

timeout_action

String

参数解释:

设置鉴权超时后,CDN节点如何处理用户请求

取值范围:

  • pass:鉴权超时后允许用户请求,返回对应的资源

  • forbid:鉴权超时后拒绝用户请求,返回配置的响应自定义状态码给用户

reserve_headers

String

参数解释:

要保留的请求头

取值范围:

不涉及

表26 customArgs

参数

参数类型

描述

type

String

参数解释:

参数类型

取值范围:

  • custom_var: 自定义

  • nginx_preset_var: 预置的变量

key

String

参数解释:

参数名

取值范围:

  • 1-256个字符

  • 由数字0-9、字符a-z、A-Z,及特殊字符._-*#%|+^@?=组成

value

String

参数解释:

参数值

取值范围:

  • 当type为custom_var时支持1-256个字符,由数字0-9、字符a-z、A-Z,及特殊字符._-*#%|+^@?=组成

  • 当type为nginx_preset_var时,value只能输入$http_host、$http_user_agent、$http_referer、$http_x_forwarded_for、$http_content_type、$remote_addr、$scheme、$server_protocol、$request_uri、$uri、$args、$request_method

表27 webSocketSeek

参数

参数类型

描述

status

String

参数解释:

是否开启websocket协议

取值范围:

  • on: 开启

  • off: 关闭

timeout

Integer

参数解释:

请求建立连接后,会话的保持时间

取值范围:

1-300,单位:秒,当status为on时必填

表28 videoSeek

参数

参数类型

描述

enable_video_seek

Boolean

参数解释:

视频拖拽开关

取值范围:

  • true: 开启

  • false: 关闭

enable_flv_by_time_seek

Boolean

参数解释:

flv时间拖拽开关

取值范围:

  • true: 开启

  • false: 关闭

start_parameter

String

参数解释:

自定义用户请求URL中视频播放的开始参数

取值范围:

  • 1-64个字符

  • 支持使用数字0-9、字符a-z、A-Z,及"_"

end_parameter

String

参数解释:

自定义用户请求URL中视频播放的结束参数

取值范围:

  • 1-64个字符

  • 支持使用数字0-9、字符a-z、A-Z,及"_"

表29 RequestLimitRules

参数

参数类型

描述

status

String

参数解释:

是否开启请求限速

说明:
  • 此为旧接口中的参数,后续将下线

  • 只支持on,off无效

取值范围:

on

priority

Integer

参数解释:

优先级

说明:

数值越大优先级越高

取值范围:

1-100

match_type

String

参数解释:

匹配类型

取值范围:

  • all:所有文件

  • catalog:目录

match_value

String

参数解释:

匹配类型值

取值范围:

不涉及

type

String

参数解释:

限速方式

取值范围:

不涉及

limit_rate_after

Long

参数解释:

限速条件

说明:

例如:type=size,limit_rate_after=50表示从传输50个字节后开始限速且限速值为limit_rate_value

取值范围:

0-1073741824,单位:byte

limit_rate_value

Integer

参数解释:

限速值,即达到限速条件后的最大访问速度

取值范围:

0-104857600,单位:Bps

limit_time

String

参数解释:

指明限速的时段

取值范围:

不涉及

表30 IpFrequencyLimitQuery

参数

参数类型

描述

status

String

状态,on:打开,off:关闭。

qps

Integer

访问阈值,单位:次/秒。

表31 HstsQuery

参数

参数类型

描述

status

String

状态,on:打开,off:关闭。

max_age

Integer

过期时间,即:响应头“Strict-Transport-Security”在客户端的缓存时间。单位:秒。

include_subdomains

String

包含子域名,on:包含,off:不包含。

表32 Quic

参数

参数类型

描述

status

String

参数解释:

QUIC功能状态开关

取值范围:

  • on: 开启

  • off: 关闭

表33 ErrorCodeRedirectRules

参数

参数类型

描述

error_code

Integer

参数解释:

重定向的错误码

取值范围:

  • 4xx: 400, 403, 404, 405, 414, 416, 451

  • 5xx: 500, 501, 502, 503, 504

execution_mode

String

参数解释:

执行规则

取值范围:

  • break:如果错误码匹配了当前配置,请求将被重定向到目标Path。执行完当前规则后,当存在其他配置规则时,将不再匹配剩余规则。

  • redirect:如果错误码匹配了当前配置,请求将被重定向到目标Path。执行完当前规则后,当存在其他配置规则时,将继续匹配剩余规则。

target_code

Integer

参数解释:

重定向状态码

取值范围:

  • 301

  • 302

target_link

String

参数解释:

重定向的目标链接

取值范围:

不涉及

表34 Sni

参数

参数类型

描述

status

String

参数解释:

是否开启回源SNI

取值范围:

  • on: 开启

  • off: 关闭

server_name

String

参数解释:

CDN节点回源时使用HTTPS协议握手的sni域名

取值范围:

  • 仅支持输入数字、“-”、“.”、英文大小写字符

表35 RequestUrlRewrite

参数

参数类型

描述

condition

UrlRewriteCondition object

参数解释:

匹配条件

取值范围:

不涉及

redirect_status_code

Integer

参数解释:

重定向状态码

取值范围:

  • 301

  • 302

  • 303

  • 307

redirect_url

String

参数解释:

重定向URL

取值范围:

不涉及

redirect_host

String

参数解释:

支持将客户端请求重定向到其他域名

取值范围:

  • 1-255个字符

  • 必须以http://或https://开头

execution_mode

String

参数解释:

执行规则

取值范围:

  • redirect: 如果请求的URL匹配了当前规则,该请求将被重定向到目标Path。执行完当前规则后,当存在其他配置规则时,会继续匹配剩余规则

  • break: 如果请求的URL匹配了当前规则,请求将被改写为目标Path。执行完当前规则后,当存在其他配置规则时,将不再匹配剩余规则,此时不支持配置重定向Host和重定向状态码,返回状态码200

表36 UrlRewriteCondition

参数

参数类型

描述

match_type

String

参数解释:

匹配类型

取值范围:

  • catalog: 指定目录下的文件需执行访问URL重写规则

  • full_path: 某个完整路径下的文件需执行访问URL重写规则

  • home_page: 访问域名首页时需执行访问URL重写规则

  • regex: 客户端请求URL中的字符匹配正则表达式时需要执行访问URL重写规则

match_value

String

参数解释:

匹配内容

取值范围:

不涉及

priority

Integer

参数解释:

访问URL重写规则的优先级

说明:

数值越大优先级越高

取值范围:

1-100

表37 BrowserCacheRules

参数

参数类型

描述

condition

BrowserCacheRulesCondition object

参数解释:

匹配条件

取值范围:

不涉及

cache_type

String

参数解释:

缓存生效类型

取值范围:

  • follow_origin: 遵循源站的缓存策略,即Cache-Control头部的设置

  • ttl: 浏览器缓存遵循当前规则设置的过期时间

  • never: 浏览器不缓存资源

ttl

Integer

参数解释:

缓存过期时间

取值范围:

不涉及

ttl_unit

String

参数解释:

缓存过期时间单位

取值范围:

  • s:秒

  • m:分钟

  • h:小时

  • d:天

表38 BrowserCacheRulesCondition

参数

参数类型

描述

match_type

String

参数解释:

匹配类型

取值范围:

  • all: 匹配所有文件

  • file_extension: 按文件后缀匹配

  • catalog: 按目录匹配

  • full_path: 全路径匹配

  • home_page: 按首页匹配

match_value

String

参数解释:

缓存匹配设置

取值范围:

不涉及

priority

Integer

参数解释:

浏览器缓存的优先级, 数值越大优先级越高

取值范围:

不涉及

表39 AccessAreaFilter

参数

参数类型

描述

type

String

参数解释:

规则类型

取值范围:

  • black: 黑名单,如果匹配到黑名单规则,则黑名单所选区域内的用户将无法访问当前资源,返回403状态码

  • white: 白名单,白名单所选区域以外的用户均无法访问当前资源,返回403状态码

content_type

String

参数解释:

生效类型

取值范围:

  • all: 所有文件,所有文件均遵循配置的规则

  • file_directory: 目录路径,指定目录路径的资源遵循配置的规则

  • file_path: 全路径,指定路径的资源遵循配置的规则

content_value

String

参数解释:

生效规则

取值范围:

不涉及

area

String

参数解释:

配置规则适用的区域

取值范围:

不涉及

exception_ip

String

参数解释:

例外IP,配置指定IP不执行当前规则

取值范围:

不涉及

表40 ClientCert

参数

参数类型

描述

status

String

参数解释:

客户端证书配置开关

取值范围:

  • on: 开启

  • off: 关闭

trusted_cert

String

参数解释:

客户端CA证书的内容

取值范围:

不涉及

hosts

String

参数解释:

客户端CA证书指定的域名

取值范围:

不涉及

表41 HttpsTlsVersion

参数

参数类型

描述

tls_version

String

参数解释:

传输层安全性协议,即TLS版本配置

取值范围:

目前支持TLSv1.0/1.1/1.2/1.3四个版本的协议

cipher_suite_group

String

参数解释:

加密算法套件组

取值范围:

  • default: 默认加密套件

  • general: 一般加密套件

  • strict: 强加密套件

  • custom: 自定义加密套件

cipher_suite

String

参数解释:

加密套件

取值范围:

  • ECDHE-ECDSA-AES128-GCM-SHA256

  • ECDHE-ECDSA-AES256-GCM-SHA384

  • ECDHE-RSA-AES128-GCM-SHA256

  • ECDHE-RSA-AES256-GCM-SHA384

  • DHE-RSA-AES128-GCM-SHA256

  • DHE-RSA-AES256-GCM-SHA384

  • ECDHE-ECDSA-AES128-SHA256

  • ECDHE-ECDSA-AES256-SHA384

  • ECDHE-RSA-AES128-SHA

  • ECDHE-RSA-AES128-SHA256

  • ECDHE-RSA-AES256-SHA

  • ECDHE-RSA-AES256-SHA384

  • DHE-RSA-AES128-SHA

  • DHE-RSA-AES128-SHA256

  • DHE-RSA-AES256-SHA

  • DHE-RSA-AES256-SHA256

  • AES128-GCM-SHA256

  • AES256-GCM-SHA384

  • AES128-SHA256

  • AES256-SHA256

  • ECDHE-ECDSA-CHACHA20-POLY1305

  • ECDHE-RSA-CHACHA20-POLY1305

  • DHE-RSA-CHACHA20-POLY1305

  • ECDHE-ECDSA-AES128-SHA

  • ECDHE-ECDSA-AES256-SHA

  • AES128-SHA

  • AES256-SHA

  • DES-CBC3-SHA

  • RC4-SHA

表42 FlowLimitStrategy

参数

参数类型

描述

strategy_type

String

参数解释:

用量统计类型

取值范围:

  • instant: 瞬时用量

  • hour: 累计用量(小时)

  • day: 累计用量(天)

item_type

String

参数解释:

用量封顶类型

取值范围:

  • bandwidth: 带宽封顶,单位: bit/s

  • traffic: 流量封顶,单位: bit

limit_value

String

参数解释:

用量封顶阈值,域名用量达到该阈值后,将会停用域名

取值范围:

必须为正整数

alarm_percent_threshold

String

参数解释:

用量告警阈值,域名用量达到该阈值后,将会发送告警

取值范围:

1-90

ban_time

String

参数解释:

域名封禁周期

取值范围:

  • 0: 不自动解封

  • 60: 60分钟,即1个小时

  • 720: 720分钟,即12个小时

  • 1440: 1440分钟,即24个小时

  • 4320: 4320分钟,即3天

请求示例

GET https://cdn.myhuaweicloud.com/v1.1/cdn/configuration/domains/www.example.com/configs

响应示例

状态码:200

成功响应。

{
  "configs" : {
    "origin_request_header" : [ ],
    "http_response_header" : [ ],
    "https" : {
      "https_status" : "off"
    },
    "url_auth" : {
      "status" : "off"
    },
    "compress" : {
      "status" : "off"
    },
    "force_redirect" : {
      "status" : "on",
      "type" : "http"
    },
    "origin_protocol" : "follow",
    "referer" : {
      "type" : "black",
      "value" : "192.168.0.0",
      "include_empty" : true
    },
    "ip_filter" : {
      "type" : "black",
      "value" : "192.168.0.0"
    },
    "origin_follow302_status" : "off",
    "cache_rules" : [ {
      "match_type" : "file_extension",
      "match_value" : ".zip",
      "ttl" : 0,
      "ttl_unit" : "h",
      "priority" : 1,
      "follow_origin" : "off",
      "url_parameter_type" : "del_params",
      "url_parameter_value" : "test_param"
    } ],
    "sources" : [ {
      "origin_addr" : "www.example.com",
      "origin_type" : "domain",
      "priority" : 70,
      "http_port" : 80,
      "https_port" : 443
    } ],
    "cache_url_parameter_filter" : {
      "type" : "del_params",
      "value" : "key1;key2"
    },
    "flexible_origin" : [ {
      "priority" : 1,
      "match_type" : "file_path",
      "match_pattern" : "/test",
      "back_sources" : [ {
        "sources_type" : "domain",
        "ip_or_domain" : "www.example.com",
        "obs_bucket_type" : "public"
      } ]
    } ],
    "slice_etag_status" : "off",
    "ipv6_accelerate" : 1,
    "origin_receive_timeout" : 30,
    "remote_auth" : {
      "remote_authentication" : "on",
      "remote_auth_rules" : {
        "auth_server" : "https://1.1.1.1",
        "request_method" : "GET",
        "file_type_setting" : "all",
        "reserve_args_setting" : "reserve_all_args",
        "reserve_args" : "reserve_all_args",
        "specified_file_type" : ".jpg",
        "reserve_headers_setting" : "reserve_specific_headers",
        "auth_success_status" : "200",
        "auth_failed_status" : "403",
        "response_status" : "403",
        "timeout" : 500,
        "timeout_action" : "pass",
        "reserve_headers" : "sf",
        "add_custom_args_rules" : [ {
          "type" : "nginx_preset_var",
          "key" : "http_host",
          "value" : "$http_host"
        } ],
        "add_custom_headers_rules" : [ {
          "type" : "nginx_preset_var",
          "key" : "http_host",
          "value" : "$http_host"
        } ]
      }
    },
    "websocket" : {
      "status" : "off",
      "timeout" : 60
    },
    "video_seek" : {
      "enable_video_seek" : true,
      "enable_flv_by_time_seek" : true,
      "start_parameter" : "start",
      "end_parameter" : "end"
    },
    "request_limit_rules" : [ {
      "status" : "on",
      "type" : "size",
      "limit_rate_after" : 1024,
      "limit_rate_value" : 50
    } ],
    "sni" : {
      "status" : "on",
      "server_name" : "test.example.com"
    },
    "request_url_rewrite" : [ {
      "condition" : {
        "match_type" : "full_path",
        "match_value" : "/test/*.jpg",
        "priority" : 10
      },
      "redirect_status_code" : 301,
      "redirect_url" : "/test/index.html",
      "execution_mode" : "redirect"
    } ],
    "error_code_redirect_rules" : [ {
      "error_code" : 400,
      "execution_mode" : "redirect",
      "target_code" : 301,
      "target_link" : "https://www.example.com/error.html"
    } ],
    "browser_cache_rules" : [ {
      "condition" : {
        "match_type" : "full_path",
        "match_value" : "/test/*.jpg",
        "priority" : 10
      },
      "cache_type" : "ttl",
      "ttl" : 20,
      "ttl_unit" : "h"
    } ],
    "access_area_filter" : [ {
      "type" : "black",
      "content_type" : "all",
      "area" : "CN_IN,AU",
      "exception_ip" : "0.0.0.0"
    } ],
    "client_cert" : {
      "status" : "on",
      "trusted_cert" : "certificate_example",
      "hosts" : "www.example.com"
    },
    "https_tls_version" : {
      "tls_version" : "TLSv1.2,TLSv1.3",
      "cipher_suite_group" : "strict"
    },
    "flow_limit_strategy" : [ {
      "strategy_type" : "instant",
      "item_type" : "bandwidth",
      "limit_value" : "10000000",
      "alarm_percent_threshold" : "80",
      "ban_time" : "1440"
    } ]
  }
}

SDK代码示例

SDK代码示例如下。

 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
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.GlobalCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.cdn.v2.region.CdnRegion;
import com.huaweicloud.sdk.cdn.v2.*;
import com.huaweicloud.sdk.cdn.v2.model.*;


public class ShowDomainFullConfigSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");

        ICredential auth = new GlobalCredentials()
                .withAk(ak)
                .withSk(sk);

        CdnClient client = CdnClient.newBuilder()
                .withCredential(auth)
                .withRegion(CdnRegion.valueOf("<YOUR REGION>"))
                .build();
        ShowDomainFullConfigRequest request = new ShowDomainFullConfigRequest();
        request.withDomainName("{domain_name}");
        try {
            ShowDomainFullConfigResponse response = client.showDomainFullConfig(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 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
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import GlobalCredentials
from huaweicloudsdkcdn.v2.region.cdn_region import CdnRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcdn.v2 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]

    credentials = GlobalCredentials(ak, sk)

    client = CdnClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(CdnRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ShowDomainFullConfigRequest()
        request.domain_name = "{domain_name}"
        response = client.show_domain_full_config(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/global"
    cdn "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdn/v2"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdn/v2/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cdn/v2/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")

    auth, err := global.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        SafeBuild()

    if err != nil {
        fmt.Println(err)
        return
    }

    hcClient, err := cdn.CdnClientBuilder().
         WithRegion(region.ValueOf("<YOUR REGION>")).
         WithCredential(auth).
         SafeBuild()


    if err != nil {
        fmt.Println(err)
        return
    }

    client := cdn.NewCdnClient(hcClient)

    request := &model.ShowDomainFullConfigRequest{}
	request.DomainName = "{domain_name}"
	response, err := client.ShowDomainFullConfig(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。

状态码

状态码

描述

200

成功响应。

错误码

请参见错误码

相关文档