Collecting Server Statistics
Function
This API is used to collect server statistics.
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}/host-management/host-statistics
|
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 |
|---|---|---|---|
|
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. |
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 |
|
region |
No |
String |
Definition Region ID, which is used to query assets in the required region. For details about how to obtain a region ID, see Obtaining a Region ID. Constraints N/A Range The value can contain 1 to 128 characters. Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total_num |
Integer |
Total number of servers. |
|
risk_num |
Integer |
Unsafe servers |
|
unprotected_num |
Integer |
Number of unprotected servers |
|
not_installed_num |
Integer |
Number of agents that are not installed |
|
installed_failed_num |
Integer |
Failed agent installations |
|
not_online_num |
Integer |
Number of offline agents |
|
version_basic_num |
Integer |
Number of servers of the basic edition |
|
version_advanced_num |
Integer |
Number of servers of the professional edition |
|
version_enterprise_num |
Integer |
Number of servers of the enterprise edition |
|
version_premium_num |
Integer |
Number of servers of the premium edition |
|
version_wtp_num |
Integer |
Number of servers of the WTP edition |
|
version_container_num |
Integer |
Number of servers of the container edition |
|
host_group_num |
Integer |
Total number of server groups |
|
server_group_num |
Integer |
Number of asset server groups |
|
asset_value_list |
Array of AssetValueHostNumInfo objects |
Asset importance list |
|
server_group_list |
Array of ServerGroupItem objects |
Server group list. |
|
ignore_host_num |
Integer |
Ignored servers |
|
protected_num |
Integer |
Protected servers |
|
protect_interrupt_num |
Integer |
Number of servers with protection interruption |
|
idle_num |
Integer |
Idle quota |
|
premium_non_sp_num |
Integer |
Number of hosts with agent self-protection disabled of the premium edition |
Example Requests
None
Example Responses
Status code: 200
Request succeeded.
{
"total_num" : 1,
"risk_num" : 2,
"unprotected_num" : 1,
"not_installed_num" : 1,
"installed_failed_num" : 1,
"not_online_num" : 1,
"version_basic_num" : 1,
"version_advanced_num" : 1,
"version_enterprise_num" : 1,
"version_premium_num" : 1,
"version_wtp_num" : 1,
"version_container_num" : 1,
"host_group_num" : 1,
"server_group_num" : 1,
"asset_value_list" : [ {
"value_type" : "xxx",
"host_num" : 1
} ],
"server_group_list" : [ {
"server_group_id" : "xxx",
"server_group_name" : "xxx",
"host_num" : 1
} ],
"ignore_host_num" : 1,
"protected_num" : 1,
"protect_interrupt_num" : 1,
"idle_num" : 1,
"premium_non_sp_num" : 1
}
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