海外ACDN 分发配置(新版本)¶
POST 创建分发 acdn:distributions:edit¶
POST /prod-api/acdn/distributions/createDistribution
我们已经简化了创建分配的配置流程,您可以查看旧版创建分配页面。
Body 请求参数
{
"oid": "20241234569719224284",
"httpPort": "80",
"httpsPort": "443",
"distributionConfig": {
"callerReference": 1773730151743,
"aliases": {
"items": [],
"quantity": 0
},
"comment": "",
"defaultCacheBehavior": {
"allowedMethods": {
"items": ["GET", "HEAD"],
"quantity": 2
},
"cachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
"compress": true,
"originRequestPolicyId": "216adef6-5c7f-47e4-b989-5492eafa07d3",
"smoothStreaming": false,
"targetOriginId": "demo.com",
"viewerProtocolPolicy": "allow-all"
},
"defaultRootObject": "",
"enabled": true,
"httpVersion": "http2",
"isIPV6Enabled": true,
"origins": {
"items": [
{
"connectionAttempts": "3",
"connectionTimeout": "10",
"customHeaders": {
"quantity": 1,
"items": [
{
"headerName": "1",
"headerValue": "2"
}
]
},
"customOriginConfig": {
"originKeepaliveTimeout": "5",
"originProtocolPolicy": "http-only",
"originReadTimeout": "30",
"originSslProtocols": {
"items": ["TLSv1.2"],
"quantity": 1
}
},
"domainName": "demo.com",
"id": "demo.com",
"originPath": "/path",
"originShield": {
"enabled": false
}
}
],
"quantity": 1
},
"priceClass": "PriceClass_All"
}
}
请求参数¶
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| Authorization | header | string | 是 | -- | |
| body | body | CreateDistributionReqVO | 是 | CreateDistributionReqVO | -- |
返回示例
200 Response
返回结果¶
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 201 | Created | Created | -- |
| 401 | Unauthorized | Unauthorized | -- |
| 403 | Forbidden | Forbidden | -- |
| 404 | Not Found | Not Found | -- |
返回数据结构¶
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | -- | -- | |
| » msg | string | true | -- | -- |
数据模型¶
AllowedMethods
AllowedMethods
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| cachedMethods | CachedMethods | false | -- | -- | |
| items | [string] | false | -- | 项目列表 | 默认"GET", "HEAD" |
| quantity | integer(int32) | false | -- | 数量 | 默认2 |
CachedMethods
CachedMethods
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| items | [string] | false | -- | -- | |
| quantity | integer(int32) | false | -- | -- |
Aliases
Aliases
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| items | [string] | false | -- | 项目列表 | -- |
| quantity | integer(int32) | false | -- | 数量 | -- |
CreateDistributionReqVO
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| distributionConfig | DistributionConfig | false | -- | -- | |
| httpPort | integer(int32) | false | -- | HTTP 端口 | 默认值为80 |
| httpsPort | integer(int32) | false | -- | HTTPS 端口 | 默认值为443 |
| oid | string | true | -- | 套餐 | -- |
DefaultCacheBehavior
{
"allowedMethods": {
"cachedMethods": {
"items": ["string"],
"quantity": 0
},
"items": ["string"],
"quantity": 0
},
"cachePolicyId": "string",
"compress": true,
"originRequestPolicyId": "string",
"smoothStreaming": true,
"targetOriginId": "string",
"viewerProtocolPolicy": "string"
}
DefaultCacheBehavior
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| allowedMethods | AllowedMethods | false | -- | 允许HTTP方法 | -- |
| cachePolicyId | string | false | -- | 缓存策略ID | 默认"658327ea-f89d-4fab-a63d-7e88639e58f6" |
| compress | boolean | false | -- | 启用压缩 | -- |
| originRequestPolicyId | string | false | -- | 源请求策略ID | 默认"216adef6-5c7f-47e4-b989-5492eafa07d3" |
| smoothStreaming | boolean | false | -- | smoothStreaming | -- |
| targetOriginId | string | false | -- | 源域 | -- |
| viewerProtocolPolicy | string | false | -- | 协议策略 | 默认"allow-all" |
DistributionConfig
{
"callerReference": 1773730151743,
"aliases": {
"items": [],
"quantity": 0
},
"comment": "",
"defaultCacheBehavior": {
"allowedMethods": {
"items": ["GET", "HEAD"],
"quantity": 2
},
"cachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
"compress": true,
"originRequestPolicyId": "216adef6-5c7f-47e4-b989-5492eafa07d3",
"smoothStreaming": false,
"targetOriginId": "demo.com",
"viewerProtocolPolicy": "allow-all"
},
"defaultRootObject": "",
"enabled": true,
"httpVersion": "http2",
"isIPV6Enabled": true,
"origins": {
"items": [
{
"connectionAttempts": "3",
"connectionTimeout": "10",
"customHeaders": {
"quantity": 1,
"items": [
{
"headerName": "1",
"headerValue": "2"
}
]
},
"customOriginConfig": {
"originKeepaliveTimeout": "5",
"originProtocolPolicy": "http-only",
"originReadTimeout": "30",
"originSslProtocols": {
"items": ["TLSv1.2"],
"quantity": 1
}
},
"domainName": "demo.com",
"id": "demo.com",
"originPath": "/fff",
"originShield": {
"enabled": false
}
}
],
"quantity": 1
},
"priceClass": "PriceClass_All"
}
DistributionConfig
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| aliases | Aliases | true | -- | 备用域名(CNAME | -- |
| cacheBehaviors | CacheBehaviors | false | -- | -- | |
| callerReference | string | true | -- | 唯一标识符 | 值必须唯一(如使用时间戳、UUID 等) |
| comment | string | false | -- | 空字符串 | 分配的描述信息,建议填写用途 |
| defaultCacheBehavior | DefaultCacheBehavior | false | -- | -- | |
| defaultRootObject | string | false | -- | 默认根对象 | 默认"" |
| enabled | boolean | false | -- | 已启用 | -- |
| httpVersion | string | false | -- | 协议 | 默认"http2" |
| isIPV6Enabled | boolean | false | -- | IPv6 | 默认true |
| origins | Origins | false | -- | 源 | -- |
| priceClass | string | true | -- | 价格等级 | 默认"PriceClass_All" |
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| connectionAttempts | string | true | -- | 连接次数 | CloudFront 尝试连接到源的次数 1 到 3 次。默认值为 3 次。 |
| connectionTimeout | string | true | -- | 连接超时 | CloudFront 等待源响应的秒数 1 到 10 秒。默认值为 10秒。 |
| customHeaders | object | true | -- | 自定义标头 | -- |
| » item | [string] | true | -- | 项目列表 | -- |
| » quantity | integer | true | -- | 数量 | -- |
| customOriginConfig | object | true | -- | -- | |
| » originKeepaliveTimeout | string | true | -- | 保持连接超时 | CloudFront 与源保持空闲连接的秒数 1 到 60 秒。默认值为 5 秒。 |
| » originProtocolPolicy | string | true | -- | 协议 | http-only:表示仅 HTTP https-only:表示仅 HTTPS match-viewer:表示匹配查看器 |
| » originReadTimeout | string | true | -- | 响应超时 | CloudFront 与源保持空闲连接的秒数 1 到 60 秒。默认值为 30 秒 |
| » originSslProtocols | object | true | -- | SSL协议 | -- |
| »» items | [string] | true | -- | 项目列表 | TLSv1.2:表示TLSv1.2 TLSv1.1:表示TLSv1.1 TLSv1:表示TLSv1 SSLV3:表示SSLV3 |
| »» quantity | integer | true | -- | 数量 | 默认1 |
| domainName | string | true | -- | 源域 | -- |
| id | string | true | -- | 源域 | -- |
| originPath | string | false | -- | 源路径 | -- |
| originShield | object | true | -- | 源站防护 | -- |
| » enabled | boolean | true | -- | 启用源护盾 | -- |
| » originShieldRegion | string | true | -- | 源护盾区域 | -- |
Origins
{
"items": [
{
"connectionAttempts": "string",
"connectionTimeout": "string",
"customHeaders": {
"item": ["string"],
"quantity": 0
},
"customOriginConfig": {
"originKeepaliveTimeout": "string",
"originProtocolPolicy": "string",
"originReadTimeout": "string",
"originSslProtocols": {
"items": [null],
"quantity": 0
}
},
"domainName": "string",
"id": "string",
"originPath": "string",
"originShield": {
"enabled": true,
"originShieldRegion": "string"
}
}
],
"quantity": 0
}
Origins
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| items | [Origin] | false | -- | -- | |
| quantity | integer(int32) | false | -- | 数量 | 默认1 |
QueryStringCacheKeys
QueryStringCacheKeys
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| items | [string] | false | -- | -- | |
| quantity | integer(int32) | false | -- | -- |
TrustedKeyGroups
TrustedKeyGroups
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| enabled | boolean | false | -- | -- | |
| items | [string] | false | -- | -- | |
| quantity | integer(int32) | false | -- | -- |
TrustedSigners
TrustedSigners
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| enabled | boolean | false | -- | -- | |
| items | [string] | false | -- | -- | |
| quantity | integer(int32) | false | -- | -- |