Ask Your Question
0

What is the best way (with fewest API calls) to get all projects a user is a member of in Horizon project?

asked 2014-02-13 17:46:27 -0500

vahidhashemian gravatar image

I have a user id and want to get a list of all projects this user is currently a member of. I can't find a single API call that gives me that. So I was wondering if I'm missing it, and if not, how I can get the list in the most efficient way. Thanks.

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2014-02-13 18:01:16 -0500

vahidhashemian gravatar image

Forgot to mention I needed this for V2.

edit flag offensive delete link more
0

answered 2014-02-13 21:10:37 -0500

lin-hua-cheng gravatar image

Unfortunately, it cannot be done in a single call.

If you have the user credentials, you can use its token and just make a single call to /tenants. The returns you the list of project associated with the user token.

If you have the admin token, and only have the user_id: 1. Get all the projects: /tenants 2. Iterate through each project and see if the user has any role in it: /tenants/<project_id>/users/<user_id>/roles

edit flag offensive delete link more
0

answered 2014-02-13 21:17:37 -0500

vahidhashemian gravatar image

Thanks Lin Hua Cheng, that solved my question.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-02-13 17:46:27 -0500

Seen: 112 times

Last updated: Feb 13 '14