Changes between Version 28 and Version 29 of YumDBusAPI

Show
Ignore:
Author:
timlau (IP: 87.48.49.219)
Timestamp:
05/30/12 09:54:48 (6 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • YumDBusAPI

    v28 v29  
    6060 
    6161= Examples = 
    62 Here are some examples for consumer application: 
    63  
    64  * [https://github.com/timlau/yum-daemon/examples/c/dbus-yum-test.c C] 
    65  * [https://github.com/timlau/yum-daemon/examples/vala/yum-api-test.vala Vala] 
    66  * [https://github.com/timlau/yum-daemon/yum-daemon/examples/python/async-calls.py Python (asynchronous usage)] 
     62Examples is located [http://timlau.fedorapeople.org/yumdaemon/examples.html here] 
    6763 
    6864= References = 
    7268= API Definitions: (Work in Progress) = 
    7369 
    74  
    75 == Data == 
    76  
    77 <Package Id> = "name,epoch,version,release,arch,repoid" (Comma separated string)[[BR]] 
    78 <Transaction Id> = "name,epoch,version,release,arch,repoid,ts_state" (Comma separated string) 
    79                  
    80 == Locking == 
    81  
    82 === Lock() (DONE) === 
    83 start a new yum instance and set the yum lock 
    84  
    85 === Unlock() (DONE) === 
    86 release the yum lock and delete the current yum instance 
    87  
    88 ---- 
    89 == Config == 
    90 === !GetConfig(option) (DONE) === 
    91 return value from config 
    92  
    93 === !SetConfig(option, value, persistant) === 
    94 set config option=value (for current session or persistant) 
    95  
    96      
    97 ---- 
    98 === Repository === 
    99  
    100 === !EnableRepo(repo_id, persistant) === 
    101  
    102 Enable repo 
    103  
    104 === !DisableRepo(repo_id, persistant) === 
    105  
    106 Disable repo 
    107  
    108 === !GetRepositories(filer) (DONE)  === 
    109  
    110 get list with repos [[BR]] 
    111 filter = "" return enabled repositories[[BR]] 
    112 filter = "<some pattern>" will return repo matching <some pattern>[[BR]] 
    113 Ex. filter = "*" will return all repos., filter = "*-source" will return source repos 
    114  
    115 === !GetRepo(repo_id) (DONE) === 
    116  
    117 return information about a repo 
    118 the information is returned as a dictinary in JSON format 
    119  
    120 === !SetRepo(repo_id, repo_info) === 
    121  
    122 change repo info or create new one is not exists[[BR]] 
    123 repo_info = {'name' : values,.......} 
    124  
    125 ---- 
    126 == Packages == 
    127  
    128 === !GetPackages(pkg_narrow) (DONE) === 
    129  
    130 Return list of package ids[[BR]] 
    131 pkg_narrow = installed|available|updates|obsoletes|..... 
    132          
    133 === !GetPackages_by_name(pattern, newest_only) (DONE) === 
    134  
    135 get a list of package ids where name matches pattern[[BR]] 
    136 pattern ::= <pattern string> (ex. 'yum', 'yum*')[[BR]] 
    137  
    138  
    139 === !GetAttribute(pkg_id, attribute) (DONE) === 
    140  
    141 return an attribute value from at give pkg_id.[[BR]] 
    142 attribute = <Yum Package attribute Name> (Ex. 'summanry', 'description')[[BR]] 
    143 it return a string there contains a python repr of the attribute[[BR]] 
    144 ':none' will be returned if attribute dont exist.[[BR]] 
    145 ':not-found' will be returned if no package matching pkg_id is found[[BR]] 
    146  
    147 === !GetUpdateInfo(pkg_id) === 
    148 Get updateinfo about a given pkg_id 
    149  
    150  
    151 ---- 
    152 === Groups === 
    153 Methods to handle yum groups/categories 
    154  
    155 '''<Do be definded>''' 
    156  
    157 ---- 
    158 == Search: == 
    159  
    160 === Search(fields, keys, match_all) (DONE) === 
    161  
    162 return a list of package ids for matching packages[[BR]] 
    163 fields = a list of package attributes to search in (Name, summary, description etc)[[BR]] 
    164 keys = a list of key words to search for.[[BR]] 
    165 match_all = define if all keys should match or partial match is allowed (boolean)[[BR]] 
    166  
    167  
    168 ---- 
    169 == History == 
    170  
    171 === !GetHistory(elements) === 
    172  
    173 return a list with a number of history ids (integers) 
    174  
    175 elements = the number of elements to return 
    176  
    177 === !GetHistoryInfo(id) === 
    178  
    179 return a dict with details about a give history id 
    180  
    181  
    182 === !RedoHistory(id) === 
    183  
    184 redo a given history id 
    185  
    186  
    187 === !UndoHistory(id) === 
    188  
    189 undo given history id 
    190  
    191 ---- 
    192 == Transaction == 
    193  
    194 === !AddTransaction(pkg_id, action) (DONE) === 
    195  
    196 Add a package to the current transaction for an given action[[BR]] 
    197 action = install|update|remove|reinstall|downgrade|localinstall[[BR]] 
    198 localinstall takes a path to a .rpm file as pkg_id[[BR]] 
    199 return a list of transaction ids for the packages added to the transaction[[BR]] 
    200  
    201 === !BuildTransaction() (DONE) === 
    202  
    203 resolve the dependencies of the current transaction.[[BR]] 
    204 return a (return code, output) pair[[BR]] 
    205 return code = 2 is transaction was resolved without problems[[BR]] 
    206 if no problems output will contains a repr of a list containing tuples of (action, package info list)[[BR]] 
    207 if problmes output will contain a list of desolve problem messages.[[BR]] 
    208  
    209  
    210 === !RunTransaction() (DONE) === 
    211  
    212 will run the current transaction (Download, signature check, test transaction, transaction) 
    213  
    214 === !ClearTransaction() (DONE) === 
    215  
    216 will clear the current transaction 
    217  
    218 === !GetTransaction() (DONE) === 
    219  
    220 will return the member of the current transaction  
    221  
    222 ---- 
    223 == high-level Methods == 
    224 Simple method to emulate yum cli actions[[BR]] 
    225 there methods will find packages matching the argument and add them to the transaction[[BR]] 
    226 and return the transaction result for confirmation.[[BR]] 
    227 The transaction can then be executed by calling !RunTransaction() 
    228  
    229 === Install(args) (DONE) === 
    230 Do the same as "yum install args" 
    231  
    232 === Remove(args) (DONE) === 
    233 Do the same as "yum remove args" 
    234  
    235 === Update(args) (DONE)  === 
    236 Do the same as "yum update args" 
    237  
    238 === Reinstall(args)  (DONE) === 
    239 Do the same as "yum reinstall args" 
    240  
    241 === Downgrade(args)  (DONE) === 
    242 Do the same as "yum downgrade args" 
    243  
    244 ---- 
    245 == Signals: (D-Bus signals sendt by yum's callback handlers) == 
    246  
    247 === !UpdateProgress(self,name,frac,fread,ftime) (DONE) === 
    248 This signal will be sent a evey progress callback when something is being downloaded (metadata, packages etc) 
    249  
    250 name: filename[[BR]] 
    251 frac: Progress fracment (0 -> 1)[[BR]] 
    252 fread: formated string containing !BytesRead[[BR]] 
    253 ftime : formated string containing remaining or elapsed time[[BR]] 
    254  
    255 === !TransactionEvent(self,event) (DONE) === 
    256 This signal will be in differnet part of the transaction flow 
    257  
    258 event: an action keyword of where we are in the transaction process.[[BR]] 
    259 'start-build'          : when starting to depsolve[[BR]] 
    260 'end-build'            : when depsolve is completed[[BR]] 
    261 'start-run'            : when starting to execute the current transaction[[BR]] 
    262 'end-run'              : when current transaction is ended without error[[BR]] 
    263 'fail'                 : when current transaction is ended with errors[[BR]] 
    264 'download'             : when package downloading is started[[BR]] 
    265 'signature-check'      : when package signature check is started[[BR]] 
    266 'run-test-transaction' : when rpm test transaction starts[[BR]] 
    267 'run-transaction'      : when rpm transaction starts[[BR]] 
    268  
    269  
    270 === RPMProgress(pkg_id, action, te_current, te_total, ts_current, ts_total) (DONE) === 
    271 package: A package id or simple string of a package name[[BR]] 
    272 action: the action being performed ( install,cleanup .....)[[BR]] 
    273 te_current: Current number of bytes processed in the transaction element being processed[[BR]] 
    274 te_total: Total number of bytes in the transaction element being processed[[BR]] 
    275 ts_current: number of processes completed in whole transaction[[BR]] 
    276 ts_total: total number of processes in the transaction.[[BR]] 
    277  
    278 === Progress(action, percent) === 
    279 action = action being performed[[BR]] 
    280 percent = the progress of the whole transaction in percent 
    281  
    282 = Test Cases = 
    283  
    284 Make unit test for the current implemented API (DONE) 
     70All Documentation is located [http://timlau.fedorapeople.org/yumdaemon/index.html here] 
    28571 
    28672= Comments = 
     73 * timlau: 30-05-2012 - API Doc & Examples is replaced by links to [http://timlau.fedorapeople.org/yumdaemon/index.html external site] containing sphinx generated doc.  
    28774 * timlau: Change method names to !CamelCase to follow the [http://dbus.freedesktop.org/doc/dbus-specification.html#naming-conventions D-Bus naming convention] 
     75