调用SetDcdnBlockIP对访问指定域名的IP进行封禁和解禁操作。
说明 该接口仅支持使用POST方式调用。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | SetDcdnBlockIP |
系统规定参数。取值:SetDcdnBlockIP。 |
DomainName | String | 是 | example.com |
域名列表,多个域名用英文逗号(,)分隔。 |
IPList | String | 是 | 1.1.1.1,2.2.2.190,4.4.4.2 |
待封禁或解禁的IP列表。多个IP用英文逗号(,)分隔,最多支持1000个IP。 |
OperationType | String | 是 | block |
操作动作。取值:
|
BlockInterval | Integer | 否 | 3000 |
封禁时长,单位:秒。当操作动作为unblock时,无需传入该参数。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
IPBlockInfo | Array of IPBlockInfoItem |
操作结果信息。 |
|
Code | Integer | 1 |
操作结果。取值:
Code=0的可能情况如下:
|
DomainName | String | example.com |
域名。 |
Message | String | success |
操作结果描述。取值:
|
RequestId | String | CB1A380B-09F0-41BB-802B-72F8FD6DA2FE |
请求ID。 |
示例
请求示例
http(s)://dcdn.aliyuncs.com/?Action=SetDcdnBlockIP
&DomainName=example.com
&IPList=1.1.1.1,2.2.2.190,4.4.4.2
&OperationType=block
&<公共请求参数>
正常返回示例
XML
格式
<SetDcdnBlockIPResponse>
<IPBlockInfo>
<Domain>example.com</Domain>
<Code>1</Code>
<Message>success</Message>
</IPBlockInfo>
<RequestId>CB1A380B-09F0-41BB-802B-72F8FD6DA2FE</RequestId>
</SetDcdnBlockIPResponse>
JSON
格式
{
"IPBlockInfo": [
{
"Domain": "example.com",
"Code": 1,
"Message": "success"
}
],
"RequestId": "CB1A380B-09F0-41BB-802B-72F8FD6DA2FE"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameter | The specified parameter is invalid. | 参数错误 |
400 | InvalidDomainName | The specified DomainName is invalid. | 参数DomainName不合法,请根据请求参数规定重新输入。 |
404 | InvalidDomain.NotFound | The domain does not exist, or it does not belong to you. | 域名不存在或不属于当前用户。请检查您填写的域名书写是否正确,或者域名是否在当前账号中,查看域名是否过期。 |
访问错误中心查看更多错误码。