名称 | 类型 | 是否必选 | 示例值 | 描述 |
Action | String | 是 | UpdateDomain | 系统规定参数。取值:UpdateDomain。 |
DomainName | String | 是 | example.com | 点播加速域名。 |
ConfigSets | ConfigSets | 是 | 配置对象 |
ConfigSets示例:
"ConfigSets": {
"Basic" {
"Scope":"",
"Ipv6":""
}
}
Basic
Scope | String | 否 | domestic | 加速区域,国际用户、国内L3及以上用户设置有效。 取值范围:
|
Ipv6 | Boolean | 否 | true | 是否开启Ipv6访问; 取值范围:
|
Cache
SimpleCache | 否 | 基础缓存过期时间配置 |
SimpleCache
名称 | 类型 | 是否必需 | 描述 |
CacheRules | List of CacheRule | 否 | 缓存规则列表 |
FollowOrigin | String | 必需 | 遵循源站 Cache-Control: max-age 配置 on:开启 off:关闭 开启后,未能匹配 CacheRules 规则的资源将根据源站返回的 max-age 值进行节点缓存;匹配了 CacheRules 规则的资源将按照 CacheRules 中设置的缓存过期时间在节点进行缓存 与 CompareMaxAge 冲突,不能同时开启 |
IgnoreCacheControl | String | 必需 | 强制缓存 on:开启 off:关闭 默认为关闭状态,开启后,源站返回的 no-store、no-cache 资源,也将按照 CacheRules 规则进行缓存 |
IgnoreSetCookie | String | 必需 | 忽略源站的Set-Cookie头部 on:开启 off:关闭 默认为关闭状态 |
CompareMaxAge | String | 必需 | 高级缓存过期配置,开启时会对比源站返回的 max-age 值与 CacheRules 中设置的缓存过期时间,取最小值在节点进行缓存 on:开启 off:关闭 默认为关闭状态 |
CacheRule
名称 | 类型 | 是否必需 | 描述 |
CacheType | String | 必需 | 规则类型: file:指定文件后缀生效 path:指定绝对路径生效 |
CacheContents | String [] | 必需 | CacheType 对应类型下的匹配内容:file 时填充后缀名,如 jpg、txt path 时填充绝对路径,如 /xxx/test.html, 必须以正斜线(/)开头 |
CacheTime | Integer | 必需 | 缓存过期时间设置 单位为秒,最大可设置为 365 天 |
Https
SslProtocol | String | 否 | http | HTTPS协议,支持在HTTP、HTTPS、协议跟随间进行选择;默认使用HTTP回源协议。 可选值:
|
SslConfig | 否 | https证书配置,参考 SslConfig |
名称 | 类型 | 是否必需 | 描述 |
CertName | String | 否 | 证书名称。仅支持填写英文 |
CertContent | String | 否 | 内容。填写pem编码的证书内容。注意证书内容需和域名匹配,即域名需在证书的授权域名范围内 |
PrivateKey | String | 否 | 私钥。填写pem编码的私钥内容 |
Origin
Sources | Array of Sources | 否 | [{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80}] | 回源地址列表。参考 Source |
OriginHost | String | 否 | img.test.com | 全局自定义回源host |
OriginProtocol | String | 否 | https | 回源协议全局配置,默认为http |
Auth
IsAuth | Boolean | 否 | false | 是否开启URL鉴权,默认true。取值范围:
|
AuthType | String | 否 | Aauth | 鉴权类型,在IsAuth=true的情况下选择。取值范围:
无默认值,不填会提示错误。 |
AuthKey | String | 否 | key1 | 鉴权主key,仅允许大小写字母与数字,长度 16~32 位 |
AuthKeyBak | String | 否 | key2 | 鉴权备key,仅允许大小写字母与数字,长度 16~32 位。备用key可以不设置或者设置为空。 |
ExpireTime | Long | 否 | 10000 | 签名过期时间设置,单位:s 范围:[1,31536000)。无默认值,不填会提示错误。 |
公共返回参数
Basic配置
PRT环境
curl --location --request POST 'gw-streamlake-prt.test.gifshow.com/?Action=UpdateDomain' \
--header 'trace-context: {"laneId":"PRT.streamlake"}' \
--header 'AccessKey: f691352526fe4db7a0f628d30c977ff5' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'DomainName=28test.lxn.kuaishou.streamlake.cn' \
--data-urlencode 'ConfigSets={
"Basic": {
"Ipv6": false
}
}'
PRT环境
curl --location --request POST 'gw-streamlake-prt.test.gifshow.com/?Action=UpdateDomain' \
--header 'trace-context: {"laneId":"PRT.streamlake"}' \
--header 'AccessKey: f723067388e04e399a28c92d848374ec' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'DomainName=test.com' \
--data-urlencode 'ConfigSets={
"Https":{
"SslProtocol":"https",
"SslConfig":"{\"CertName\":\"test_ssl\",\"CertContent\":\"-----BEGIN CERTIFICATE-----
<your certificate here>
-----END CERTIFICATE-----\",\"PrivateKey\":\"-----BEGIN RSA PRIVATE KEY-----
<your private key here>
-----END RSA PRIVATE KEY-----\"}"
}
}'
PRT环境
curl --location --request POST 'gw-streamlake-prt.test.gifshow.com/?Action=UpdateDomain' \
--header 'trace-context: {"laneId":"PRT.streamlake"}' \
--header 'AccessKey: f691352526fe4db7a0f628d30c977ff5' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: apdid=c1a6db4f-f759-46c0-b081-495f9260bf33c582032657844331085140078c141305:1662542499:1' \
--data-urlencode 'DomainName=qatest-auth.streamlake.cn' \
--data-urlencode 'ConfigSets={
"Auth": {
"IsAuth": true,
"AuthType": "Aauth",
"AuthKey": "f618508ff7863d7c5b884a5631a16cb2",
"ExpireTime": 309000
}
}'
HTTP/1.1 200 OK
Content-Type:application/json
"ResponseMeta": {
"RequestId":"CixgpmAFOYcAAAAAAAAAAw",
"ErrorCode":"",
"ErrorMessage":""
}
错误代码 | 错误信息 | HTTP 状态码 | 说明 |
InvalidArgument.InvalidDomainName | Specified DomainName is malformed. | 400 | DomainName参数错误。 |
InvalidArgument.InvalidSourceAddress | Specified source content is malformed. | 400 | 回源地址参数错误。 |
InvalidArgument.InvalidSourceType | Specified source type is malformed. | 400 | 源站类型参数错误。 |
InvalidArgument.Mismatch | Specified source type does not math the specified source content. | 400 | 回源地址与回源类型不匹配。 |
InvalidArgument.InvalidPriority. | Specified source priority is malformed. | 400 | 优先级参数错误。 |
InvalidArgument.InvalidScope | Specified Scope is malformed. | 400 | Scope参数错误。 |
NotFound.InvalidDomain | The domain provided does not belong to you. | 404 | 域名不存在或不属于当前用户。 |