Listing Projects
Function
This API can be used by the administrator to list the projects accessible to a specified IAM user or used by an IAM user to list accessible projects.
The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.
URI
GET /v3/users/{user_id}/projects
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| user_id | Yes | String | IAM user ID. For details about how to obtain a user ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Fill application/json;charset=utf8 in this field. |
| X-Auth-Token | Yes | String | A token with Security Administrator permissions is required if the administrator is requesting to list the projects of a specified IAM user. If an IAM user is requesting to list accessible projects, the user token (no special permission requirements) of the user is required. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| Object | Resource link information. | |
| Array of objects | Project information. |
| Parameter | Type | Description |
|---|---|---|
| self | String | Resource link. |
| previous | String | Previous resource link. |
| next | String | Next resource link. |
| 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 cn-north-4 project. |
| domain_id | String | Account ID of the project. |
| name | String | Project name. |
Example Request
GET https://iam.myhuaweicloud.com/v3/users/{user_id}/projects Example Response
Status code: 200
The request is successful.
{
"projects": [
{
"domain_id": "d78cbac186b744899480f25bd02...",
"is_domain": false,
"parent_id": "d78cbac186b744899480f25bd0...",
"name": "cn-southwest-2",
"description": "",
"links": {
"next": null,
"previous": null,
"self": "https://iam.huaweicloud.com/v3/projects/06f1cd8ea9800ff02f26c003d93..."
},
"id": "06f1cd8ea9800ff02f26c003d93...",
"enabled": true
},
{
"domain_id": "d78cbac186b744899480f25bd02...",
"is_domain": false,
"parent_id": "d78cbac186b744899480f25bd0...",
"name": "MOS",
"description": "",
"links": {
"next": null,
"previous": null,
"self": "https://iam.huaweicloud.com/v3/projects/babf0605d15b4f9fbcacc6a8ee0f8d84"
},
"id": "babf0605d15b4f9fbcacc6a8ee0f8d84",
"enabled": true
}
],
"links": {
"next": null,
"previous": null,
"self": "https://iam.huaweicloud.com/v3/users/7116d09f88fa41908676fdd4b039e95b/projects"
}
} 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
Last Article: Querying Project Information
Next Article: Listing Projects Accessible to an IAM User
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.