@classmethod
    def format_filters(cls, filters):
        filter_strs = []
        for machine_filter in filters:
            filter_properties = []
            filter_properties.append(
                machine_filter.get('filter_type', 'allow')
            )
            if 'ports' in machine_filter:
                filter_properties.append(
                    'ports ' + ','.join(machine_filter['ports'])
                )
            if 'port_prefix' in machine_filter:
                filter_properties.append(
                    'port_prefix ' + machine_filter['port_prefix']
                )
            if 'port_suffix' in machine_filter:
                filter_properties.append(
                    'port_suffix ' + machine_filter['port_suffix']
                )
            if 'port_start' in machine_filter:
                filter_properties.append(
                    'port_start ' + str(machine_filter['port_start'])
                )
            if 'port_end' in machine_filter:
                filter_properties.append(
                    'port_end ' + str(machine_filter['port_end'])
                )
            filter_strs.append(' '.join(filter_properties))
        return ';'.join(filter_strs)
format json formatted filters to string.
dataset/ETHPy150Open openstack/compass-core/compass/db/models.py/Switch.format_filters