Esempio n. 1
0
    def get(self, topic):
        if 'X-AppEngine-Cron' not in self.request.headers:
            self.error(403)
            return

        pubsub_utils.publish_to_topic(topic, str(time.time()))
        self.response.status_int = 204
Esempio n. 2
0
    def get(self, topic):

        url = "https://data.cityofchicago.org/resource/8v9j-bter.json"

        result = urlfetch.fetch(url)
        if result.status_code == 200:
            data = result.content

            bucket = "/case-interview-testbucket"
            filename = bucket + "/trafficdata.json"

            gcs_file = gcs.open(filename, 'w')
            gcs_file.write(data)
            gcs_file.close()

        pubsub_utils.publish_to_topic(topic, str(time.time()))

        self.response.headers['Content-Type'] = 'application/json'
        self.response.write(json.dumps({"status": "200"}))
Esempio n. 3
0
    def get(self, topic):
        pubsub_utils.publish_to_topic(topic, str(time.time()))

        self.response.headers['Content-Type'] = 'application/json'
        self.response.write({"status": "200"})
 def get(self):
     topic_name = self.request.path.split(EVENTS_PREFIX)[-1]
     publish_to_topic(topic_name)
     self.response.status = 204
Esempio n. 5
0
    def get(self, topic):
        pubsub_utils.publish_to_topic(topic, str(time.time()))

        self.response.headers['Content-Type'] = 'application/json'
        self.response.write(json.dumps({"status": "200"}))
 def get(self):
     topic_name = 'kga-indexercommands'
     msg = 'command=start_stats_calc\ndays=T-1'
     publish_to_topic(topic_name, msg)
     self.response.status = 204
Esempio n. 7
0
 def get(self):
     topic_name = self.request.path.split(EVENTS_PREFIX)[-1]
     publish_to_topic(topic_name, msg='update')
     self.response.status = 204
Esempio n. 8
0
 def get(self):
     topic_name = 'kga-indexercommands'
     msg = 'command=start_social_import\ntimewindowsec=130000\nhistorywindowsec=604800'
     publish_to_topic(topic_name, msg)
     self.response.status = 204
Esempio n. 9
0
    def get(self, topic):
        pubsub_utils.publish_to_topic(topic, datetime.now().isoformat())

        self.response.headers['Content-Type'] = 'application/json'
        self.response.write(json.dumps({"status": "200"}))