Jim Paris
ad85c3dd29
CherryPy bug 1200 is no longer an issue
4 years ago
Jim Paris
0e6ccd687b
Fix missing Exception.message in Python 3
4 years ago
Jim Paris
911d9bc284
Encode Unicode to raw bytes for server responses
4 years ago
Jim Paris
0f5c1c0db6
Run 2to3 automatic fixes over entire tree
4 years ago
Jim Paris
3658d3876b
Rename deprecated config option
The new version works in Cherrypy 3.2
9 years ago
Jim Paris
ccf1f695af
Prevent negative numbers in dbinfo output.
This might occur if things change while we're calculating the sizes.
10 years ago
Jim Paris
b89b945a0f
Better responses to invalid HTTP times
10 years ago
Jim Paris
d6d215d53d
Improve boolean HTTP parameter handling
10 years ago
Jim Paris
e2347c954e
Split more CherrpyPy stuff into serverutil
10 years ago
Jim Paris
222a5c6c53
Move server decorators and other utilities to a separate file
This will help with implementing nilmrun.
10 years ago
Jim Paris
1ca2c143e5
Fix typo
10 years ago
Jim Paris
2768a5ad15
Show FQDN rather than hostname.
11 years ago
Jim Paris
a105543c38
Show a more helpful message at the root nilmdb path
11 years ago
Jim Paris
539c92226c
Add more disk space info
11 years ago
Jim Paris
1c40d59a52
server: use a generator in /stream/remove
Instead of returning a single number at the end of N nilmdb calls, we
now use a generator that returns one line of text every time there's a
new count of rows removed. This ensures that the connection will stay
alive for very long removals.
11 years ago
Jim Paris
cc211542f8
Add binary support to nilmdb.server; enforce content-type
11 years ago
Jim Paris
8292dcf70b
Clean up stream/extract content-type and add a test for it
11 years ago
Jim Paris
d1140e0f16
Timestamps are int64, not uint64
11 years ago
Jim Paris
5b7409f802
Add binary extract to client, server, nilmdb, bulkdata, and rocket.
11 years ago
Jim Paris
04def60021
Include stream path in "no such stream" errors
11 years ago
Jim Paris
5292319802
server: consolidate time processing and checks
11 years ago
Jim Paris
b5fefffa09
Use a global cached server object for WSGI app
This is instead of caching it inside nilmdb.server.wsgi_application.
Might make things work a bit better in case the web server decides
to call wsgi_application multiple times.
11 years ago
Jim Paris
95ca55aa7e
Print out WSGI environment on DB init failure
11 years ago
Jim Paris
dd5fc806e5
Restructure WSGI app to regenerate error on each call, if needed
This way, errors like "database already locked" can be fixed and the
page reloaded, without needing to restart Apache.
11 years ago
Jim Paris
77ef87456f
Improve WSGI application support, fix docs
11 years ago
Jim Paris
6af3a6fc41
Add WSGI application support and documentation
11 years ago
Jim Paris
89be6f5931
Add option to include interval start/end markup on extract
When enabled, lines like "# interval-start 1234567890123456" and "#
interval-end 1234567890123456" will be added to the data output. Note
that there may be an "interval-end" timestamp followed by an identical
"interval-start" timestamp, if the response at the nilmdb level was
split up into multiple chunks.
In general, assume contiguous data if previous_interval_end ==
new_interval_start.
11 years ago
Jim Paris
4cdef3285d
Destroy now requires that all data has been previously removed.
Added new flag "-R" to command line to perform an automatic removal.
This should be the last of the ways in which a single command could
block the nilmdb thread for a long time.
11 years ago
Jim Paris
bcd82c4d59
Limit the number of rows removed per call to nilmdb.stream_remove
Server class will retry as needed, as with stream_extract and
stream_intervals.
11 years ago
Jim Paris
caf63ab01f
Fix stream_extract/stream_intervals restart around timestamp == 0.
11 years ago
Jim Paris
aaea105861
Consolidate most timestamp <-> string conversions (outside of rocket)
11 years ago
Jim Paris
b9f0b35bbe
Stream renaming support, and comprehensive tests
Implemented in command line, client, server, nilmdb, bulkdata
11 years ago
Jim Paris
a351bc1b10
Add client, server, nilmdb support for listing interval differences
11 years ago
Jim Paris
9f914598c2
Make /stream/list give some more extended info, like row count
Also changes the HTTP parameter from "extent" to "extended",
and the commandline parameter from "extent" to "ext".
11 years ago
Jim Paris
232a3876c2
Clean up imports to separate client and server more.
"import nilmdb" doesn't do much; "import nilmdb.client" or "import
nilmdb.server" is now required.
11 years ago
Jim Paris
65f09f793c
When re-raising exceptions in the server, preserve original tracebacks
11 years ago
Jim Paris
84e21ff467
Move ASCII data parsing from the server to the rocket interface.
The server buffers the string and passes it to nilmdb. Nilmdb passes
the string to bulkdata. Bulkdata uses the rocket interface to parse
it in chunks, as necessary. Everything gets passed back up and
everyone is happy.
Currently, only pyrocket implements append_string.
11 years ago
Jim Paris
454e561d69
Verify that metadata values are numbers or strings
11 years ago
Jim Paris
fe91ff59a3
Better handling of JSON requests
11 years ago
Jim Paris
58c0ae72f6
Support application/json POST bodies as well as x-www-form-urlencoded
11 years ago
Jim Paris
c6a0e6e96f
More complete CORS handling, including preflight requests (hopefully)
11 years ago
Jim Paris
79755dc624
Fix Allow: header by switching to cherrypy's built in tools.allow().
Replaces custom tools.allow_methods which didn't return the Allow: header.
11 years ago
Jim Paris
f260f2c83d
Remove unnecessary layout argument to nilmdb.stream_extract
11 years ago
Jim Paris
fadb84d703
Move ascii formatting into nilmdb thread via rocket interface
11 years ago
Jim Paris
9b6de6ecb7
Replace old layout strings everywhere
11 years ago
Jim Paris
00237e30b2
Add "extent" option to stream_list in client, server, and nilmdb
11 years ago
Jim Paris
d752b882f2
Bump up block sizes in client
This will help amortize the sqlite synchronization costs.
11 years ago
Jim Paris
50a4a60786
Replace pyCurl with Requests
Only tested with v1.1.0. It's not clear how well older versions will
work.
11 years ago
Jim Paris
3d82888580
Enforce method types, and require POST for actions that change things.
This is a pretty big change that will render existing clients unable
to modify the database, but it's important that we use POST or PUT
instead of GET for anything that may change state, in case this
is ever put behind a cache.
11 years ago
Jim Paris
f396e3934c
Remove cherrypy version check
Dependencies should be handled by installation, not at runtime.
11 years ago