Class: LVM::Wrapper::LVS
- Inherits:
-
Object
- Object
- LVM::Wrapper::LVS
- Includes:
- Reporting
- Defined in:
- lib/lvm/wrapper/lvs.rb
Constant Summary collapse
- BASE_COMMAND =
"lvs #{Reporting::BASE_ARGUMENTS}".freeze
- ATTRIBUTES_FILE =
"lvs.yaml".freeze
- VOLUME_TYPE =
lv_attr attribute handling constants roughly by order referenced in lib/report/report.c:292 (_lvstatus_disp)
{ "p" => :pvmove, "c" => :conversion, "M" => :mirror_not_synced, "m" => :mirror, "i" => :mirror_image, "I" => :mirror_image_not_synced, "l" => :mirror_log, "v" => :virtual, "o" => :origin, "s" => :snapshot, "S" => :invalid_snapshot, # custom, empty is a standard volume "-" => :normal, }.freeze
- PERMISSIONS =
{ "w" => :writeable, "r" => :readonly, # custom, from reading source "-" => :locked_by_pvmove, }.freeze
- ALLOCATION_POLICY =
{ "c" => :contiguous, "l" => :cling, "n" => :normal, "a" => :anywhere, "i" => :inherited, "C" => :contiguous_locked, "L" => :cling_locked, "N" => :normal_locked, "A" => :anywhere_locked, "I" => :inherited_locked, }.freeze
- FIXED_MINOR =
{ # code says its a boolean "m" => true, }.freeze
- STATE =
{ "s" => :suspended, "a" => :active, "i" => :inactive_with_table, "d" => :inactive_without_table, "S" => :suspended_snapshot, "I" => :invalid_snapshot, }.freeze
- DEVICE_OPEN =
{ # code says its a boolean "o" => true, }.freeze
Constants included from Reporting::Constants
Reporting::Constants::BASE_ARGUMENTS, Reporting::Constants::EMPTY, Reporting::Constants::SEPERATOR
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
-
#initialize(options) ⇒ LVS
constructor
A new instance of LVS.
- #list ⇒ Object
Methods included from Reporting
Constructor Details
#initialize(options) ⇒ LVS
Returns a new instance of LVS.
12 13 14 15 |
# File 'lib/lvm/wrapper/lvs.rb', line 12 def initialize() @attributes = Attributes.load([:version], ATTRIBUTES_FILE) @command = "#{[:command]} #{Reporting.build_command(attributes, BASE_COMMAND, [:additional_arguments])}" end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
9 10 11 |
# File 'lib/lvm/wrapper/lvs.rb', line 9 def attributes @attributes end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
10 11 12 |
# File 'lib/lvm/wrapper/lvs.rb', line 10 def command @command end |