Updated on 2024-09-11 GMT+08:00

Querying Enterprise Projects

Function

This API is used to query enterprise projects. Before calling this API:

URI

GET /v3/{project_id}/enterprise-projects

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value cannot be a negative number.

limit

No

Integer

Number of records to be queried. The default value is 100. The value must be a positive integer. The minimum value is 1 and the maximum value is 100.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token.

The value of X-Subject-Token in the response header is the token value.

X-Language

No

String

Request language type. The default value is en-us.

Values:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

enterprise_projects

Array of EnterpriseProjectItem objects

Enterprise project information.

total_count

Integer

Total number of enterprise projects.

Table 5 EnterpriseProjectItem

Parameter

Type

Description

id

String

Enterprise project ID.

name

String

Enterprise project name.

description

String

Description.

status

String

Status.

  • 1: normal
  • 0: abnormal

created

String

Creation time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.

updated

String

Update time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Querying Enterprise Projects

GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/enterprise-projects

Example Response

Status code: 200

Success.

{
  "total_count" : 4,
  "enterprise_projects" : [ {
    "id" : 0,
    "name" : "default",
    "description" : null,
    "status" : 1,
    "created" : null,
    "updated" : null
  }, {
    "id" : "5c7d11e0-3201-4558-bcce-1172137cf7e2",
    "name" : "sjw-eps",
    "description" : null,
    "status" : 1,
    "created" : "2023-06-12T02:14:28+0000",
    "updated" : "2023-06-12T02:14:28+0000"
  }, {
    "id" : "12093327-28dc-46c5-8ba6-d42c9236f9d6",
    "name" : "adf",
    "description" : null,
    "status" : 1,
    "created" : "2023-05-06T08:33:03+0000",
    "updated" : "2023-05-06T08:33:03+0000"
  }, {
    "id" : "07d90b3f-422b-40c9-b9b3-6d00d1d7a60b",
    "name" : "eps-test",
    "description" : null,
    "status" : 1,
    "created" : "2023-03-16T01:38:13+0000",
    "updated" : "2023-03-16T01:38:13+0000"
  } ]
}

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.