docs: def do_alarm_definition_list(mc, args):
      '''List alarm definitions for this tenant.'''
      fields = {}
      if args.name:
          fields['name'] = args.name
      if args.dimensions:
          fields['dimensions'] = utils.format_dimensions_query(args.dimensions)
      if args.severity:
          if not _validate_severity(args.severity):
              return
          fields['severity'] = args.severity
      if args.sort_by:
          sort_by = args.sort_by.split(',')
          for field in sort_by:
              field_values = field.split()
              if len(field_values) > 2:
                  print("Invalid sort_by value {}".format(field))
              if field_values[0] not in allowed_definition_sort_by:
                  print("Sort-by field name {} is not in [{}]".format(field_values[0],
                                                                      allowed_definition_sort_by))
                  return
              if len(field_values) > 1 and field_values[1] not in ['asc', 'desc']:
                  print("Invalid value {}, must be asc or desc".format(field_values[1]))
          fields['sort_by'] = args.sort_by
      if args.limit:
          fields['limit'] = args.limit
      if args.offset:
          fields['offset'] = args.offset
      try:
          alarm = mc.alarm_definitions.list(**fields)
      except (osc_exc.ClientException, k_exc.HttpError) as he:
          raise osc_exc.CommandError('%s\n%s' % (he.message, he.details))
      else:
          if args.json:
              print(utils.json_formatter(alarm))
              return
          cols = ['name', 'id', 'expression', 'match_by', 'actions_enabled']
          formatters = {
              'name': lambda x: x['name'],
              'id': lambda x: x['id'],
              'expression': lambda x: x['expression'],
              'match_by': lambda x: utils.format_list(x['match_by']),
              'actions_enabled': lambda x: x['actions_enabled'],
          }
          if isinstance(alarm, list):
              # print the list
              utils.print_list(alarm, cols, formatters=formatters)
          else:
              # add the dictionary to a list, so print_list works
              alarm_list = list()
              alarm_list.append(alarm)
              utils.print_list(alarm_list, cols, formatters=formatters)