stream item support

This commit is contained in:
Sandy Walsh 2014-09-04 20:35:29 +00:00
parent d9c1f5b778
commit 7e0c4dd829

View File

@ -60,9 +60,9 @@ class StreamCollection(common.FalconBase):
class StreamItem(common.FalconBase): class StreamItem(common.FalconBase):
def on_get(self, req, resp, stream_id, action=None): def on_get(self, req, resp, stream_id, action=None):
details = action == 'details' details = req.get_param('details')
stream = self.impl.get_stream(stream_id, details) streams = self.impl.get_stream(stream_id, details)
resp.body = json.dumps(stream.to_dict()) resp.body = json.dumps(streams)
def on_delete(self, req, resp, stream_id): def on_delete(self, req, resp, stream_id):
self.impl.delete_stream(stream_id) self.impl.delete_stream(stream_id)
@ -88,5 +88,3 @@ class Schema(object):
self.stream_collection) self.stream_collection)
self.api.add_route('%s/streams/{stream_id}' % self._v(), self.api.add_route('%s/streams/{stream_id}' % self._v(),
self.stream_item) self.stream_item)
self.api.add_route('%s/streams/{stream_id}/{action}' % self._v(),
self.stream_item)