Skip to content

rules

Rule management


create_rule

Creates (adds) a new custom rule given the rule definition.
Source code

POST

http://localhost:8888/api/rules/{fullRuleName}  

Parameters of this method are described below

 Property name   Description                       Data type   Required 
full_rule_name Full rule name string

Request body

 Description                       Data type   Required 
Rule model RuleModel

Usage examples

curl -X POST http://localhost:8888/api/rules/sample_target/sample_category/sample_rule^
    -H "Accept: application/json"^
    -H "Content-Type: application/json"^
    -d^
    "{\"rule_name\":\"sample_rule\",\"type\":\"python\",\"java_class_name\":\"com.dqops.execution.rules.runners.python.PythonRuleRunner\",\"mode\":\"current_value\",\"custom\":false,\"built_in\":false,\"can_edit\":true}"

delete_rule

Deletes a custom rule definition
Source code

DELETE

http://localhost:8888/api/rules/{fullRuleName}  

Parameters of this method are described below

 Property name   Description                       Data type   Required 
full_rule_name Full rule name string

Usage examples

curl -X DELETE http://localhost:8888/api/rules/sample_target/sample_category/sample_rule^
    -H "Accept: application/json"

get_all_rules

Returns a flat list of all rules available in DQOps, both built-in rules and user defined or customized rules.
Source code

GET

http://localhost:8888/api/rules  

Return value

 Property name   Description                       Data type 
rule_list_model List[RuleListModel]

Usage examples

curl http://localhost:8888/api/rules^
    -H "Accept: application/json"

get_rule

Returns a rule definition
Source code

GET

http://localhost:8888/api/rules/{fullRuleName}  

Return value

 Property name   Description                       Data type 
rule_model RuleModel

Parameters of this method are described below

 Property name   Description                       Data type   Required 
full_rule_name Full rule name string

Usage examples

curl http://localhost:8888/api/rules/sample_target/sample_category/sample_rule^
    -H "Accept: application/json"

get_rule_folder_tree

Returns a tree of all rules available in DQOps, both built-in rules and user defined or customized rules.
Source code

GET

http://localhost:8888/api/definitions/rules  

Return value

 Property name   Description                       Data type 
rule_folder_model RuleFolderModel

Usage examples

curl http://localhost:8888/api/definitions/rules^
    -H "Accept: application/json"

update_rule

Updates an existing rule, making a custom rule definition if it is not present
Source code

PUT

http://localhost:8888/api/rules/{fullRuleName}  

Parameters of this method are described below

 Property name   Description                       Data type   Required 
full_rule_name Full rule name string

Request body

 Description                       Data type   Required 
List of rule definitions RuleModel

Usage examples

curl -X PUT http://localhost:8888/api/rules/sample_target/sample_category/sample_rule^
    -H "Accept: application/json"^
    -H "Content-Type: application/json"^
    -d^
    "{\"rule_name\":\"sample_rule\",\"type\":\"python\",\"java_class_name\":\"com.dqops.execution.rules.runners.python.PythonRuleRunner\",\"mode\":\"current_value\",\"custom\":false,\"built_in\":false,\"can_edit\":true}"