logologo
售前咨询
点播云
产品简介
购买指南
快速入门
控制台指南
服务端API
调用方式
媒资上传
媒资管理
媒体处理
事件通知
点播CDN
数据统计
空间管理
回调配置
SDK文档
相关协议
文档中心
服务端API点播CDN修改加速域名配置

修改加速域名配置


1. 请求参数

名称

类型

是否必选

示例值

描述

Action

String

UpdateDomain

系统规定参数。取值:UpdateDomain。

DomainName

String

example.com

点播加速域名。

ConfigSets

ConfigSets


配置对象

ConfigSets

ConfigSets示例:

"ConfigSets": {
"Basic" {
"Scope":"",
"Ipv6":""
}
}
基础配置

Basic

Scope

String

domestic

加速区域,国际用户、国内L3及以上用户设置有效。 取值范围:

  • domestic:中国大陆。
  • overseas:港澳台及海外。
  • global:全球加速。

Ipv6

Boolean

true

是否开启Ipv6访问;

取值范围:

  • true:开启
  • false:关闭
缓存配置

Cache

SimpleCache

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配置

Https

SslProtocol

String

http

HTTPS协议,支持在HTTP、HTTPS、协议跟随间进行选择;默认使用HTTP回源协议。

可选值:

  • http:http
  • https:https

SslConfig

SslConfig


https证书配置,参考 SslConfig

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。取值范围:

  • true:开启
  • false:不开启

AuthType

String

Aauth

鉴权类型,在IsAuth=true的情况下选择。取值范围:

  • Aauth:阿里云A类鉴权

无默认值,不填会提示错误。

AuthKey

String

key1

鉴权主key,仅允许大小写字母与数字,长度 16~32 位

AuthKeyBak

String

key2

鉴权备key,仅允许大小写字母与数字,长度 16~32 位。备用key可以不设置或者设置为空。

ExpireTime

Long

10000

签名过期时间设置,单位:s

范围:[1,31536000)。无默认值,不填会提示错误。


2. 返回参数

公共返回参数


3. 示例

3.1 请求示例

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
}
}'


HTTPS配置

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
}
}'


3.2 返回示例

HTTP/1.1 200 OK
Content-Type:application/json

"ResponseMeta": {
"RequestId":"CixgpmAFOYcAAAAAAAAAAw",
"ErrorCode":"",
"ErrorMessage":""
}


4. 错误码

错误代码

错误信息

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

域名不存在或不属于当前用户。

上一篇:获取域名配置详情下一篇:查询离线日志
该篇文档内容是否对您有帮助?
有帮助没帮助