'Apply all relevant compatibility xforms.'

def get_alarm_props(self, props):

    kwargs = self.actions_to_urls(props)
    kwargs['type'] = self.alarm_type
    if (kwargs.get(self.METER_NAME) in alarm_base.NOVA_METERS):
        prefix = 'user_metadata.'
    else:
        prefix = 'metering.'
    rule = {}
    for field in ['period', 'evaluation_periods', 'threshold', 'statistic', 'comparison_operator', 'meter_name']:
        if (field in kwargs):
            rule[field] = kwargs[field]
            del kwargs[field]
    mmd = (props.get(self.MATCHING_METADATA) or {})
    query = (props.get(self.QUERY) or [])
    for (m_k, m_v) in six.iteritems(mmd):
        key = ('metadata.%s' % prefix)
        if m_k.startswith('metadata.'):
            m_k = m_k[len('metadata.'):]
        if (m_k.startswith('metering.') or m_k.startswith('user_metadata.')):
            m_k = m_k.split('.', 1)[(-1)]
        key = ('%s%s' % (key, m_k))
        query.append(dict(field=key, op='eq', value=six.text_type(m_v)))
    if (self.MATCHING_METADATA in kwargs):
        del kwargs[self.MATCHING_METADATA]
    if (self.QUERY in kwargs):
        del kwargs[self.QUERY]
    if query:
        rule['query'] = query
    kwargs['threshold_rule'] = rule
    return kwargs
