Updated on 2024-01-31 GMT+08:00

Querying the Account List

Function

This API is used to query the account list. The number of servers can be queried based on the account name parameter.

Calling Method

For details, see Calling APIs.

URI

GET /v5/{project_id}/asset/user/statistics

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Minimum: 1

Maximum: 256

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

user_name

No

String

Account name. It must comply with the Windows file naming rules. The value can contain letters, digits, underscores (_), and the following special characters: !@.-. Chinese punctuations are not allowed.

Minimum: 1

Maximum: 128

enterprise_project_id

No

String

Enterprise project

Minimum: 0

Maximum: 128

limit

No

Integer

Default value: 10

Minimum: 10

Maximum: 200

Default: 10

offset

No

Integer

Default value: 0

Minimum: 0

Maximum: 2000000

Default: 0

category

No

String

Type. The default value is host. The options are as follows:

  • host

  • container

Minimum: 0

Maximum: 64

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

x-auth-token

Yes

String

iam token

Minimum: 32

Maximum: 4096

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_num

Integer

Container ID

Minimum: 0

Maximum: 10000

data_list

Array of UserStatisticInfoResponseInfo objects

Instance name of enterprise edition image

Array Length: 0 - 10000

Table 5 UserStatisticInfoResponseInfo

Parameter

Type

Description

user_name

String

Instance URL of enterprise edition image

Minimum: 1

Maximum: 128

num

Integer

Asset importance. The options are as follows:

  • important

  • common

  • test

Minimum: 0

Maximum: 10000

Example Requests

The first 10 accounts are queried by default.

GET https://{endpoint}/v5/{project_id}/asset/user/statistics

Example Responses

Status code: 200

Number of servers having the account

{
  "total_num" : 1,
  "data_list" : [ {
    "user_name" : "bin",
    "num" : 5
  } ]
}

Status Codes

Status Code

Description

200

Number of servers having the account

Error Codes

See Error Codes.