Listing Projects Accessible to an IAM User
Function
This API is used to list the projects in which resources are accessible to a specified IAM user.
The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.
Debugging
You can debug this API in API Explorer.
URI
GET /v3/auth/projects
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
Fill application/json;charset=utf8 in this field. |
X-Auth-Token |
Yes |
String |
IAM user token (no special permission requirements) |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
Object |
Resource link information. |
|
Array of objects |
Project information. |
Parameter |
Type |
Description |
---|---|---|
is_domain |
Boolean |
The value is false. |
description |
String |
Description of the project. |
Object |
Project resource link. |
|
enabled |
Boolean |
Enabling status of the project. |
id |
String |
Project ID. |
parent_id |
String |
ID of the specified subproject or account ID of a specified system project, for example, the ap-southeast-1 project. |
domain_id |
String |
Account ID of the project. |
name |
String |
Project name. |
Example Request
Request for querying the projects accessible to a specified IAM user
GET https://iam.myhuaweicloud.com/v3/auth/projects
Example Response
Status code: 200
The request is successful.
{ "projects": [ { "domain_id": "d78cbac186b744899480f25bd02...", "is_domain": false, "parent_id": "d78cbac186b744899480f25bd022...", "name": "af-south-1", "description": "", "links": { "self": "https://iam.myhuaweicloud.com/v3/projects/06f1cbbaf280106b2f14c00313a9d065" }, "id": "06f1cbbaf280106b2f14c00313a9...", "enabled": true }, { "domain_id": "d78cbac186b744899480f25bd02...", "is_domain": false, "parent_id": "d78cbac186b744899480f25bd022...", "name": "", "description": "", "links": { "self": "https://iam.myhuaweicloud.com/v3/projects/065a7c66da0010992ff7c0031e5a5e7d" }, "id": "065a7c66da0010992ff7c0031e5a5e7d", "enabled": true } ], "links": { "self": "https://iam.myhuaweicloud.com/v3/auth/projects" } }
- When project-level services are authorized, the authorized projects are returned.
- If all resources are authorized, all projects of the user are returned.
- If a global service is authorized or no service is authorized, no project is returned.
Status Codes
Status Code |
Description |
---|---|
200 |
The request is successful. |
400 |
Invalid parameters. |
401 |
Authentication failed. |
403 |
Access denied. |
404 |
The requested resource cannot be found. |
405 |
The method specified in the request is not allowed for the requested resource. |
413 |
The request entity is too large. |
500 |
Internal server error. |
503 |
Service unavailable. |
Error Codes
None
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot