google.cloud.forseti.common.data_access.violation_format module

Provides formatting functions for violations

format_groups_violation(violation)[source]

Format the groups violation data into a tuple.

Parameters:violation (namedtuple) – The groups violation. This is a named tuple (see rules.py in google.cloud.forseti.scanner.audit).
Yields:tuple – A tuple of the violation properties.
format_violation(violation)[source]

Format the policy violation data into a tuple.

Also flattens the RuleViolation, since it consists of the resource, rule, and members that don’t meet the rule criteria.

Various properties of RuleViolation may also have values that exceed the declared column length, so truncate as necessary to prevent MySQL errors.

Parameters:violation (namedtuple) – The Policy RuleViolation. This is a named tuple.
Yields:tuple – A tuple of the rule violation properties.