Пример #1
0
 def get(self, uuid):
     """Return statistics for the performend installation based on provided UUID"""
     install_status = InstallStatus(uuid)
     stats = install_status.get_stats()
     if stats['start_date'] is None:
         return abort(404)
     return stats
Пример #2
0
 def get(self, uuid):
     """Returns the latest status based on provided UUID"""
     install_status = InstallStatus(uuid)
     latest_status = install_status.get_latest_status()
     if latest_status is None:
         return abort(404)
     return latest_status
Пример #3
0
 def get(self, uuid):
     """Returns the history for a provided UUID"""
     install_status = InstallStatus(uuid)
     history = install_status.get_history()
     if len(history) == 0:
         return abort(404)
     return history
Пример #4
0
 def get(self, uuid):
     """Return the history for a provided UUID."""
     install_status = InstallStatus(uuid)
     history = install_status.get_history()
     if not history:
         return abort(404)
     return history
Пример #5
0
 def get(self, uuid):
     """Return statistics for the performend installation based on provided UUID"""
     install_status = InstallStatus(uuid)
     stats = install_status.get_stats()
     if stats['start_date'] is None:
         return abort(404)
     return stats
Пример #6
0
 def get(self, uuid):
     """Returns the history for a provided UUID"""
     install_status = InstallStatus(uuid)
     history = install_status.get_history()
     if len(history) == 0:
         return abort(404)
     return history
Пример #7
0
 def get(self, uuid):
     """Returns the latest status based on provided UUID"""
     install_status = InstallStatus(uuid)
     latest_status = install_status.get_latest_status()
     if latest_status is None:
         return abort(404)
     return latest_status
Пример #8
0
    def post(self, uuid):
        """Creates a new statusupdate for a UUID"""
        if not validation.is_uuid(uuid):
            return abort(404)

        parser = reqparse.RequestParser(bundle_errors=True)
        parser.add_argument('status_code', type=int, required=True)
        parser.add_argument('step_description', type=str, required=True)
        parser.add_argument('current_step', type=int, required=True)
        parser.add_argument('total_steps', type=int, required=True)
        args = parser.parse_args(request)

        install = InstallStatus(uuid)
        install.insert_status(args.status_code, args.step_description,
                              args.current_step, args.total_steps)
        return
Пример #9
0
    def post(self, uuid):
        """Creates a new statusupdate for a UUID"""
        if not validation.is_uuid(uuid):
            return abort(404)

        parser = reqparse.RequestParser(bundle_errors=True)
        parser.add_argument('status_code', type=int, required=True)
        parser.add_argument('step_description', type=str, required=True)
        parser.add_argument('current_step', type=int, required=True)
        parser.add_argument('total_steps', type=int, required=True)
        args = parser.parse_args(request)

        install = InstallStatus(uuid)
        install.insert_status(args.status_code, args.step_description,
                              args.current_step, args.total_steps)
        return