Implement files REST API

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Add basic support for pushing/pulling files

Here we have basic support for pushing and pulling files from containers. We
don't support recursive stuff right now (although it shouldn't be hard to add).

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Grab files from /proc/<pid>/root for running contianers

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Better handle errors for missing files

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
[UPD] fixing issue #118

removed the duplicate line

Signed-off-by: Matthias Fritzsche <txt.file@txtfile.eu>
Merge pull request #119 from txt-file/patch-1

[UPD] fixing issue #118
Merge pull request #117 from tych0/files-api

Files api
rest-api: Add Etag support for reliable updates

Issue #120

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Merge pull request #121 from stgraber/master

rest-api: Add Etag support for reliable updates
whoops, somehow this got committed by accident

...and made it through review :)

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #123 from tych0/remove-file

whoops, somehow this got committed by accident
You should POST instead of PUT new certs to /trust

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #125 from tych0/fix-typo

You should POST instead of PUT new certs to /trust
Set the password via the spec's rest API

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Use the real trust REST api

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
add /1.0/trust/<fingerprint> GET support

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #126 from tych0/restificate-trust

Restificate trust
Enforce every code path returning a response

LXD had several code paths which would not return a response (or would return
some bogus response). In addition, the code was often more verbose than it
needed to be, having to pass around the ResponseWriter everywhere that needed
it.

This commit resolves that by introducing our own signature for http handler
types, the Response type. You can still do arbitrary stuff to the
ResponseWriter if you want (see the container file handler code), but this uses
the compiler to enforce that every code path actually returns a response. It is
also significatly less ugly, with no bare returns and not having to pass the
ResponseWriter everywhere.

Closes #101

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Merge pull request #129 from tych0/force-response

Enforce every code path returning a response
Implement `lxc snapshot` and the corresponding API

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>