调用CreateQualityRule创建质量监控规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateQualityRule |
要执行的操作。 |
BlockType | Integer | 是 | 0 |
规则的强弱:0表示弱规则,1表示强规则。 |
Checker | Integer | 是 | 9 |
校验器的ID。 |
EntityId | Long | 是 | 15224 |
分区表达式的ID。 |
MethodName | String | 是 | count/table_count |
采样方。如果是自定义SQL,该参数的值为user_define。 |
PredictType | Integer | 是 | 0 |
是否为动态阈值:0表示非动态阈值、1表示动态阈值规则。 |
ProjectName | String | 是 | autotest |
引擎或者数据源的名称。 |
RegionId | String | 是 | cn-shanghai |
地域ID。 |
RuleName | String | 是 | 1234 |
规则的名称。 |
RuleType | Integer | 是 | 0 |
规则的类型:0表示系统定义、1表示用户自定义、2表示项目级规则。 |
Comment | String | 否 | 验证 |
规则的描述信息。 |
ExpectValue | String | 否 | 0 |
期望值。 |
Trend | String | 否 | abs |
趋势。 |
Operator | String | 否 | > |
比较符。 |
Property | String | 否 | table_id |
规则的字段。如果是表级别校验,行数为table_count、大小为table_size字段。 |
PropertyType | String | 否 | bigint |
字段的类型,表级table,字段级填写bigint等。 |
WhereCondition | String | 否 | table_id>1 |
过滤条件或自定义SQL。 |
CriticalThreshold | String | 否 | 20 |
橙色阈值。 |
WarningThreshold | String | 否 | 10 |
红色阈值。 |
TemplateId | Integer | 否 | 7 |
模板的ID。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | String | 12345 |
新建的规则ID。 |
ErrorCode | String | 401 |
错误码。 |
ErrorMessage | String | You have no permission. |
错误信息。 |
HttpStatusCode | Integer | 200 |
HTTP返回码。 |
RequestId | String | ecb967ec-c137-48**** |
请求ID。 |
Success | Boolean | true |
调用是否成功。 |
示例
请求示例
http(s)://[Endpoint]/?Action=CreateQualityRule
&BlockType=0
&Checker=9
&EntityId=15224
&MethodName=count/table_count
&PredictType=0
&ProjectName=autotest
&RegionId=cn-shanghai
&RuleName=1234
&RuleType=0
&<公共请求参数>
正常返回示例
XML
格式
<RequestId>ecb967ec-c137-48****</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>1234</Data>
<ErrorCode>401</ErrorCode>
<ErrorMessage>You have no permission.</ErrorMessage>
<Success>true</Success>
JSON
格式
{
"RequestId": "ecb967ec-c137-48****",
"HttpStatusCode": 200,
"Data": 1234,
"ErrorCode": 401,
"ErrorMessage": "You have no permission.",
"Success": true
}
错误码
访问错误中心查看更多错误码。
在文档使用中是否遇到以下问题
更多建议
匿名提交