Example #1
0
    def get_snapshot(self, params):
        """To download diagnostic snapshot:
                fuel snapshot

            To download diagnostic snapshot to specific directory:
                fuel snapshot --dir path/to/directory

            To specify config for snapshoting
                fuel snapshot < conf.yaml

        """
        if sys.stdin.isatty():
            conf = {}
        else:
            conf = yaml.load(sys.stdin.read())

        snapshot_task = SnapshotTask.start_snapshot_task(conf)
        self.serializer.print_to_output(
            snapshot_task.data,
            "Generating dump..."
        )
        snapshot_task.wait()

        if snapshot_task.status == 'ready':
            download_snapshot_with_progress_bar(
                snapshot_task.connection.root + snapshot_task.data["message"],
                auth_token=APIClient.auth_token,
                directory=params.dir
            )
        elif snapshot_task.status == 'error':
            six.print_(
                "Snapshot generating task ended with error. Task message: {0}"
                .format(snapshot_task.data["message"]),
                file=sys.stderr
            )
Example #2
0
    def get_snapshot(self, params):
        """To download diagnostic snapshot:
                fuel snapshot

            To download diagnostic snapshot to specific directory:
                fuel snapshot --dir path/to/directory

            To specify config for snapshoting
                fuel snapshot < conf.yaml

        """
        if sys.stdin.isatty():
            conf = {}
        else:
            conf = yaml.load(sys.stdin.read())

        snapshot_task = SnapshotTask.start_snapshot_task(conf)
        self.serializer.print_to_output(snapshot_task.data,
                                        "Generating dump...")
        snapshot_task.wait()

        if snapshot_task.status == 'ready':
            download_snapshot_with_progress_bar(
                snapshot_task.connection.root + snapshot_task.data["message"],
                auth_token=APIClient.auth_token,
                directory=params.dir)
        elif snapshot_task.status == 'error':
            six.print_(
                "Snapshot generating task ended with error. Task message: {0}".
                format(snapshot_task.data["message"]),
                file=sys.stderr)
Example #3
0
    def get_snapshot(self, params):
        """To download diagnostic snapshot:
                fuel snapshot

            To download diagnostic snapshot to specific directory:
                fuel snapshot --dir path/to/directory

            To specify config for snapshoting
                fuel snapshot < conf.yaml

        """
        if sys.stdin.isatty():
            conf = {}
        else:
            conf = yaml.load(sys.stdin.read())

        snapshot_task = SnapshotTask.start_snapshot_task(conf)
        self.serializer.print_to_output(
            snapshot_task.data,
            "Generating dump..."
        )
        snapshot_task.wait()
        download_snapshot_with_progress_bar(
            snapshot_task.connection.root + snapshot_task.data["message"],
            directory=params.dir
        )
Example #4
0
    def get_snapshot(self, params):
        """To download diagnostic snapshot:
                fuel snapshot

            To download diagnostic snapshot to specific directory:
                fuel snapshot --dir path/to/directory
        """
        snapshot_task = SnapshotTask.start_snapshot_task()
        self.serializer.print_to_output(
            snapshot_task.data,
            "Generating dump..."
        )
        snapshot_task.wait()
        download_snapshot_with_progress_bar(
            snapshot_task.connection.api_root + snapshot_task.data["message"],
            directory=params.dir
        )
Example #5
0
    def get_snapshot(self, params):
        """To download diagnostic snapshot:
                fuel snapshot

            To download diagnostic snapshot to specific directory:
                fuel snapshot --dir path/to/directory
        """
        snapshot_task = SnapshotTask.start_snapshot_task()
        self.serializer.print_to_output(
            snapshot_task.data,
            "Generating dump..."
        )
        snapshot_task.wait()
        download_snapshot_with_progress_bar(
            snapshot_task.connection.root + snapshot_task.data["message"],
            directory=params.dir
        )