tencent cloud

Feedback

ModifyRule

Last updated: 2024-06-21 15:11:35

1. API Description

Domain name for API request: wedata.tencentcloudapi.com.

Update Quality Rule Interface

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ModifyRule.
Version Yes String Common Params. The value used for this API: 2021-08-20.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ProjectId No String Project ID
RuleId No Integer Rule ID
RuleGroupId No Integer Rule Group ID
Name No String Rule name
TableId No String Data Table ID
RuleTemplateId No Integer Rule Template ID
Type No Integer Rule type 1.System Template, 2.Custom Definition Template, 3.Custom Definition SQL
QualityDim No Integer Quality Dimension of Rule (1: Accuracy, 2: Uniqueness, 3: Integrity, 4: Consistency, 5: Timeliness, 6: Validity)
SourceObjectDataTypeName No String Source Field Detailed Type, int, string
SourceObjectValue No String Source Field Name
ConditionType No Integer Detection Range 1.Whole Table 2.Conditional Scan
ConditionExpression No String Conditional Scan WHERE Condition Expression
CustomSql No String Custom Definition SQL
CompareRule No CompareRule Alert Trigger Condition
AlarmLevel No Integer Alert Trigger Level 1.Low, 2.Medium, 3.High
Description No String Rule Description
TargetDatabaseId No String Target Database Id
TargetTableId No String Target Table Id
TargetConditionExpr No String Target Filter Condition Expression
RelConditionExpr No String Source Field and Target Field Association Condition ON Expression
FieldConfig No RuleFieldConfig Custom Definition Template SQL Expression Field Replacement Parameter
TargetObjectValue No String Target Field Name CITY
SourceEngineTypes.N No Array of Integer Execution engine adapted to the rule

3. Output Parameters

Parameter Name Type Description
Data Boolean Whether Update Successful
Note: This field may return null, indicating that no valid value can be obtained.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Update Quality Rule Interface

Update Quality Rule Interface

Input Example

POST / HTTP/1.1
Host: wedata.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyRule
<Common request parameters>

{
    "ProjectId": "1234",
    "RuleId": 1,
    "RuleGroupId": 1,
    "Name": "Rule 1",
    "TableId": "867ujhn8i3240eif",
    "RuleTemplateId": 1,
    "Type": 1,
    "QualityDim": 1,
    "SourceObjectDataTypeName": "int",
    "SourceObjectValue": "name",
    "ConditionType": 1,
    "ConditionExpression": ">0",
    "CustomSql": "abc",
    "CompareRule": {
        "Items": [
            {
                "CompareType": 1,
                "Operator": "<",
                "ValueComputeType": 1,
                "ValueList": [
                    {
                        "ValueType": 1,
                        "Value": "10"
                    }
                ]
            }
        ],
        "CycleStep": 1
    },
    "AlarmLevel": 1,
    "Description": "Rule 1",
    "TargetDatabaseId": "97yghbj9ik",
    "TargetTableId": "56yujhr57ftuvgjb 78u",
    "TargetConditionExpr": "ct='${yyyy-mm-dd-1}'",
    "RelConditionExpr": "sourceTable.id=targetTable.id",
    "FieldConfig": {
        "WhereConfig": [
            {
                "FieldKey": "param_1",
                "FieldValue": "10",
                "FieldDataType": "id"
            }
        ],
        "TableConfig": [
            {
                "DatabaseId": "78ughibj8t6ygihb",
                "DatabaseName": "dbName",
                "TableId": "8iuyhbf2we9fu",
                "TableName": "test",
                "TableKey": "table_1",
                "FieldConfig": [
                    {
                        "FieldKey": "table_1.column_1",
                        "FieldValue": "id",
                        "FieldDataType": "int"
                    }
                ]
            }
        ]
    },
    "TargetObjectValue": "Table",
    "SourceEngineTypes": [
        1
    ]
}

Output Example

{
    "Response": {
        "Data": true,
        "RequestId": "0ff4e8ae-ebea-4a41-8aa2-1f6bc4b68e69"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation Operation Failure.
InvalidParameter.RuleNotExist Rule does not exist.