Querying the Server List of an Account
Function
This API is used to query the server list of an account.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
GET /v5/{project_id}/asset/users
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID, which is used to specify the project that an asset belongs to. After the project ID is configured, you can query assets in the project using the project ID. For details about how to obtain it, see Obtaining a Project ID. Constraints N/A Range The value can contain 1 to 256 characters. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| host_id | No | String | Definition Unique ID of a server. Constraints N/A Range The value can contain 1 to 64 characters. Default Value N/A |
| user_name | No | String | Definition Account name. Constraints N/A Range The value can contain 0 to 32 characters. Default Value N/A |
| host_name | No | String | Definition Server name. Constraints N/A Range The value contains 1 to 256 characters. Default Value N/A |
| private_ip | No | String | Definition Server private IP address. Constraints N/A Range The value can contain 1 to 128 characters. Default Value N/A |
| login_permission | No | Boolean | Definition Whether login is allowed. Constraints N/A Range Default Value N/A |
| root_permission | No | Boolean | Definition Whether the user has root permissions. Constraints N/A Range Default Value N/A |
| user_group | No | String | Definition Whether a group is a server user group. Constraints N/A Range Default Value N/A |
| enterprise_project_id | No | String | Definition Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID. To query assets in all enterprise projects, set this parameter to all_granted_eps. Constraints You need to set this parameter only after the enterprise project function is enabled. Range The value can contain 1 to 256 characters. Default Value 0: default enterprise project. |
| limit | No | Integer | Definition Number of records displayed on each page. Constraints N/A Range Value range: 10-200 Default Value 10 |
| offset | No | Integer | Definition Offset, which specifies the start position of the record to be returned. Constraints N/A Range The value range is 0 to 2,000,000. Default Value The default value is 0. |
| category | No | String | Definition Type. Constraints N/A Range Default Value N/A |
| part_match | No | Boolean | Definition Whether fuzzy match is used. Constraints N/A Range Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token. Constraints N/A Range The value can contain 1 to 32,768 characters. Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total_num | Integer | Definition Total number. Range The value range is 0 to 2,147,483,647. |
| data_list | Array of UserResponseInfo objects | Definition Account information list. Range The value range is 0 to 10,000. |
| Parameter | Type | Description |
|---|---|---|
| agent_id | String | Definition Agent ID Range The value can contain 1 to 64 characters. |
| host_id | String | Definition Unique ID of a server (host). Range The value can contain 1 to 64 characters. |
| host_name | String | Definition Server name. Range The value can contain 1 to 256 characters. |
| host_ip | String | Definition Server IP Address Range The value can contain 1 to 128 characters. |
| user_name | String | Definition Username Range The value can contain 1 to 64 characters. |
| login_permission | Boolean | Definition Whether login is allowed. Constraints N/A Range Default Value N/A |
| root_permission | Boolean | Definition Administrator permissions Range |
| user_group_name | String | Definition User group. Range The value can contain 1 to 128 characters. |
| user_home_dir | String | Definition User directory. Range The value can contain 1 to 256 characters. |
| shell | String | Definition User startup shell Range The value can contain 1 to 128 characters. |
| recent_scan_time | Long | Definition Last scan time. Range The value range is 0 to 9,223,372,036,854,775,807. |
| first_scan_time | Long | Definition First scan time. Range The value range is 0 to 9,223,372,036,854,775,807. |
| container_id | String | Definition Container ID. Range The value can contain 1 to 128 characters. |
| container_name | String | Definition Container instance name. This parameter is available only for container alarms. Range The value can contain 1 to 256 characters. |
Example Requests
Query servers list whose account is daemon by default.
GET https://{endpoint}/v5/{project_id}/asset/users?user_name=daemon Example Responses
Status code: 200
Request succeeded.
{
"total_num" : 1,
"data_list" : [ {
"agent_id" : "0bf792d910xxxxxxxxxxx52cb7e63exxx",
"host_id" : "13xxxxxxxece69",
"host_ip" : "192.168.0.1",
"host_name" : "test",
"login_permission" : false,
"recent_scan_time" : 1667039707730,
"root_permission" : false,
"shell" : "/sbin/nologin",
"user_group_name" : "bin",
"user_home_dir" : "/bin",
"user_name" : "bin",
"container_id" : "ce794b8a6-xxxx-xxxx-xxxxx-36bedf2c7a4f6083fb82e5bbc82709b50018",
"container_name" : "hss_imagescan_W73V1WO6"
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot