# 获取上行域名配置 (/products/mikustream/mikustream-live-domain-api/3-mikustream-live-get-upstream-domain-config-api)



最近更新时间: 2025-11-20 22:47:42

# 描述 [#描述]

修改指定直播空间中某个上行域名的配置

# 接口信息 [#接口信息]

* **请求方法**: `PATCH`
* **请求地址**: `<bucket>`.mls.cn-east-1.qiniumiku.com
* **请求路径**: `/`

# 请求参数 [#请求参数]

## Query 参数 [#query-参数]

| 参数名称             |   类型   |  必填 | 示例值                                       | 描述   |
| :--------------- | :----: | :-: | :---------------------------------------- | :--- |
| pushDomainConfig | string |  是  | [www.example.com](http://www.example.com) | 域名配置 |
| name             | string |  是  | [www.example.com](http://www.example.com) | 域名   |

## Header 参数 [#header-参数]

| 参数名称          |   类型   |  必填 | 示例值                                          | 描述                                                                                          |
| :------------ | :----: | :-: | :------------------------------------------- | :------------------------------------------------------------------------------------------ |
| Host          | string |  是  | `&lt;bucket&gt;`.mls.cn-east-1.qiniumiku.com | 请求的服务域名                                                                                     |
| Authorization | string |  是  | `&lt;QiniuToken&gt;`                         | 管理凭证 QiniuToken，[生成规则](/products/mikustream/3-mikustream-live-http-requests-authentication) |

## Body 参数 (application/json) [#body-参数-applicationjson]

示例：

```json
{
    "type":"pushRtmp",
    "auth":{
        "enable":true,
        "type":"test",
        "primaryKey":"QXV0aG9yaXphdGlvbg",
        "secondaryKey":"QXV0aG9yaXphdGlvbg",
        "expireSeconds":120
    },
    "certificateID":"",
    "httpsEnable": false
}
```

## 参数 [#参数]

| 参数名称          |     类型    | 是否必需 | 说明                                                                                                                                                                                                                                                                                                                                            |
| :------------ | :-------: | :--: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| enable        |  boolean  |  可选  | 域名是否启用                                                                                                                                                                                                                                                                                                                                        |
| type          |   string  |  可选  | 域名类型（pushRtmp：rtmp 推流域名；whip：whip 推流域名；pushSrt：srt 推流域名）                                                                                                                                                                                                                                                                                      |
| auth          |   object  |  可选  | 防盗链配置，[详见 auth 对象](#auth-object)                                                                                                                                                                                                                                                                                                              |
| certificateID |   string  |  可选  | HTTPS 证书 ID，只支持 whip 协议域名                                                                                                                                                                                                                                                                                                                     |
| cname         |   string  |  可选  | CNAME 域名别名                                                                                                                                                                                                                                                                                                                                    |
| connectId     |   string  |  可选  | 请求连接的唯一标识符                                                                                                                                                                                                                                                                                                                                    |
| creationDate  |   string  |  可选  | 域名创建时间，遵循 ISO 8601格式                                                                                                                                                                                                                                                                                                                          |
| domain        |   string  |  可选  | 域名地址                                                                                                                                                                                                                                                                                                                                          |
| lastModified  |   string  |  可选  | 最后修改时间，遵循 ISO 8601格式                                                                                                                                                                                                                                                                                                                          |
| ipLimit       |   object  |  可选  | IP 黑白名单配置（IpLimit），[详见 ipLimit 对象](#ip-limit-object)                                                                                                                                                                                                                                                                                          |
| urlRewrites   | \[]object |  可选  | URL重写规则（正则表达式）,[详见 urlRewrites 对象](#url-rewrites-object) ，如果有多条匹配规则，则顺序执行 <br />示例：[http://example.com/live/abc.flv?key=aaa，](http://example.com/live/abc.flv?key=aaa，) 想要改写挂载点为 qiniu\<br>匹配规则: `(.+)/live/(.+)$`<br />改写规则: `${1}/qiniu/${2}`<br />结果: [http://example.com/qiniu/abc.flv?key=aaa](http://example.com/qiniu/abc.flv?key=aaa) |
| httpsEnable   |  boolean  |  可选  | 是否启用 HTTPS，只支持 whip 协议域名                                                                                                                                                                                                                                                                                                                      |

# 请求示例 [#请求示例]

```http
PATCH /?pushDomainConfig&name=test-bucket.qnsdk.com HTTP/1.1
Host: test.mls.cn-east-1.qiniumiku.com
Authorization: <QiniuToken>
Content-Type: application/json

{
    "type":"pushRtmp",
    "auth":{
        "enable":true,
        "type":"test",
        "primaryKey":"QXV0aG9yaXphdGlvbg",
        "secondaryKey":"QXV0aG9yaXphdGlvbg",
        "expireSeconds":120
    },
    "certificateID":"",
    "httpsEnable": false
}
```

# 返回响应 [#返回响应]

## 响应状态码 [#响应状态码]

* **请查阅**: [这里](/products/mikustream/4-mikustream-live-error-code)

## 响应示例 [#响应示例]

```json
{
  "enable": true,
  "bucketId": "test",
  "region": "cn-east-1",
  "domain": "test-bucket.qnsdk.com",
  "cname": "test-bucket.qnsdk.com.publish.mikudns.com",
  "type": "pushRtmp",
  "auth": {
    "type": "test",
    "enable": true,
    "primaryKey": "QXV0aG9yaXphdGlvbg",
    "secondaryKey": "QXV0aG9yaXphdGlvbg",
    "expireSeconds": 120
  },
  "certificateID": "",
  "creationDate": "2019-01-01T00:00:00.000+08:00",
  "lastModified": "2019-01-02T00:00:00.000+08:00",
  "httpsEnable": false,
  "ipLimit": {
    "whitelist": null,
    "blacklist": null
  }
}
```

## 响应参数 [#响应参数]

| 参数名称          |    类型   | 说明                                                       |
| :------------ | :-----: | :------------------------------------------------------- |
| enable        | boolean | 域名是否启用                                                   |
| bucketId      |  string | bucket ID                                                |
| region        |  string | bucket 所在区域，暂时只支持 `cn-east-1`                            |
| domain        |  string | 域名地址                                                     |
| cname         |  string | CNAME 域名别名                                               |
| type          |  string | 域名类型（pushRtmp：rtmp 推流域名；whip：whip 推流域名；pushSrt：srt 推流域名） |
| auth          |  object | 防盗链配置，[详见 auth 对象](#auth-object)                         |
| certificateID |  string | HTTPS 证书 ID，只支持 whip 协议域名                                |
| creationDate  |  string | 域名创建时间，遵循 ISO 8601 格式                                    |
| lastModified  |  string | 最后修改时间，遵循 ISO 8601 格式                                    |
| ipLimit       |  object | IP 黑白名单配置（IpLimit），[详见 ipLimit 对象](#ip-limit-object)     |
| httpsEnable   | boolean | 是否启用 HTTPS 协议，只支持 whip 协议域名                              |

<a id="url-rewrites-object" />

## urlRewrites 对象 [#urlrewrites-对象]

| 参数名称    |   类型   | 说明                           |
| :------ | :----: | :--------------------------- |
| pattern | string | 匹配规则，用户的原始URL格式, 正则表示，变量放括号内 |
| replace | string | 替换规则，需要改写的规则                 |

<a id="auth-object" />

## auth 对象 [#auth-对象]

| 参数名称          |    类型   | 说明             |
| :------------ | :-----: | :------------- |
| type          |  string | 防盗链类型          |
| enable        | boolean | 是否启用防盗链功能      |
| primaryKey    |  string | 防盗链主密钥         |
| secondaryKey  |  string | 防盗链从密钥（备用）     |
| expireSeconds | integer | 防盗链链接的有效期，单位为秒 |

<a id="ip-limit-object" />

## ipLimit 对象 [#iplimit-对象]

| 参数名称      |     类型    | 说明  |
| :-------- | :-------: | :-- |
| whitelist | \[]string | 白名单 |
| blacklist | \[]string | 黑名单 |
