Пример #1
0
    def get(self):
        user = users.get_current_user()
        logging.debug("BasicRootHandler #get")

        q = Service.all()
        q.order("name")
        services = q.fetch(100)
        
        p = Status.all()
        p.order("severity")
        
        past = get_past_days(5)

        services = q.fetch(100)
    
        for s in services:
            logging.info(s.last_six_days())

        
        td = {}
        td["services"] = services
        td["statuses"] = p.fetch(100)
        td["past"] = past
        td["default"] = Status.default()

        self.render(td, 'site/index.html')
Пример #2
0
    def get(self, version):
        logging.debug("StatusesListHandler#get")
        
        if (self.valid_version(version)):
            query = Status.all().order('severity')

            if (query):
                data = []

                for s in query:
                    data.append(s.rest(self.base_url(version)))

                self.json({"statuses": data}) 
            else:
                self.error(404, "No statuses")
        else:
            self.error(404, "API Version %s not supported" % version)