sparkfun / phant

the data logging engine behind data.sparkfun.com
700 stars 98 forks source link

Create a data stream via HTTP #78

Closed dt99jay closed 10 years ago

dt99jay commented 10 years ago

Is it possible for a client to create a data stream via a HTTP request (I see you can delete them via HTTP)? This would be helpful for low-level clients (e.g. microcontrollers) which need to create streams on an ad hoc basis.

toddtreece commented 10 years ago

This is possible, be we are trying to discourage that on data.sparkfun.com because we don't one one person programmatically creating a bunch of streams and using all of the resources. It's not ideal, but we want to continue offering it as a free service, and stopping abuse helps with that.

What's your use case for creating them ad hoc?

dt99jay commented 10 years ago

Yes, can understand why you'd want to discourage this on data.sparkfun.com – though it could be a nice feature for people deploying Phant elsewhere. I don't have an urgent use, but I'm working on an open source power sensor (which I might produce in small volumes) and am looking for suitable repositories to post the data to.

toddtreece commented 10 years ago

Yeah. It shouldn't be an issue to add to the standard phant http manager.

toddtreece commented 10 years ago

@dt99jay You can now do this via the HTTP manager, and you can get a JSON response if you POST your new stream to http://localhost/streams/create.json. If you need to configure a phant server with the HTTP manager enabled, you can now use this configuration tool: https://data.sparkfun.com/config