调用CreateIpMappingRule接口创建授权规则IP的重定向功能。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 |
|---|---|---|---|---|
| IoTCloudConnectorId | string | 是 | 云连接器实例ID。 | iotcc-bp1odcab8tmno0hdq**** |
| DestinationIp | string | 是 | 重定向的目标IP地址。 | 192.168.10.8 |
| MappingIp | string | 是 | 需要进行重定向的IP地址。 | 47.0.XX.XX |
| IpMappingRuleName | string | 否 | 需要进行IP重定向的授权规则名称。 名称长度为2~128个字符,以大小写字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。 | name |
| IpMappingRuleDescription | string | 否 | 需要进行IP重定向的授权规则描述。 长度为2~256个字符,必须以字母或中文开头,但不能以 | description |
| ClientToken | string | 否 | 客户端Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符。 说明若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId可能不一样。 | 123e4567-e89b-12d3-a456-426655440000 |
| DryRun | boolean | 否 | 是否只预检此次请求。取值:
| false |
| RegionId | string | 是 | 实例所在的地域ID。 您可以通过调用ListRegions接口获取地域ID。 | cn-hangzhou |
返回参数
示例
正常返回示例
JSON格式
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
"IpMappingRuleId": "im-irrp3bzuu5nrbx****"
}错误码
| HTTP status code | 错误码 | 错误信息 | 描述 |
|---|---|---|---|
| 400 | Forbidden.RAM | Ram user does not have permission to perform this operation. | RAM用户无权限执行此操作。 |
| 400 | OperationDenied.DomainFeatureDisabled | The operation is not allowed because of domain feature disabled. | - |
| 400 | IllegalParam.Destination | The param of Destination is illegal. | Destination无效 |
| 400 | ResourceAlreadyExist.AuthorizationRule | The specified resource of AuthorizationRule already exists. | 规则已经存在 |
| 400 | Conflict.Param | The param is conflict. | - |
| 400 | Conflict.Cidr | The cidr is conflict. | - |
| 400 | ResourceNotFound.IoTCloudConnector | The param of IoTCloudConnectorId is illegal. | IoTCloudConnectorId参数非法 |
| 400 | QuotaExceeded.sourceCidrLimit | The quota of SourceCidrsPerAuthorizationRule is exceeded | SourceCidrsPerAuthorizationRule quota超出 |
| 400 | IllegalParam | The param is illegal. | 参数非法 |
| 400 | QuotaExceeded.authorizationRuleInstanceLimit | The quota of AuthorizationRulePerIotCC is exceeded | - |
| 400 | IllegalParamFormat | The param is illegal. | - |
| 400 | ResourceInConfiguring.IoTCloudConnector | The specified resource of IoTCloudConnector is configuring, please try again later. | iotcc状态非稳态,或者锁冲突 |
| 400 | OperationDenied.DomainInHumanNetwork | The operation is not allowed because of domain or CIDR in human network. | 配置的域名或者网段在人联网里面,不被允许。 |
| 400 | OperationDenied.CIDRMaskTooLarge | The operation is not allowed because of CIDR too large. | CIDR掩码太大了。 |
访问错误中心查看更多错误码。
调试