创建DNS授权规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:- 对于必选的资源类型,用前面加 * 表示。
- 对于不支持资源级授权的操作,用全部资源表示。
 
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
| 操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 | 
|---|---|---|---|---|
| iotcc:CreateDNSServiceRule | create | *CloudConnector acs:iotcc:{#regionId}:{#accountId}:cloudconnector/{#CloudConnectorId} | 
 | 无 | 
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| IoTCloudConnectorId | string | 是 | 云连接器实例 ID。 | iotcc-1y6h8z7imd2yu4**** | 
| ServiceType | string | 是 | DNS 授权规则的目标类型。取值: 
 | Normal | 
| Destination | string | 否 | 重定向后的 DNS 服务地址。 说明 
当 ServiceType 参数取值为 DNSRedirect 时,该参数必选。
 | 192.168.0.2 | 
| Source | string | 是 | 源 DNS IP 地址。取值: 100.100.2.136,100.100.2.137,100.100.2.138,114.114.114.114,8.8.8.8,8.8.4.4,223.5.5.5,223.6.6.6,221.5.88.88,116.116.116.116,221.228.15.26,61.139.2.69,218.6.200.139,119.29.29.29,218.2.2.2,208.67.220.220,208.67.222.222,218.4.4.4。 除以上默认的 DNS 授权规则的 IP,如有其他 DNS 授权规则的 IP 诉求,请提交工单,并在工单中附上需要申请的 DNS 授权规则的 IP。 | 100.100.2.138 | 
| DNSServiceRuleName | string | 否 | DNS 授权规则名称。 长度为 2~128 个英文或中文字符,开头必须为大小写英文字母或中文,可包含数字、半角句号(.)、下划线(_)和短划线(-)。 | test | 
| DNSServiceRuleDescription | string | 否 | DNS 授权规则描述。 长度为 2~256 个字符,开头必须为大小写英文字母或中文,但不能为 | description | 
| ClientToken | string | 否 | 客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明 
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。
 | 123e4567-e89b-12d3-a456-426655440000 | 
| DryRun | boolean | 否 | 是否只预检此次请求。取值: 
 | false | 
| RegionId | string | 是 | DNS 授权规则所在的地域 ID。 您可以通过调用 ListRegions 接口获取地域 ID。 | cn-hangzhou | 
返回参数
示例
正常返回示例
JSON格式
{
  "RequestId": "BC6D1C1D-6DBD-568C-B867-BC9CA699ED01",
  "DNSServiceRuleId": "ar-r56ijpurlu50gi****"
}错误码
| 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.CC5GInstanceNotSupport | The operation is not allowed because of CC5G instance not support. | CC5G托管实例不支持此操作。 | 
访问错误中心查看更多错误码。
变更历史
| 变更时间 | 变更内容概要 | 操作 | 
|---|
