def list_rules(self, service=None):
rules = {}<EOL>for service in self.app.get_services():<EOL><INDENT>rules[service] = {}<EOL>for instance in self.app.get_service_instances(service):<EOL><INDENT>rules[service][instance] = {}<EOL>resp = requests.get("<STR_LIT>".format(instance))<EOL>if resp.status_code != <NUM_LIT:200>:<EOL><INDENT>print('<STR_LIT>' % (service, instance))<EOL>continue<EOL><DEDENT>rules[service][instance] = resp.json()<EOL>return rules<EOL><DEDENT><DEDENT>
List fault fault injection rules installed on instances of a given service (or all services)
returns a JSON dictionary