def firewall_rule_callback(request):
required_fields = [<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT:action>'<EOL>]<EOL>request_body = json.loads(request.body)<EOL>def check_fields(body):<EOL><INDENT>"""<STR_LIT>"""<EOL>for field in required_fields:<EOL><INDENT>if field not in request_body['<STR_LIT>']:<EOL><INDENT>raise Exception('<STR_LIT>'.format(field, request_body))<EOL><DEDENT><DEDENT><DEDENT>if isinstance(request_body, list):<EOL><INDENT>for body in request_body:<EOL><INDENT>check_fields(body)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>check_fields(request_body)<EOL><DEDENT>return(<NUM_LIT>, {}, json.dumps(request_body))<EOL>
Checks that firewall rule contains required fields.
Returns the same body with 201 Created.