Class: OsCtl::Cli::Lxcfs
- Inherits:
-
Command
- Object
- Lib::Cli::Command
- Command
- OsCtl::Cli::Lxcfs
show all
- Defined in:
- lib/osctl/cli/lxcfs.rb
Constant Summary
collapse
- WORKER_FIELDS =
%i(
name
enabled
size
max_size
cpu_package
loadavg
cfs
mountpoint
)
- DEFAULT_WORKER_FIELDS =
WORKER_FIELDS - %i(mountpoint)
Instance Method Summary
collapse
Methods inherited from Command
#cli_opt, #format_output, #osctld_call, #osctld_fmt, #osctld_open, #osctld_resp, run
Instance Method Details
#worker_disable ⇒ Object
47
48
49
50
|
# File 'lib/osctl/cli/lxcfs.rb', line 47
def worker_disable
require_args!('worker')
osctld_fmt(:lxcfs_worker_disable, cmd_opts: {worker: args[0]})
end
|
#worker_enable ⇒ Object
42
43
44
45
|
# File 'lib/osctl/cli/lxcfs.rb', line 42
def worker_enable
require_args!('worker')
osctld_fmt(:lxcfs_worker_enable, cmd_opts: {worker: args[0]})
end
|
#worker_list ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/osctl/cli/lxcfs.rb', line 18
def worker_list
require_args!
param_selector = OsCtl::Lib::Cli::ParameterSelector.new(
all_params: WORKER_FIELDS,
default_params: DEFAULT_WORKER_FIELDS,
)
if opts[:list]
puts param_selector
return
end
fmt_opts = {
layout: :columns,
cols: param_selector.parse_option(opts[:output]),
sort: opts[:sort] && param_selector.parse_option(opts[:sort]),
}
fmt_opts[:header] = false if opts['hide-header']
osctld_fmt(:lxcfs_worker_list, fmt_opts: fmt_opts)
end
|
#worker_prune ⇒ Object
57
58
59
|
# File 'lib/osctl/cli/lxcfs.rb', line 57
def worker_prune
osctld_fmt(:lxcfs_worker_prune)
end
|
#worker_set_max_size ⇒ Object
52
53
54
55
|
# File 'lib/osctl/cli/lxcfs.rb', line 52
def worker_set_max_size
require_args!('worker', 'max-size')
osctld_fmt(:lxcfs_worker_set, cmd_opts: {worker: args[0], max_size: args[1].to_i})
end
|