Read data from a series given its ID or key.  Start and end times
        must be supplied.  They can either be ISO8601 encoded strings (i.e.
        2012-01-08T00:21:54.000+0000) or Python Datetime objects, which will
        be converted for you.

        The rollup parameter is optional and can include string values such
        as "sum" and "avg".  Below is a list of valid rollup functions:

            * count
            * sum
            * mult
            * min
            * max
            * stddev
            * ss
            * range
            * percentile,N (where N is what percentile to calculate)

        This will apply a rollup function to your raw dataset.  The
        optional period parameter will downsample your data according to the
        given resolution ("1min", "2day", etc).

        The optional interpolation parameters can be used to resample your
        data to a regular interval interpolation_period according to an
        interpolation function interpolationf. Valid values for
        interpolation_period are the same as for the period parameter, and
        valid values for interpolationf include "zoh" and "linear".

        Finally, the optional tz parameter can be used to specify a time zone
        for your output.  Please see
        `here <https://tempo-db.com/docs/api/timezone/>`_ for a list of a
        valid timezone values.

        :param string key: the series key to use
        :param start: the start time for the data points
        :type start: string or Datetime
        :param end: the end time for the data points
        :type end: string or Datetime
        :param string rollup: (optional) the name of a rollup function to use
        :param string period: (optional) downsampling rate for the data
        :param string interpolationf: (optional) an interpolation function
                                      to run over the series
        :param string interpolation_period: (optional) the period to
                                            interpolate data into
        :param string tz: (optional) the timezone to place the data into
        :rtype: :class:`tempodb.protocol.cursor.DataPointCursor` with an
                iterator over :class:`tempodb.protocol.objects.DataPoint`
                objects

def read_data(self, key, start=None, end=None, rollup=None,
                  period=None, interpolationf=None, interpolation_period=None,
                  tz=None, limit=1000):
        """Read data from a series given its ID or key.  Start and end times
        must be supplied.  They can either be ISO8601 encoded strings (i.e.
        2012-01-08T00:21:54.000+0000) or Python Datetime objects, which will
        be converted for you.

        The rollup parameter is optional and can include string values such
        as "sum" and "avg".  Below is a list of valid rollup functions:

            * count
            * sum
            * mult
            * min
            * max
            * stddev
            * ss
            * range
            * percentile,N (where N is what percentile to calculate)

        This will apply a rollup function to your raw dataset.  The
        optional period parameter will downsample your data according to the
        given resolution ("1min", "2day", etc).

        The optional interpolation parameters can be used to resample your
        data to a regular interval interpolation_period according to an
        interpolation function interpolationf. Valid values for
        interpolation_period are the same as for the period parameter, and
        valid values for interpolationf include "zoh" and "linear".

        Finally, the optional tz parameter can be used to specify a time zone
        for your output.  Please see
        `here <https://tempo-db.com/docs/api/timezone/>`_ for a list of a
        valid timezone values.

        :param string key: the series key to use
        :param start: the start time for the data points
        :type start: string or Datetime
        :param end: the end time for the data points
        :type end: string or Datetime
        :param string rollup: (optional) the name of a rollup function to use
        :param string period: (optional) downsampling rate for the data
        :param string interpolationf: (optional) an interpolation function
                                      to run over the series
        :param string interpolation_period: (optional) the period to
                                            interpolate data into
        :param string tz: (optional) the timezone to place the data into
        :rtype: :class:`tempodb.protocol.cursor.DataPointCursor` with an
                iterator over :class:`tempodb.protocol.objects.DataPoint`
                objects"""

        url = make_series_url(key)
        url = urlparse.urljoin(url + '/', 'segment')

        vstart = check_time_param(start)
        vend = check_time_param(end)
        params = {
            'start': vstart,
            'end': vend,
            'rollup.fold': rollup,
            'rollup.period': period,
            'interpolation.function': interpolationf,
            'interpolation.period': interpolation_period,
            'tz': tz,
            'limit': limit
        }
        url_args = endpoint.make_url_args(params)
        url = '?'.join([url, url_args])
        resp = self.session.get(url)
        return resp