struct CrystaLXD::Container
- CrystaLXD::Container
- Struct
- Value
- Object
Overview
https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10containers
This object is instantiated through CrystaLXD::Client#container
Defined in:
client/container.crConstructors
Instance Method Summary
-
#create(source : Source::Image | Source::Copy | Source::Migration | Source::None, configuration : Configuration = Configuration.new) : Success(BackgroundOperation) | Error
Creates a new container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#post-optional-targetmember).
-
#delete : Success(BackgroundOperation) | Error
Removes this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#delete-1).
-
#exec_direct(exec : Exec) : Success(BackgroundOperation) | Error
Runs a remote command directly, without any wait for websocket connection (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10containersnameexec).
-
#exec_websocket(exec : Exec, &) : Success(CrystaLXD::BackgroundOperation) | Error
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).
-
#freeze(timeout : Int32 | Nil = nil) : Success(BackgroundOperation) | Error
Freezes this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
-
#information : Success(Information) | Error
Returns container configuration and current state (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#get-5).
-
#name : String
64 chars max, ASCII, no slash, no colon and no comma.
-
#rename(new_name : String) : Success(BackgroundOperation) | Error
Renames this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#post-optional-targetmember-1).
-
#replace_config(configuration : Configuration) : Success(BackgroundOperation) | Error
Replaces container configuration (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-etag-supported-2).
-
#restart(force : Bool = true, timeout : Int32 | Nil = nil) : Success(BackgroundOperation) | Error
Restarts this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
-
#restore_snapshot(snapshot_name : String) : Success(BackgroundOperation) | Error
Restores a snapshot (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-etag-supported-2).
-
#start(stateful : Bool = false, timeout : Int32 | Nil = nil) : Success(BackgroundOperation) | Error
Starts this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
-
#state : Success(State) | Error
Returns the current state (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#get-9).
-
#stop(force : Bool = true, stateful : Bool = false, timeout : Int32 | Nil = nil) : Success(BackgroundOperation) | Error
Stops this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
-
#unfreeze(timeout : Int32 | Nil = nil) : Success(BackgroundOperation) | Error
Unfreezes this container (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#put-1).
-
#update_config(configuration : Configuration) : Success(Empty) | Error
Updates container configuration (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#patch-etag-supported-2).
Constructor Detail
Instance Method Detail
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).
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).