Skip to content

Commit 1b0c50b

Browse files
committed
dbus: Introduce GetAllProperties() for fetching all systemd unit properties
1 parent 95778df commit 1b0c50b

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)