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
#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.
34
35
36
|
# File 'lib/dbus/systemd/machined/manager.rb', line 34
def service
@service
end
|
Instance Method Details
#get_image_by_path(path) ⇒ Object
68
69
70
71
72
|
# File 'lib/dbus/systemd/machined/manager.rb', line 68
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
50
51
52
53
54
|
# File 'lib/dbus/systemd/machined/manager.rb', line 50
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
64
65
66
|
# File 'lib/dbus/systemd/machined/manager.rb', line 64
def image(name)
Image.new(name, self)
end
|
#images ⇒ Object
60
61
62
|
# File 'lib/dbus/systemd/machined/manager.rb', line 60
def images
self.ListImages.first.map { |i| map_image(i) }
end
|
#machine(name) ⇒ Object
46
47
48
|
# File 'lib/dbus/systemd/machined/manager.rb', line 46
def machine(name)
Machine.new(name, self)
end
|
#machines ⇒ Object
42
43
44
|
# File 'lib/dbus/systemd/machined/manager.rb', line 42
def machines
self.ListMachines.first.map { |m| map_machine(m) }
end
|
#map_image(image_array) ⇒ Object
#map_machine(machine_array) ⇒ Object