Exemplo n.º 1
0
    def entries(self, since, until, overflow=False):
        """ Query schedule entries.  
            The maximum range queryable at once is three months. Error raised if this is violated.

            :type since: string
            :param since: date in ISO 8601 format, the time element is optional 
            (ie. '2011-05-06' is understood as at midnight ) 
        
            :type until: string
            :param until: date in ISO 8601 format, the time element is optional 
            (ie. '2011-05-06' is understood as at midnight )

            :type overflow: boolean
            :param overflow: if True on call schedules are returned the way they are entered
                             if False only the overlaps of the on call schedules 
                                with the time period between since and until are returned
        """
        params = {'since' : since, 'until' : until}
        if overflow:
            params.update({'overflow' : True})

        request = SchedulesRequest(self, 'entries', params)
        response = request.fetch()

        return response.content['entries']
Exemplo n.º 2
0
    def _make_request(self, since, until, limit, offset):
        params = {'since' : since, 'until' : until, 'limit' : limit, 'offset' : offset}

        request = IncidentsRequest(self, params)
        response = request.fetch()

        return response.content['total'], response.content['incidents']