Example #1
0
    def get_qps(self, start_ts, end_ts=None, breakdown=None, hosts=None,
                rrecs=None):
        """Generates a report with information about Queries Per Second (QPS)
        for this zone

        :param start_ts: datetime.datetime instance identifying point in time
            for the QPS report
        :param end_ts: datetime.datetime instance indicating the end of the
            data range for the report. Defaults to datetime.datetime.now()
        :param breakdown: By default, most data is aggregated together.
            Valid values ('hosts', 'rrecs', 'zones').
        :param hosts: List of hosts to include in the report.
        :param rrecs: List of record types to include in report.
        :return: A :class:`str` with CSV data
        """
        end_ts = end_ts or datetime.now()
        api_args = {'start_ts': unix_date(start_ts),
                    'end_ts': unix_date(end_ts),
                    'zones': [self.name]}
        if breakdown is not None:
            api_args['breakdown'] = breakdown
        if hosts is not None:
            api_args['hosts'] = hosts
        if rrecs is not None:
            api_args['rrecs'] = rrecs
        response = DynectSession.get_session().execute('/QPSReport/',
                                                       'POST', api_args)
        return response['data']
Example #2
0
    def get_qps(self,
                start_ts,
                end_ts=None,
                breakdown=None,
                hosts=None,
                rrecs=None):
        """Generates a report with information about Queries Per Second (QPS)
        for this zone

        :param start_ts: datetime.datetime instance identifying point in time
            for the QPS report
        :param end_ts: datetime.datetime instance indicating the end of the
            data range for the report. Defaults to datetime.datetime.now()
        :param breakdown: By default, most data is aggregated together.
            Valid values ('hosts', 'rrecs', 'zones').
        :param hosts: List of hosts to include in the report.
        :param rrecs: List of record types to include in report.
        :return: A :class:`str` with CSV data
        """
        end_ts = end_ts or datetime.now()
        api_args = {
            'start_ts': unix_date(start_ts),
            'end_ts': unix_date(end_ts),
            'zones': [self.name]
        }
        if breakdown is not None:
            api_args['breakdown'] = breakdown
        if hosts is not None:
            api_args['hosts'] = hosts
        if rrecs is not None:
            api_args['rrecs'] = rrecs
        response = DynectSession.get_session().execute('/QPSReport/', 'POST',
                                                       api_args)
        return response['data']
Example #3
0
    def get_log_report(self, start_ts, end_ts=None):
        """Generates a report with information about changes to an existing
        RTTM service

        :param start_ts: datetime.datetime instance identifying point in time
            for the start of the log report
        :param end_ts: datetime.datetime instance identifying point in time
            for the end of the log report. Defaults to datetime.datetime.now()
        :return: dictionary containing log report data
        """
        end_ts = end_ts or datetime.now()
        api_args = {'zone': self._zone,
                    'fqdn': self._fqdn,
                    'start_ts': unix_date(start_ts),
                    'end_ts': unix_date(end_ts)}
        response = DynectSession.get_session().execute('/RTTMLogReport/',
                                                       'POST', api_args)
        return response['data']
Example #4
0
    def timeline_report(self, start_ts=None, end_ts=None):
        """Generates a report of events this :class:`DNSSEC` service has
        performed and has scheduled to perform

        :param start_ts: datetime.datetime instance identifying point in time
            for the start of the timeline report
        :param end_ts: datetime.datetime instance identifying point in time
            for the end of the timeline report. Defaults to
            datetime.datetime.now()
        """
        api_args = {'zone': self._zone}
        if start_ts is not None:
            api_args['start_ts'] = unix_date(start_ts)
        if end_ts is not None:
            api_args['end_ts'] = unix_date(end_ts)
        elif end_ts is None and start_ts is not None:
            api_args['end_ts'] = unix_date(datetime.now())
        uri = '/DNSSECTimelineReport/'
        response = DynectSession.get_session().execute(uri, 'POST', api_args)
        return response['data']
Example #5
0
    def timeline_report(self, start_ts=None, end_ts=None):
        """Generates a report of events this :class:`DNSSEC` service has
        performed and has scheduled to perform

        :param start_ts: datetime.datetime instance identifying point in time
            for the start of the timeline report
        :param end_ts: datetime.datetime instance identifying point in time
            for the end of the timeline report. Defaults to
            datetime.datetime.now()
        """
        api_args = {'zone': self._zone}
        if start_ts is not None:
            api_args['start_ts'] = unix_date(start_ts)
        if end_ts is not None:
            api_args['end_ts'] = unix_date(end_ts)
        elif end_ts is None and start_ts is not None:
            api_args['end_ts'] = unix_date(datetime.now())
        uri = '/DNSSECTimelineReport/'
        response = DynectSession.get_session().execute(uri, 'POST', api_args)
        return response['data']