def list_timeflows(self):
        """
        Retrieve and print all timeflows for a given engine
        """

        all_timeflows = timeflow.get_all(self.engine)

        print 'DB Name, Timeflow Name, Timestamp'
        for tfbm_lst in all_timeflows:

            try:
                db_name = get_obj_reference(self.engine, database,
                                            tfbm_lst.container)

                print '{}, {}, {}\n'.format(str(db_name),
                                            str(tfbm_lst.name),
                                            str(tfbm_lst.parent_point.timestamp))

            except AttributeError:
                print '{}, {}\n'.format(str(tfbm_lst.name), str(db_name))

            except TypeError as e:
                raise DlpxException('Listing Timeflows encountered an error'
                                    ':\n{}'.format((e)))

            except RequestError as e:
                dlpx_err = e.message
                raise DlpxException(dlpx_err.action)

            except (JobError, HttpError) as e:
                raise DlpxException(e)
Esempio n. 2
0
def list_timeflows(server):
    """
    Retrieve and print all timeflows for a given engine
    """

    ret_timeflow_dct = {}
    all_timeflows = timeflow.get_all(server)

    print("DB Name, Timeflow Name, Timestamp")

    for tfbm_lst in all_timeflows:
        try:

            db_name = get_obj_name(server, database, tfbm_lst.container)
            print("%s, %s, %s\n" % (
                str(db_name),
                str(tfbm_lst.name),
                str(tfbm_lst.parent_point.timestamp),
            ))

        except AttributeError:
            print("%s, %s\n" % (str(tfbm_lst.name), str(db_name)))

        except TypeError as e:
            raise DlpxException("Listing Timeflows encountered an error:\n%s" %
                                (e.message))

        except RequestError as e:
            dlpx_err = e.message
            raise DlpxException(dlpx_err.action)
    def list_timeflows(self):
        """
        Retrieve and print all timeflows for a given engine
        """

        all_timeflows = timeflow.get_all(self.engine)

        print("DB Name, Timeflow Name, Timestamp")
        for tfbm_lst in all_timeflows:

            try:
                db_name = get_obj_reference(self.engine, database,
                                            tfbm_lst.container)

                print("{}, {}, {}\n".format(
                    str(db_name),
                    str(tfbm_lst.name),
                    str(tfbm_lst.parent_point.timestamp),
                ))

            except AttributeError:
                print("{}, {}\n".format(str(tfbm_lst.name), str(db_name)))

            except TypeError as e:
                raise DlpxException("Listing Timeflows encountered an error"
                                    ":\n{}".format((e)))

            except RequestError as e:
                dlpx_err = e.message
                raise DlpxException(dlpx_err.action)

            except (JobError, HttpError) as e:
                raise DlpxException(e)
def list_timeflows(server):
    """
    Retrieve and print all timeflows for a given engine
    """

    ret_timeflow_dct = {}
    all_timeflows = timeflow.get_all(server)

    print 'DB Name, Timeflow Name, Timestamp'

    for tfbm_lst in all_timeflows:
        try:

            db_name = get_obj_name(server, database, tfbm_lst.container)
            print '%s, %s, %s\n' % (str(db_name), str(tfbm_lst.name),
                                    str(tfbm_lst.parent_point.timestamp))

        except AttributeError:
            print '%s, %s\n' % (str(tfbm_lst.name), str(db_name))

        except TypeError as e:
           raise DlpxException('Listing Timeflows encountered an error:\n%s' %
                               (e.message))

        except RequestError, e:
            dlpx_err = e.message
            raise DlpxException(dlpx_err.action)