Closed Yogibaer75 closed 5 years ago
Thanks for the contribution. Just a few minor change requests from my side.
if "output_format" in query_params and query_params["output_format"] == "python":
body_dict = ast.literal_eval(body)
else:
body_dict = json.loads(body)
result = body_dict['result'] if body_dict['result_code'] == 0: return result
I made the recommended changes to my commit and I hope that it looks now good.
Looks great, thanks!
Result is now parsed according to "output_format" settings in query parameters. For some outputs it is necessary to set the format to "python". As an example "rulesets" need the setting for the output format.
Example query looks like this api.make_request('get_ruleset',query_params={"output_format":"python"}, data={"ruleset_name":"host_contactgroups"})