Re: How can I get a guid of an user from a CF plugin?


Koper, Dies <diesk@...>
 

If you're an admin, GET /Users on the UAA endpoint. See https://docs.cloudfoundry.org/api/uaa/#list62.

If you're an Org Manager, GET /v2/organizations/:guid/user_roles on the CC API endpoint, where :guid is the guid of an org the user is member of.
See http://apidocs.cloudfoundry.org/207/organizations/retrieving_the_roles_of_all_users_in_the_organization.html.

If you're a Space Manager, GET /v2/spaces/:guid/user_roles on the CC API endpoint, where :guid is the guid of a space the user is member of.
See http://apidocs.cloudfoundry.org/249/spaces/retrieving_the_roles_of_all_users_in_the_space.html.

You can use `cf curl` to query the CC API endpoint and `cf org YOURORG --guid` and `cf space YOURSPACE --guid` to retrieve the guids to pass in.

Regards,
Dies Koper
Cloud Foundry Product Manager - CLI

-----Original Message-----
From: Suren R [mailto:suren.devices(a)gmail.com]
Sent: Tuesday, January 03, 2017 12:27 AM
To: cf-dev(a)lists.cloudfoundry.org
Subject: [cf-dev] How can I get a guid of an user from a CF plugin?

Is there a function or cli commond which will give the guid of a given username? Even CF API call will also do.
Thanks.

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.