Skip to content

Commit

Permalink
Merge pull request #306 from martynasb/expose-get-properties
Browse files Browse the repository at this point in the history
dbus: Introduce GetAllProperties() for fetching all systemd unit properties
  • Loading branch information
Luca Bruno committed Jun 18, 2019
2 parents 1652836 + 1b0c50b commit ff7011e
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 ff7011e

Please sign in to comment.