pub fn get_rule(config_json: &str, code_or_id: &str) -> Result<Value>Expand description
Get a rule by code or ID
§Arguments
config_json- Configuration JSON stringcode_or_id- Rule code or ID to search for
§Returns
Returns the rule JSON object on success
§Example
use sz_configtool_lib::rules;
let config = r#"{"G2_CONFIG": {"CFG_ERRULE": [{"ERRULE_ID": 1, "ERRULE_CODE": "TEST"}]}}"#;
let rule = rules::get_rule(config, "TEST").unwrap();