struct CrystaLXD::Container::Exec

Overview

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

Included Modules

Defined in:

client/container.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(command : Array(String), environment : Hash(String, String)? = nil, record_output : Bool = false, width : Int32? = nil, height : Int32? = nil, user : Int32? = nil, group : Int32? = nil, cwd : String? = nil) #

[View source]

Instance Method Detail

def command : Array(String) #

Command and arguments.


[View source]
def command=(command : Array(String)) #

Command and arguments.


[View source]
def cwd : String? #

Current working directory (optional).


[View source]
def cwd=(cwd : String?) #

Current working directory (optional).


[View source]
def environment : Hash(String, String)? #

Optional extra environment variables to set.


[View source]
def environment=(environment : Hash(String, String)?) #

Optional extra environment variables to set.


[View source]
def group : Int32? #

Group to run the command as (optional).


[View source]
def group=(group : Int32?) #

Group to run the command as (optional).


[View source]
def height : Int32? #

Initial height of the terminal (optional).


[View source]
def height=(height : Int32?) #

Initial height of the terminal (optional).


[View source]
def on_stderr(&on_stderr : Bytes -> ) #

Registers a proc operation to execute on stderr outputs.

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

[View source]
def on_stdout(&on_stdout : Bytes -> ) #

Registers a proc operation to execute on stdout outputs.

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

[View source]
def user : Int32? #

User to run the command as (optional).


[View source]
def user=(user : Int32?) #

User to run the command as (optional).


[View source]
def width : Int32? #

Initial width of the terminal (optional).


[View source]
def width=(width : Int32?) #

Initial width of the terminal (optional).


[View source]