diff --git a/dbus/methods.go b/dbus/methods.go index 5f2790ac..5859583e 100644 --- a/dbus/methods.go +++ b/dbus/methods.go @@ -197,6 +197,12 @@ func (c *Conn) GetUnitPathProperties(path dbus.ObjectPath) (map[string]interface return c.getProperties(path, "org.freedesktop.systemd1.Unit") } +// GetAllProperties takes the (unescaped) unit name and returns all of its dbus object properties. +func (c *Conn) GetAllProperties(unit string) (map[string]interface{}, error) { + path := unitPath(unit) + return c.getProperties(path, "") +} + func (c *Conn) getProperty(unit string, dbusInterface string, propertyName string) (*Property, error) { var err error var prop dbus.Variant