Skip to main content

delete_rule

Function delete_rule 

Source
pub fn delete_rule(config_json: &str, rule_code: &str) -> Result<String>
Expand description

Delete a rule from the configuration

§Arguments

  • config_json - Configuration JSON string
  • rule_code - Rule code to delete

§Returns

Returns modified configuration JSON on success

§Example

use sz_configtool_lib::rules;

let config = r#"{"G2_CONFIG": {"CFG_ERRULE": [{"ERRULE_ID": 1, "ERRULE_CODE": "TEST"}]}}"#;
let modified = rules::delete_rule(config, "TEST").unwrap();