CrystaLXD::Container
Inherits Struct < Value < Object
https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10containers
This object is instantiated through CrystaLXD::Client#container
Constructors
Instance methods
Creates a new container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#post-optional-targetmember).
Removes this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#delete-1).
Runs a remote command directly, without any wait for websocket connection (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10containersnameexec).
Runs a remote command and wait for a websocket connection before starting the process (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10containersnameexec).
Yields the stdin and control websockets (in this order).
The control websocket can be used to send out-of-band messages during an exec session. This is currently used for window size changes and for forwarding of signals.
require "crystalxd"
exec = CrystaLXD::Container::Exec.new command: ["/bin/ls"], cwd: "/"
exec.on_stdout do |bytes|
STDOUT.write bytes
end
mycontainer.exec_websocket exec do |stdin_ws, contol_ws|
end
Freezes this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
Returns container configuration and current state (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#get-5).
64 chars max, ASCII, no slash, no colon and no comma.
Renames this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#post-optional-targetmember-1).
Replaces container configuration (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-etag-supported-2).
Restarts this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
Restores a snapshot (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-etag-supported-2).
Starts this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
Returns the current state (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#get-9).
Stops this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
Unfreezes this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
Updates container configuration (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#patch-etag-supported-2).