def METHOD_NAME(farm_id_pattern):
    """Retrieve Farm IDs with filtering by id pattern.
    :param farm_id_pattern: A pattern to farm ID.
    :type farm_id_pattern: basestring
    :returns: A list of farm ID.
    :rtype: list
    """
    url = settings.FARM_GEOSERVER_URL
    # Adding % in front and end of pattern
    if not farm_id_pattern.startswith('%'):
        farm_id_pattern = '%' + farm_id_pattern
    if not farm_id_pattern.endswith('%'):
        farm_id_pattern = farm_id_pattern + '%'
    parameters = {
        'SERVICE': 'WFS',
        'VERSION': '2.0.0',
        'REQUEST': 'GETFEATURE',
        'TYPENAME': settings.FARM_WORKSPACE + ':' + settings.FARM_LAYER_NAME,
        'PROPERTYNAME': settings.FARM_ID_COLUMN,
        'CQL_FILTER': "%s LIKE '%s'" % (
            settings.FARM_ID_COLUMN, farm_id_pattern),
        'COUNT': 10
    }
    query_dict = QueryDict('', mutable=True)
    query_dict.update(parameters)
    if '?' in url:
        url = url + '&' + query_dict.urlencode()
    else:
        url = url + '?' + query_dict.urlencode()
    request = requests.get(url)
    content = request.content
    return parse_farm_ids(content)