DBus service API documentation

The yumdaemon is an easy way to utililize the power of the yum package manager from your own programs

Data structures

Data structures
Name Content
Package Id (pkg_id) “name,epoch,ver,rel,arch,repo_id”
Transaction List (tx_list) “pkg_id,ts_state”

Attribute Descriptions
Attribute Description
name Package Name
epoch Package Epoch
ver Package Version
rel Package Release
arch Package Architecture
repo_id Repository Id
ts_state Transaction Member state

Transaction result:

<transaction_result> ::= <result>, <result>, ...., <result>
<result>             ::= <action>, <pkg_list>
<action>             ::= install | update | remove | install-deps | update-deps | remove-deps | skipped
<plg_list>           ::= <pkg_info>, <pkg_info>, ......, <pkg_info>
<pkg_info>           ::= <pkg_id>, size, <obs_list>
<pkg_id>             ::= name, epoch, version, release, arch, repo_id
<obs_list>           ::= <obs_id>, <obs_id>, ...., <obs_id>
<obs_id>             ::= name, epoch, version, release, arch, repo_id for packages obsoletes by <pkg_id>

System Service

DBus Names
Attribute Value
object org.baseurl.YumSystem
interface org.baseurl.YumSystem
path /

Misc methods

GetVersion()

Get the API version

Returns:string with API version
Lock()

Get the daemon Lock, if posible

Unlock()

Get the daemon Lock, if posible

Repository and config methods

GetRepositories(filter)

Get the value a list of repo ids

Parameters:filter (string) – filter to limit the listed repositories
Returns:list of repo id’s
Return type:array for stings (as)
GetRepo(repo_id)

Get information about a give repo_id

Parameters:repo_id (string) – repo id
Returns:a dictionary with repo information (JSON)
Return type:string (s)
SetEnabledRepos(repo_ids):

Enabled a list of repositories, disabled all other repos

Parameters:repo_ids – list of repo ids to enable
GetConfig(setting)

Get the value of a yum config setting

Parameters:setting (string) – name of setting (debuglevel etc..)
Returns:the config value of the requested setting (JSON)
Return type:string (s)
SetConfig(setting, value)

Get the value of a yum config setting

Parameters:
  • setting (string) – name of setting (debuglevel etc..)
  • value (misc types (JSON)) – name of setting (debuglevel etc..)
Returns:

did the update succed

Return type:

boolean (b)

Package methods

These methods is for getting packages and information about packages

GetPackages(pkg_filter)

get a list of packages matching the filter type

Parameters:pkg_filter (string) – package filter (‘installed’,’available’,’updates’,’obsoletes’,’recent’,’extras’)
Returns:list of pkg_id’s
Return type:array of strings (as)
GetPackageWithAttributes(pkg_filter, fields)
Get a list of pkg list for a given package filter
each pkg list contains [pkg_id, field,....] where field is a atrribute of the package object
Ex. summary, size etc.
Parameters:
  • pkg_filter (string) – package filter (‘installed’,’available’,’updates’,’obsoletes’,’recent’,’extras’)
  • fields (array of strings (as)) – yum package objects attributes to get.
Returns:

list of (id, field1, field2...) (JSON), each JSON Sting contains (id, field1, field2...)

Return type:

array of strings (as)

GetPackagesByName(name, newest_only)

Get a list of pkg ids for starts with name

Parameters:
  • name (string) – name prefix to match
  • newest_only (boolean) – show only the newest match or every match.
Returns:

list of pkg_id’s

Return type:

array of strings (as)

GetAttribute(id, attr)

get yum package attribute (description, filelist, changelog etc)

Parameters:
  • pkg_id (string) – pkg_id to get attribute from
  • attr (string) – name of attribute to get
Returns:

the value of the attribute (JSON), the content depend on attribute being read

Return type:

string (s)

GetUpdateInfo(id)

Get Updateinfo for a package

Parameters:pkg_id (string) – pkg_id to get update info from
Returns:update info for the package (JSON)
Return type:string (s)

Search for packages where keys is matched in fields

Parameters:
  • fields (array of strings) – yum po attributes to search in
  • keys (array of strings) – keys to search for
  • match_all (boolean) – match all keys or only one
  • newest_only (boolean) – match all keys or only one
  • tags (boolean) – match all keys or only one
Returns:

list of pkg_id’s for matches

Return type:

array of stings (as)

High level methods

The high level methods simulate the yum command line main functions.

