Updated on 2023-07-05 GMT+08:00

Querying Project Information

Function

This API is used to query project information.

The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.

URI

GET /v3/projects

Table 1 Query parameters

Parameter

Mandatory

Type

Description

domain_id

No

String

Account ID of the target project. For details about how to obtain the account ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

enabled

No

Boolean

Enabling status of the project.

is_domain

No

Boolean

Leave this field blank.

name

No

String

Project name. For details about how to obtain the project name, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

page

No

Integer

Page number for pagination query. The minimum value is 1. This parameter must be used together with per_page.

parent_id

No

String

Specify the ID of a subproject.

Alternatively, specify the account ID of a system project, for example, the ap-southeast-1 project.

For details about how to obtain the project ID and account ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

per_page

No

Integer

Number of data records to be displayed on each page. The value ranges from 1 to 5000. This parameter must be used together with page.

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Fill application/json;charset=utf8 in this field.

X-Auth-Token

Yes

String

Access token issued to a user to bear its identity and permissions.

For details about the permissions required by the token, see Actions.

Response Parameters

Table 3 Parameters in the response body

Parameter

Type

Description

links

Object

Resource link information.

projects

Array of objects

Project information.

Table 5 projects

Parameter

Type

Description

is_domain

Boolean

The value is false.

description

String

Description of the project.

links

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.

name

String

Project name. For example, ap-southeast-1 and MOS. MOS is a built-in project of OBS.

Example Request

Request for querying project information

GET https://iam.myhuaweicloud.com/v3/projects

Example Response

Status code: 200

The request is successful.

{
    "projects": [
        {
            "domain_id": "d78cbac186b744899480f25bd02...",
            "is_domain": false,
            "parent_id": "d78cbac186b744899480f25bd022...",
            "name": "ap-southeast-1",
            "description": "",
            "links": {
                "next": null,
                "previous": null,
                "self": "https://iam.myhuaweicloud.com/v3/projects/06f1c15e6f0010672f86c003006c5f17"
            },
            "id": "06f1c15e6f0010672f86c00300...",
            "enabled": true
        },
        {
            "domain_id": "d78cbac186b744899480f25bd...",
            "is_domain": false,
            "parent_id": "d78cbac186b744899480f25bd0...",
            "name": "",
            "description": "",
            "links": {
                "next": null,
                "previous": null,
                "self": "https://iam.myhuaweicloud.com/v3/projects/065a7c66da0010992ff7c0031e5a..."
            },
            "id": "065a7c66da0010992ff7c0031e5a...",
            "enabled": true
        }
    ],
    "links": {
        "next": null,
        "previous": null,
        "self": "https://iam.myhuaweicloud.com/v3/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.

500

Internal server error.

503

Service unavailable.

Error Codes

None