Skip to content

Commit ff7011e

Browse files
author
Luca Bruno
authored
Merge pull request #306 from martynasb/expose-get-properties
dbus: Introduce GetAllProperties() for fetching all systemd unit properties
2 parents 1652836 + 1b0c50b commit ff7011e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dbus/methods.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ func (c *Conn) GetUnitPathProperties(path dbus.ObjectPath) (map[string]interface
197197
return c.getProperties(path, "org.freedesktop.systemd1.Unit")
198198
}
199199

200+
// GetAllProperties takes the (unescaped) unit name and returns all of its dbus object properties.
201+
func (c *Conn) GetAllProperties(unit string) (map[string]interface{}, error) {
202+
path := unitPath(unit)
203+
return c.getProperties(path, "")
204+
}
205+
200206
func (c *Conn) getProperty(unit string, dbusInterface string, propertyName string) (*Property, error) {
201207
var err error
202208
var prop dbus.Variant

0 commit comments

Comments
 (0)