Updated on 2023-10-24 GMT+08:00

Querying Enterprise Projects

Function

This API is used to query the enterprise projects.

Constraints

This API can be used only in certain regions. For details, see Endpoints.

URI

GET /v5/{project_id}/enterprise-projects

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Offset, which is the position where the query starts. The value must be greater than or equal to 0. The default value is 0.

Default value: 0

limit

No

Integer

Number of items displayed per page. The default value is 1000. The value ranges from 1 to 1000.

Minimum value: 1

Maximum value: 1000

Default value: 1000

name

No

String

Specifies the enterprise project name. Fuzzy search is supported.

domain_id

No

String

ID of the account to which the IAM user belongs. This parameter is mandatory for the op_service permission and optional for non-op_service permissions.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

MIME type of the request body. Use the default value application/json. For APIs used to upload objects or images, the value varies depending on the flow type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

It is a response to the API for obtaining a user token. This API is the only one that does not require authentication.

After a request is processed, the value of X-Subject-Token in the header is the token value.

X-Language

No

String

Request language type.

Default value: en-us

Enumerated values:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

count

Integer

Total number.

enterprise_project_list

Array of objects

Enterprise projects.

For details, see Table 5.

Table 5 Data structure description of field enterprise_project_list

Parameter

Type

Description

id

String

Enterprise project ID.

name

String

Enterprise project name.

description

String

Description.

status

String

Enterprise project status.

created_at

String

Specifies the creation time, for example, 2023-01-20T07:18:26Z.

updated_at

String

Specifies the update time, for example, 2023-03-01T09:42:02Z.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum length: 12

Maximum length: 12

error_msg

String

Error message.

Minimum length: 1

Maximum length: 512

Example Request

Querying the enterprise projects

https://{endpoint}/v5/{project_id}/enterprise-projects

Example Response

Status code: 200

OK
{
  "count": 113,
  "enterprise_project_list": [
    {
      "id": "0",
      "name": "default",
      "status": "1"
    },
    {
      "id": "2d8315f3-f25f-4481-a867-b7ef05a4b9c2",
      "name": "eps_test_new_name",
      "status": "1",
      "created_at": "2023-01-20T07:18:26Z",
      "updated_at": "2023-01-20T15:32:29Z"
    },
    {
      "id": "81b344c4-5644-485b-8ea7-398f3b8013cf",
      "name": "(!@$%^-_=+[{}]:,./?~#*;|)",
      "status": "1",
      "created_at": "2022-09-27T02:41:22Z",
      "updated_at": "2023-03-01T09:42:02Z"
    },
    {
      "id": "59add094-0be7-49d0-a3ee-22de62f7eb4c",
      "name": "DDS-test01_01",
      "status": "1",
      "created_at": "2022-02-25T08:04:44Z",
      "updated_at": "2022-07-13T03:45:24Z"
    },
    {
      "id": "6e2795dd-6fd1-4413-9038-cf1c1acc0940",
      "name": "gaussdb_test02",
      "description": "gaussdb_test02",
      "status": "1",
      "created_at": "2022-02-25T07:39:05Z",
      "updated_at": "2022-02-25T07:39:05Z"
    }
  ]
}

Status code: 422

Bad Request

{
  "error_code": "DRS.M00277",
  "error_msg": "The task name already exists."
}

Error Code

For details, see Error Code.