最近更新时间:2026-06-16 20:57:27
该接口用于针对UID内的全部桶开启阻止公网访问,使用该接口需要是主账号或拥有ks3:PutPublicNetworkBlock权限。
有关阻止公网访问更多详情请参见文档:点击查看。
PUT /?PublicNetworkBlock HTTP/1.1
Host: {endpoint}
Date: {date}
Authorization: {SignatureValue}
Content-Type: application/xml
PublicNetworkBlock configuration in the request body该接口不使用请求参数。
该请求仅使用公共请求头。
一段描述阻止公网访问规则的XML:
<PublicNetworkBlockConfiguration>
<BlockType>All</BlockType>
</PublicNetworkBlockConfiguration>请求体内相关元素的具体描述如下:
名称 | 描述 | 是否必选 |
|---|---|---|
PublicNetworkBlockConfiguration | 存放阻止公网访问配置信息的容器。
| 是 |
BlockType | 是否开启阻止公共访问。
该参数设置为ALL表示阻止所有的公网来源访问,注意KS3控制台默认使用公网访问,开启阻止公网访问后通过控制台将访问失败,包括通过控制台关闭阻止公网访问操作。 | 是 |
该接口只返回常用响应头部。
该接口不返回响应体。
PUT /?PublicNetworkBlock HTTP/1.1
Host: {endpoint}
Date: {date}
Authorization: {SignatureValue}
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<PublicNetworkBlockConfiguration>
<BlockType>All</BlockType>
</PublicNetworkBlockConfiguration>HTTP/1.1 200 OK
Content-Length: 0
Connection: keep-alive
Date: Tue, 19 Jul 2017 09:14:23 GMT
Server: KS3
x-kss-request-id: 54a47bda18ac4e6e91de369add54218***HTTP 状态码 | 错误码 | 描述 |
400 Bad Request | InvalidRequest | 请求不合法。 |
403 Forbidden | AccessDenied | 缺少权限。 |
400 Bad Request | InvalidArgument | 参数为空、参数无效、参数值填写的不合法。 |
纯净模式
