Class: DBus::Systemd::Machined::Manager
Constant Summary
collapse
- NODE =
'/org/freedesktop/machine1'
- INTERFACE =
'org.freedesktop.machine1.Manager'
- MACHINE_INDICES =
{
name: 0,
class: 1,
service_id: 2,
object_path: 3
}
- IMAGE_INDICES =
{
name: 0,
type: 1,
read_only: 2,
creation_time: 3,
modification_time: 4,
disk_space: 5,
object_path: 6
}
Instance Attribute Summary collapse
#object
Instance Method Summary
collapse
#properties
#method_missing, #respond_to_missing?
Constructor Details
#initialize(bus = Systemd::Helpers.system_bus) ⇒ Manager
Returns a new instance of Manager.
Instance Attribute Details
#service ⇒ Object
Returns the value of attribute service.
35
36
37
|
# File 'lib/dbus/systemd/machined/manager.rb', line 35
def service
@service
end
|
Instance Method Details
#get_image_by_path(path) ⇒ Object
69
70
71
72
73
|
# File 'lib/dbus/systemd/machined/manager.rb', line 69
def get_image_by_path(path)
obj = @service.object(path)
.tap(&:introspect)
Image.new(obj.Get(Image::INTERFACE, 'Name').first, self)
end
|
#get_machine_by_path(path) ⇒ Object
51
52
53
54
55
|
# File 'lib/dbus/systemd/machined/manager.rb', line 51
def get_machine_by_path(path)
obj = @service.object(path)
.tap(&:introspect)
Machine.new(obj.Get(Machine::INTERFACE, 'Name').first, self)
end
|
#image(name) ⇒ Object
65
66
67
|
# File 'lib/dbus/systemd/machined/manager.rb', line 65
def image(name)
Image.new(name, self)
end
|
#images ⇒ Object
61
62
63
|
# File 'lib/dbus/systemd/machined/manager.rb', line 61
def images
self.ListImages.first.map { |i| map_image(i) }
end
|
#machine(name) ⇒ Object
47
48
49
|
# File 'lib/dbus/systemd/machined/manager.rb', line 47
def machine(name)
Machine.new(name, self)
end
|
#machines ⇒ Object
43
44
45
|
# File 'lib/dbus/systemd/machined/manager.rb', line 43
def machines
self.ListMachines.first.map { |m| map_machine(m) }
end
|
#map_image(image_array) ⇒ Object
#map_machine(machine_array) ⇒ Object