Bug 1221786 - [RFE] Provide a way for users to set a usage_account_id in the database
Summary: [RFE] Provide a way for users to set a usage_account_id in the database
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-14 20:45 UTC by Eric Rich
Modified: 2019-08-15 04:35 UTC (History)
12 users (show)

Fixed In Version: openshift-origin-broker-util-1.35.2.3-1
Doc Type: Enhancement
Doc Text:
When implementing a custom billing provider, the usage_account_id field must be set for tracked users. Previously, there was no tool to set the usage_account_id field, and the database had to be modified manually to set this field. With this enhancement, administrators can now use the oo-admin-ctl-user command with the --setusageaccountid option to set the usage_account_id field for users without direct modifications to the database.
Clone Of:
Environment:
Last Closed: 2015-07-21 19:12:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1463 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.6 bug fix and enhancement update 2015-07-21 23:11:33 UTC

Description Eric Rich 2015-05-14 20:45:14 UTC
Description of problem:

In order to create a custom billing provider you need to manually modify the database because of https://github.com/openshift/origin-server/blob/master/broker-util/oo-admin-ctl-usage#L155-L175 checks for the account number. 

Version-Release number of selected component (if applicable): 2.2 

How reproducible: 100% 

Steps to Reproduce:
1. Follow https://mojo.redhat.com/docs/DOC-1012698

Suggested Action: 

Allow for oo-admin-ctl-user to set a usage_account_id

    # oo-admin-ctl-user -l admin --setplanquantity 1 --setplan free \
       --setusage_account_id 12345

Comment 2 Brenton Leanhardt 2015-05-15 18:26:07 UTC
Upstream PR: https://github.com/openshift/origin-server/pull/6141

Comment 3 openshift-github-bot 2015-05-16 00:07:01 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d723c169a6eefb54546b9d27d804ea463f9a72fb
Bug 1221786 - Provide a way for users to set a usage_account_id

Comment 6 Ma xiaoqiang 2015-05-19 06:41:27 UTC
Check on puddle [2.2.6/2015-05-18.1]

1. list the user info
# oo-admin-ctl-user -l xiaom                     
User xiaom1:
                            plan: 
                usage account id: 
<--snip-->

2. set the usage account id 
# oo-admin-ctl-user -l xiaom --setusageaccountid 1234


Setting usage account id 1234 for user xiaom... Done.

User xiaom:
                            plan: 
                usage account id: 1234

3. check the value in the database
# mongo -u openshift -p mongopass openshift_broker   
MongoDB shell version: 2.4.6
connecting to: openshift_broker
> db.cloud_users.findOne()
<--snip-->
        "usage_account_id" : "1234"
}

Comment 9 errata-xmlrpc 2015-07-21 19:12:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1463.html


Note You need to log in before you can comment on or make changes to this bug.