Install(cmds)

Works just like the yum install <cmds> command line

param cmds:package arguments separated by spaces
type cmds:string
return:return code, result of resolved transaction (rc = 2 is ok, else failure) (JSON)
rtype:string (s)
Remove(cmds)

Works just like the yum install <cmds> command line

Parameters:cmds (string) – package arguments separated by spaces
Returns:return code, result of resolved transaction (rc = 2 is ok, else failure) (JSON)
Return type:string (s)
Update(cmds)

Works just like the yum install <cmds> command line

Parameters:cmds (string) – package arguments separated by spaces
Returns:return code, result of resolved transaction (rc = 2 is ok, else failure) (JSON)
Return type:string (s)
Reinstall(cmds)

Works just like the yum install <cmds> command line

Parameters:cmds (string) – package arguments separated by spaces
Returns:return code, result of resolved transaction (rc = 2 is ok, else failure) (JSON)
Return type:string (s)
Downgrade(cmds)

Works just like the yum install <cmds> command line

Parameters:cmds (string) – package arguments separated by spaces
Returns:return code, result of resolved transaction (rc = 2 is ok, else failure) (JSON)
Return type:string (s)

Transaction methods

These methods is for handling the current yum transaction

AddTransaction(id, action)

Add an package to the current transaction

Parameters:
  • id (string) – package id for the package to add
  • action (string) – the action to perform ( install, update, remove, obsolete, reinstall, downgrade, localinstall )
Returns:

list of (pkg_id, transaction state) pairs for the added members (comma separated)

Return type:

array of strings (as)

ClearTransaction()

Clear the current transaction

GetTransaction()

Get the currrent transaction

Returns:list of (pkg_id, transaction state) pairs in the current transaction (comma separated)
Return type:array of strings (as)
BuildTransaction()

Depsolve the current transaction

Returns:(return code, result of resolved transaction) pair (rc = 2 is ok, else failure) (JSON)
Return type:string (s)
RunTransaction()

Execute the current transaction

Returns:state of run transaction (0 = ok, 1 = need GPG import confirmation, 2 = error)
Return type:int (i)
ConfirmGPGImport(self, hexkeyid, confirmed)

Confirm import of at GPG Key by yum

Parameters:
  • hexkeyid (string (s)) – hex keyid for GPG key
  • confirmed (boolean (b)) – confirm import of key (True/False)

Groups

Methods to work with yum groups and categories

GetGroups()

Get available Categories & Groups

GetGroupPackages(grp_id, grp_flt)

Get packages in a group by grp_id and grp_flt

Parameters:
  • grp_id (string (s)) – The Group id
  • grp_flt (string (s)) – Group Filter (all or default)
Returns:

list of pkg_id’s

Return type:

array of strings (as)

Note

Under Development

More to come in the future, methods to install groups etc. has to be defined and implemented

History

Methods to work with the yum history

GetHistoryByDays(start_days, end_days)

Get History transaction in a interval of days from today

Parameters:
  • start_days (integer) – start of interval in days from now (0 = today)
  • end_days (integer) – end of interval in days from now
Returns:

a list of (transaction ids, date-time) pairs (JSON) :rtype: string (s)

GetHistoryPackages(tid)

Get packages from a given yum history transaction id

Parameters:tid (integer) – history transaction id
Returns:list of (pkg_id, state, installed) pairs
Return type:json encoded string
HistorySearch(pattern)

Search the history for transaction matching a pattern

Parameters:pattern (string) – patterne to match
Returns:list of (tid,isodates)

Signals

UpdateProgress(self,name,frac,fread,ftime):

Signal with download progress information

Parameters:
  • name – filename
  • frac – Progress fracment (0 -> 1)
  • fread – formated string containing BytesRead

:param ftime : formated string containing remaining or elapsed time

TransactionEvent(self,event,data):

Signal with Transaction event information, telling the current step in the processing of the current transaction.

Steps are : start-run, download, pkg-to-download, signature-check, run-test-transaction, run-transaction, fail, end-run

Parameters:event – current step
RPMProgress(self, package, action, te_current, te_total, ts_current, ts_total):

signal with RPM Progress

Parameters:
  • package – A yum package object or simple string of a package name
  • action – A yum.constant transaction set state or in the obscure rpm repackage case it could be the string ‘repackaging’
  • te_current – Current number of bytes processed in the transaction element being processed
  • te_total – Total number of bytes in the transaction element being processed
  • ts_current – number of processes completed in whole transaction
  • ts_total – total number of processes in the transaction.
