Bug 1060743

Summary: [Sprint 43] Please document subaccount creation via REST
Product: OpenShift Online Reporter: Oleg Fayans <ofayans>
Component: DocumentationAssignee: Bilhar <baulakh>
Status: CLOSED CURRENTRELEASE QA Contact: ecs-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.xCC: alyoung, amarecek, jokerman, mmccomas, rpenta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-24 21:34:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Oleg Fayans 2014-02-03 13:48:54 UTC
Description of problem:
subj. 
There is a way to create a subaccount/subdomain via REST API, but this functionality is not documented at all

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ravi Sankar 2014-03-25 23:45:31 UTC
Same as regular user creation but need to specify header 'X-Impersonate-User'

curl -k https://openshift.redhat.com/broker/rest/user -d 
--user <parent>:<password> -H "X-Impersonate-User: <child>"

This will create user <child> (subaccount of <parent>), only works if <parent> has subaccounts capability enabled.

Comment 3 Ravi Sankar 2014-04-02 18:54:10 UTC
Ah, user creation depends on the openshift authentication plugin. Only on development environment, GET call on /user will create a regular user.
curl -k -X GET https://openshift.redhat.com/broker/rest/user --user "[UserName]:[Password]"

So we should not document user creation REST api, it depends on the auth plugins (some will use command line utilities or plugin specific apis).In comment#1, I should have said "Same as view user information[1] but need to specify header 'X-Impersonate-User'.

curl -k -X GET https://openshift.redhat.com/broker/rest/user --user "[ParentUserName]:[Password]" -H "X-Impersonate-User: [ChildUserName]"

This creates sub-account "ChildUserName" for user "ParentUserName" when the user has subaccounts capability enabled.

[1] https://access.redhat.com/site/documentation/en-US/OpenShift/2.0/html-single/REST_API_Guide/index.html#sect-API_Guide-User_Information-View_User_Information