juju / theblues

Python library for the juju charmstore (v4)
GNU Lesser General Public License v3.0
5 stars 22 forks source link

Add wallets and budgets #57

Closed makyo closed 6 years ago

jujugui commented 6 years ago

Refer to this link for build results (access rights to CI server needed): http://ci-gce.jujugui.org:8080//job/theblues-lib/198/

jujugui commented 6 years ago

Refer to this link for build results (access rights to CI server needed): http://ci-gce.jujugui.org:8080//job/theblues-lib/199/

jujugui commented 6 years ago

Refer to this link for build results (access rights to CI server needed): http://ci-gce.jujugui.org:8080//job/theblues-lib/200/

jcsackett commented 6 years ago

Approval contingent on tests being sorted out, of course. :P

makyo commented 6 years ago

QA

Feel free to follow along, but here's a (sanitized) output:

>>> from theblues.plans import Plans                                                                                                                                                                              
>>> p = Plans('https://api.jujucharms.com/omnibus/')                                                       
>>> p.list_wallets()                                                                                    
{u'wallets': (Wallet(owner=u'makyo', wallet=u'default', limit=u'100', budgeted=u'0', unallocated=u'100', available=u'100.00', consumed=u'0.00', default=True), Wallet(owner=u'makyo', wallet=u'test2', limit=u'10', budgeted=u'0', unallocated=u'10', available=u'10.00', consumed=u'0.00', default=False)), u'total': WalletTotal(limit=u'110', budgeted=u'0', unallocated=u'110', available=u'110.00', consumed=u'0.00', usage=u'0
%'), u'credit': u'10000'}                           
>>> p.get_wallet('default')                                                                              
Opening an authorization web page in your browser.                                                                                                                                                                 
{u'total': WalletTotal(limit=u'100', budgeted=u'0', unallocated=u'100', available=u'0.00', consumed=u'0.00', usage=u'0%'), u'limit': u'100', u'budgets': None}  
>>> p.update_wallet('test2', '15')
u'wallet limit updated to 15'
>>> p.create_wallet('test1', '10')
u'wallet created'
>>> p.list_wallets()
{u'wallets': (Wallet(owner=u'makyo', wallet=u'default', limit=u'100', budgeted=u'0', unallocated=u'100', available=u'100.00', consumed=u'0.00', default=True), Wallet(owner=u'makyo', wallet=u'test1', limit=u'10'
, budgeted=u'0', unallocated=u'10', available=u'10.00', consumed=u'0.00', default=False), Wallet(owner=u'makyo', wallet=u'test2', limit=u'15', budgeted=u'0', unallocated=u'15', available=u'15.00', consumed=u'0.
00', default=False)), u'total': WalletTotal(limit=u'125', budgeted=u'0', unallocated=u'125', available=u'125.00', consumed=u'0.00', usage=u'0%'), u'credit': u'10000'}
>>> p.create_budget('test1', 'b4bbf769-a40d-44b3-80d5-824ee9c4b34d', '10')
u'budget saved'                 
>>> p.update_budget('test1', 'b4bbf769-a40d-44b3-80d5-824ee9c4b34d', '5')
u'budget moved to wallet "test1", budget limit updated to 5'
>>> p.delete_budget('b4bbf769-a40d-44b3-80d5-824ee9c4b34d')
u'budget removed'
>>> p.delete_wallet('test2')                                                       
u'wallet test2 removed'   
jujugui commented 6 years ago

Refer to this link for build results (access rights to CI server needed): http://ci-gce.jujugui.org:8080//job/theblues-lib/201/

jujugui commented 6 years ago

Refer to this link for build results (access rights to CI server needed): http://ci-gce.jujugui.org:8080//job/theblues-lib/202/

jujugui commented 6 years ago

Refer to this link for build results (access rights to CI server needed): http://ci-gce.jujugui.org:8080//job/theblues-lib/203/

jujugui commented 6 years ago

Refer to this link for build results (access rights to CI server needed): http://ci-gce.jujugui.org:8080//job/theblues-lib/204/

makyo commented 6 years ago

:shipit:

jujugui commented 6 years ago

Status: merge request accepted. Url: http://ci-gce.jujugui.org:8080/job/theblues-lib-merge