GPGImport(self, pkg_id, userid, hexkeyid, keyurl, timestamp ):

signal with GPG Key information of a key there need to be confirmed to complete the current transaction. after signal is send transaction will abort with rc=1 Use ConfirmGPGImport method to comfirm the key and run RunTransaction again

Parameters:
  • pkg_id – pkg_id for the package needing the GPG Key to be verified
  • userid – GPG key name
  • hexkeyid – GPG key hex id
  • keyurl – Url to the GPG Key
  • timestamp

‘’‘

Session Service

DBus Names
Attribute Value
object org.baseurl.YumSession
interface org.baseurl.YumSession
path /

Misc methods

GetVersion()

Get the API version

Returns:string with API version
Lock()

Get the daemon Lock, if posible

Unlock()

Get the daemon Lock, if posible

Repository and config methods

GetRepositories(filter)

Get the value a list of repo ids

Parameters:filter (string) – filter to limit the listed repositories
Returns:list of repo id’s
Return type:array for stings (as)
GetRepo(repo_id)

Get information about a give repo_id

Parameters:repo_id (string) – repo id
Returns:a dictionary with repo information (JSON)
Return type:string (s)
SetEnabledRepos(repo_ids):

Enabled a list of repositories, disabled all other repos

Parameters:repo_ids – list of repo ids to enable
GetConfig(setting)

Get the value of a yum config setting

Parameters:setting (string) – name of setting (debuglevel etc..)
Returns:the config value of the requested setting (JSON)
Return type:string (s)

Package methods

These methods is for getting packages and information about packages

GetPackages(pkg_filter)

get a list of packages matching the filter type

Parameters:pkg_filter (string) – package filter (‘installed’,’available’,’updates’,’obsoletes’,’recent’,’extras’)
Returns:list of pkg_id’s
Return type:array of strings (as)
GetPackageWithAttributes(pkg_filter, fields)
Get a list of pkg list for a given package filter
each pkg list contains [pkg_id, field,....] where field is a atrribute of the package object
Ex. summary, size etc.
Parameters:
  • pkg_filter (string) – package filter (‘installed’,’available’,’updates’,’obsoletes’,’recent’,’extras’)
  • fields (array of strings (as)) – yum package objects attributes to get.
Returns:

list of (id, field1, field2...) (JSON), each JSON Sting contains (id, field1, field2...)

Return type:

array of strings (as)

GetPackagesByName(name, newest_only)

Get a list of pkg ids for starts with name

Parameters:
  • name (string) – name prefix to match
  • newest_only (boolean) – show only the newest match or every match.
Returns:

list of pkg_id’s

Return type:

array of strings (as)

GetAttribute(id, attr)

get yum package attribute (description, filelist, changelog etc)

Parameters:
  • pkg_id (string) – pkg_id to get attribute from
  • attr (string) – name of attribute to get
Returns:

the value of the attribute (JSON), the content depend on attribute being read

Return type:

string (s)

GetUpdateInfo(id)

Get Updateinfo for a package

Parameters:pkg_id (string) – pkg_id to get update info from
Returns:update info for the package (JSON)
Return type:string (s)
Search(fields, keys, match_all, newest_only, tags)

Search for packages where keys is matched in fields

Parameters:
  • fields (array of strings) – yum po attributes to search in
  • keys (array of strings) – keys to search for
  • match_all (boolean) – match all keys or only one
  • newest_only (boolean) – match all keys or only one
  • tags (boolean) – search in pkgtags
Returns:

list of pkg_id’s for matches

Return type:

array of stings (as)

Groups

Methods to work with yum groups and categories

GetGroups()

Get available Categories & Groups

GetGroupPackages(grp_id, grp_flt)

Get packages in a group by grp_id and grp_flt

Parameters:
  • grp_id (string (s)) – The Group id
  • grp_flt (string (s)) – Group Filter (all or default)
Returns:

list of pkg_id’s

Return type:

array of strings (as)

Note

Under Development

More to come in the future, methods to install groups etc. has to be defined and implemented

Signals

UpdateProgress(self,name,frac,fread,ftime):

Signal with download progress information

Parameters:
  • name – filename
  • frac – Progress fracment (0 -> 1)
  • fread – formated string containing BytesRead

:param ftime : formated string containing remaining or elapsed time