struct

CrystaLXD::Container::Exec

Inherits JSON::Serializable < Struct < Value < Object

Exec options (https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10containersnameexec).

Constructors

new(pull : JSON::PullParser)
new(command : Array(String), environment : Hash(String, String) | Nil = nil, record_output : Bool = false, width : Int32 | Nil = nil, height : Int32 | Nil = nil, user : Int32 | Nil = nil, group : Int32 | Nil = nil, cwd : String | Nil = nil)
new(*, __pull_for_json_serializable pull : JSON::PullParser)

Instance methods

command

Command and arguments.

command=(command : Array(String))

Command and arguments.

cwd

Current working directory (optional).

cwd=(cwd : String | Nil)

Current working directory (optional).

environment

Optional extra environment variables to set.

environment=(environment : Hash(String, String) | Nil)

Optional extra environment variables to set.

group

Group to run the command as (optional).

group=(group : Int32 | Nil)

Group to run the command as (optional).

height

Initial height of the terminal (optional).

height=(height : Int32 | Nil)

Initial height of the terminal (optional).

on_stderr

Registers a proc operation to execute on stderr outputs.

exec = CrystaLXD::Container::Exec.new
exec.on_stderr do |bytes|
  STDERR.write bytes
end
on_stdout

Registers a proc operation to execute on stdout outputs.

exec = CrystaLXD::Container::Exec.new
exec.on_stdout do |bytes|
  STDOUT.write bytes
end
user

User to run the command as (optional).

user=(user : Int32 | Nil)

User to run the command as (optional).

width

Initial width of the terminal (optional).

width=(width : Int32 | Nil)

Initial width of the terminal (optional).