0.1.10 • Published 7 years ago
lxdn v0.1.10
lxdn
Yet another node-lxd client
API autogenerated from docs
Usage
Take a look at: https://github.com/lxc/lxd/blob/master/doc/rest-api.md#api-structure
Every API URL is simply mapped to a function.
Example: GET /1.0/containers/<name>/console -> client.api.containers(name).console.get()
Every final request function (.get(), .post(), etc.) allows three arguments:
parameters: Parameters to post/send. Not allowed on GET (simply set it tonullif using other args)query: Query parameters to addheaders: Additional headers
Some API calls might return buffers, these usually have set N/A as their return type.
Some other API calls might return async operations. For those check the .isAsync flag if async is among the types listed in operation. These calls return an AsyncOperation object
AsyncOperation:
async wait(timeout?): Wait, with possible timeout value. Will throw if operation errors.async cancel(): Cancel an operation. Throws if not running or uncancelableasync refresh(): Refresh details about the operationasync websocket(): For websocket-type operations this returns a websocket connection, for others it throwsverifySuccess(): Throws if the operation has errored. Prior to calling this.refresh()should be called