跳转至

域名基本信息 接口

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

{ "msg": "保存成功", "code": 200 }

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

{
  "httpDdosId": 0,
  "wafId": 0
}

webFenceConfig

属性

名称 类型 必选 约束 中文名 说明
httpDdosId integer(int64) false - HTTP DDoS -
wafId integer(int64) false - Web应用防火墙3.0 -