域名基本信息 接口¶
POST 批量创建域名¶
POST /prod-api/cdn/domain/batchCreateDomain
创建域名
Body 请求参数
{
"domainNames": ["demotest.com"],
"port": "0",
"oid": "202405232795134123456",
"customerRemark": "",
"resouceHost": "",
"upstream": "2",
"webSocket": "1",
"locationList": [
{
"locationValue": "/",
"locationType": "1",
"cacheTime": "0",
"cacheParameter": 0,
"cacheTimeUnit": "s"
},
{
"locationValue": "js;css;eot;svg;ttf;woff;otf",
"locationType": "2",
"cacheTime": "0",
"cacheParameter": 0,
"cacheTimeUnit": "s"
},
{
"locationValue": "png;jpg;jpeg;gif;ico;bmp",
"locationType": "2",
"cacheTime": "0",
"cacheParameter": 0,
"cacheTimeUnit": "s"
}
],
"filterParameters": 0,
"rangeSource": 0,
"origin": {
"httpOriginPort": "80",
"httpsOriginPort": "443",
"originGroupId": 1338,
"originRecord": "",
"originType": "originGroup",
"originProtocol": 0
},
"webFenceConfig": {
"wafId": "",
"httpDdosId": ""
}
}
请求参数¶
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| Authorization | header | string | 是 | - | |
| body | body | object | 是 | - | |
| » customerRemark | body | string | 否 | 备注 | - |
| » domainNames | body | [string] | 是 | 域名 | - |
| » filterParameters | body | integer(int32) | 否 | 开启过滤参数 | - |
| » locationList | body | [SaveDomainLocationVo] | 否 | 缓存过期设置 | - |
| »» SaveDomainLocationVo | body | SaveDomainLocationVo | 否 | SaveDomainLocationVo | - |
| »»» cacheParameter | body | integer(int32) | 否 | 过滤参数 | - |
| »»» cacheTime | body | integer(int32) | 否 | 缓存时间 | - |
| »»» cacheTimeUnit | body | string | 否 | 缓存单位 | - |
| »»» locationType | body | integer(int32) | 否 | 类型 | - |
| »»» locationValue | body | string | 是 | 内容 | - |
| » oid | body | string | 是 | 所属套餐 | - |
| » origin | body | DomainOriginVO | 否 | DomainOriginVO | - |
| »» httpOriginPort | body | integer(int32) | 是 | HTTP | 默认80 |
| »» httpsOriginPort | body | integer(int32) | 是 | HTTPS | 默认443 |
| »» originGroupId | body | integer(int64) | 否 | 源站组 | originType为originGroup时显示 |
| »» originProtocol | body | integer(int32) | 是 | 源协议 | 0:表示HTTP; |
| »» originRecord | body | string | 否 | ip | originType为ipDomain时显示 |
| »» originType | body | string | 是 | 源站配置 | ipDomain:表示IP;originGroup:表示源站组 |
| » port | body | integer(int32) | 否 | 端口 | - |
| » rangeSource | body | integer(int32) | 否 | 开启分片回源 | - |
| » resouceHost | body | string | 否 | 回源Host | 当回源域名为默认HOST的时候,resouceHost为空 |
| » upstream | body | integer(int32) | 否 | 负载均衡 | 0:表示轮询; |
| » webFenceConfig | body | webFenceConfig | 否 | WebSocket协议配置 | - |
| »» httpDdosId | body | integer(int64) | 否 | HTTP DDoS | - |
| »» wafId | body | integer(int64) | 否 | Web应用防火墙3.0 | - |
| » webSocket | body | integer(int32) | 否 | WebSocket协议配置 | - |
详细说明¶
»» originProtocol: 0:表示HTTP; 1:表示协议跟随; 2:表示HTTPS
»» originType: ipDomain:表示IP; originGroup:表示源站组
» upstream: 0:表示轮询; 2:表示会话保持
返回示例
200 Response
201 Response
返回结果¶
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | - | Inline |
| 201 | Created | - | Inline |
| 401 | Unauthorized | - | Inline |
| 403 | Forbidden | - | Inline |
| 404 | Not Found | - | Inline |
返回数据结构¶
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » msg | string | true | - | - | |
| » code | integer | true | - | - |
数据模型¶
DomainOriginVO
{
"httpOriginPort": 0,
"httpsOriginPort": 0,
"originGroupId": 0,
"originProtocol": 0,
"originRecord": "string",
"originType": "string"
}
DomainOriginVO
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| httpOriginPort | integer(int32) | true | - | HTTP | 默认80 |
| httpsOriginPort | integer(int32) | true | - | HTTPS | 默认443 |
| originGroupId | integer(int64) | false | - | 源站组 | originType为originGroup时显 |
| originProtocol | integer(int32) | true | - | 源协议 | 0:表示HTTP; 1:表示协议跟随; 2:表示HTTPS |
| originRecord | string | false | - | ip | originType为ipDomain时显示 |
| originType | string | true | - | 源站配置 | ipDomain:表示IP; originGroup:表示源站组 |
SaveDomainLocationVo
{
"cacheParameter": 0,
"cacheTime": 0,
"cacheTimeUnit": "string",
"locationType": 0,
"locationValue": "string"
}
SaveDomainLocationVo
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| cacheParameter | integer(int32) | false | - | 过滤参数 | - |
| cacheTime | integer(int32) | false | - | 缓存时间 | - |
| cacheTimeUnit | string | false | - | 缓存单位 | - |
| locationType | integer(int32) | false | - | 类型 | - |
| locationValue | string | true | - | 内容 | - |
SaveDomainWafInfoVo
{
"customerRemark": "string",
"domainNames": ["string"],
"filterParameters": 0,
"locationList": [
{
"cacheParameter": 0,
"cacheTime": 0,
"cacheTimeUnit": "string",
"locationType": 0,
"locationValue": "string"
}
],
"oid": "string",
"origin": {
"httpOriginPort": 0,
"httpsOriginPort": 0,
"originGroupId": 0,
"originProtocol": 0,
"originRecord": "string",
"originType": "string"
},
"port": 0,
"rangeSource": 0,
"resouceHost": "string",
"upstream": 0,
"webFenceConfig": {
"httpDdosId": 0,
"wafId": 0
},
"webSocket": 0
}
SaveDomainWafInfoVo
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| customerRemark | string | false | - | 备注 | - |
| domainNames | [string] | true | - | 域名 | - |
| filterParameters | integer(int32) | false | - | 开启过滤参数 | - |
| locationList | [SaveDomainLocationVo] | false | - | 缓存过期设置 | - |
| oid | string | true | - | 所属套餐 | - |
| origin | DomainOriginVO | false | - | - | |
| port | integer(int32) | false | - | 端口 | - |
| rangeSource | integer(int32) | false | - | 开启分片回源 | - |
| resouceHost | string | false | - | 回源Host | 当回源域名为默认HOST的时候,resouceHost为空 |
| upstream | integer(int32) | false | - | 负载均衡 | 0:表示轮询; 2:表示会话保持 |
| webFenceConfig | webFenceConfig | false | - | WebSocket协议配置 | - |
| webSocket | integer(int32) | false | - | WebSocket协议配置 | - |
webFenceConfig
webFenceConfig
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| httpDdosId | integer(int64) | false | - | HTTP DDoS | - |
| wafId | integer(int64) | false | - | Web应用防火墙3.0 | - |