Skip to content

Commit

Permalink
dbus: Introduce GetAllProperties() for fetching all systemd unit prop…
Browse files Browse the repository at this point in the history
…erties
  • Loading branch information
martynasb committed Jun 18, 2019
1 parent 95778df commit 1b0c50b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbus/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b0c50b

Please sign in to comment.