Platform Resource Statistics
2.5.1 Query System Health
API endpoint
GET /NSphere/api/dc-resource/health
API description
Query system health. Parameters are evaluated in the order hpId, clusterId, hostId.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
hpId | Data center ID. | query | false | integer(int64) | |
clusterId | Cluster ID. | query | false | integer(int64) | |
hostId | Host ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiHealthInfoVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiHealthInfoVO | ApiHealthInfoVO |
cvmHealth | System health | integer(int32) | |
cvkhealthInfoList | Host system health information entity. | array | ApiCvkHealthInfoVO |
id | Host ID. | integer(int64) | |
name | Host name. | string | |
status | Host status. 0: abnormal, 1: normal. | integer(int32) | |
cpuRate | CPU utilization. (Unit: %) | number(double) | |
memRate | Memory utilization. (Unit: %) | number(double) | |
storageRate | Storage utilization. (Unit: %) | number(double) | |
netIo | Network throughput. (Throughput of the NIC with the highest I/O, unit: Mbps) | number(double) | |
cpuHealth | Host CPU health. | integer(int32) | |
memHealth | Host memory health. | integer(int32) | |
storageHealth | Host storage health. | integer(int32) | |
netHealth | Host network health. | integer(int32) | |
cvkHealth | Host health. | integer(int32) | |
bandwidthStat | Sum of bandwidth across all vSwitches on the host. (Unit: Mbps) | number(double) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"cvmHealth": null,
"cvkhealthInfoList": [
{
"id": null,
"name": null,
"status": null,
"cpuRate": null,
"memRate": null,
"storageRate": null,
"netIo": null,
"cpuHealth": null,
"memHealth": null,
"storageHealth": null,
"netHealth": null,
"cvkHealth": null,
"bandwidthStat": null
}
]
}
}
2.5.2 Query Block Storage Resource Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/block-storage-resource
API description
Query block storage resource statistics.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when sortField is not empty. | query | false | integer(int32) | |
sortField | Supported fields only: title, storageType, hostName. | query | false | string | |
hostPoolId | Data center ID. | query | false | integer(int64) | |
clusterId | Cluster ID. | query | false | integer(int64) | |
hostId | Host ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiBlockStorageResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiBlockStorageResourceVO | ApiPagingListResultApiBlockStorageResourceVO |
data | Block storage resource statistics information entity. | array | ApiBlockStorageResourceVO |
hostName | Host name. | string | |
usedCapacity | Allocated capacity. (Unit: MB) | string | |
actualAvailCapacity | Actual available capacity. (Unit: MB) | string | |
hostId | Host ID. | string | |
storageType | Storage type. iscsi: iSCSI block storage, fc: FC block storage, nvme-of: NVMe-oF block storage. | string | |
title | Display name. | string | |
user | User. | string | |
capacity | Total capacity. (Unit: MB) | string | |
status | Status. 0: active, 1: inactive, 2: abnormal. | string | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"hostName": "node62186",
"usedCapacity": 5120,
"actualAvailCapacity": 0,
"hostId": 1,
"storageType": "iscsi",
"title": "dd",
"user": "test_block_vm",
"capacity": 5120,
"status": 0
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.3 Query Cluster Resource Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/cluster-resource
API description
Query cluster resource statistics. New response attributes added in the E0930 release.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when sortField is not empty. | query | false | integer(int32) | |
sortField | Sort field. Supported fields: name. | query | false | string | |
clusterName | Cluster name. Supports fuzzy query. | query | false | string | |
clusterId | Cluster ID. | query | false | integer(int64) | |
hostPoolId | Data center ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiClusterResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiClusterResourceVO | ApiPagingListResultApiClusterResourceVO |
data | Cluster resource statistics information entity. | array | ApiClusterResourceVO |
name | Cluster name. | string | |
id | Cluster ID. | integer(int64) | |
hostNum | Number of hosts. | integer(int32) | |
vmTotal | Total number of VMs. New attribute in the E0930 release. | integer(int32) | |
runningNum | Number of running VMs. | integer(int32) | |
shutoffNum | Number of powered-off VMs. | integer(int32) | |
otherNum | Number of VMs in other states. | integer(int32) | |
summary | VM count overview. (Running count / Powered-off count / Other count) | string | |
vmDensity | VM density. | number(double) | |
cpuNum | Total CPU cores. | integer(int32) | |
memory | Total memory. (Unit: MB) | integer(int64) | |
diskProgress | Local storage used percentage. (Unit: %) (Manually connect to the host to refresh the data.) | number(double) | |
availableStorage | Local storage available capacity (with unit). New attribute in the E0930 release. | string | |
cpuRate | CPU allocation ratio. (With unit) | string | |
cpuAllocRatio | CPU allocation ratio. (Without unit) | string | |
memRate | Memory allocation ratio. (With unit) | string | |
memAllocRatio | Memory allocation ratio. (Without unit) | string | |
shareFileStorage | Shared storage actual usage and total capacity. (With unit) | string | |
lunNum | Number of shared LUNs. | integer(int32) | |
haStatus | HA status. Enabled / Not enabled. | string | |
lbStatus | Compute resource DRS status. Enabled / Not enabled. | string | |
slbStatus | Storage resource DRS status. Enabled / Not enabled. | string | |
cpuProgress | CPU utilization. (Unit: %) | number(double) | |
memProgress | Memory utilization. (Unit: %) | number(double) | |
monthAvgMem | Average memory utilization over the last month. (Unit: %) | number(double) | |
monthAvgCpu | Average CPU utilization over the last month. (Unit: %) | number(double) | |
storage | Total storage, formatted with unit. Unit range: MB, GB, TB. New attribute in the E0930 release. | string | |
storageRate | Storage utilization. (With unit) New attribute in the E0930 release. | string | |
storageAllocRatio | Storage utilization. (Without unit) New attribute in the E0930 release. | number(double) | |
allocatedCpu | Number of allocated CPU cores. New attribute in the E0930 release. | integer(int32) | |
allocatedMem | Allocated memory, formatted with unit. Unit range: MB, GB, TB. New attribute in the E0930 release. | string | |
sensitivity | HA sensitivity level. 0: low, 1: medium, 2: high, 3: custom. | integer(int32) | |
enableHA | Whether HA (High Availability) is enabled. 0: not enabled, 1: enabled. New attribute in the E0930 release. | integer(int32) | |
enableLB | Whether compute resource DRS (Dynamic Resource Scheduling) is enabled. 0: disabled, 1: enabled. New attribute in the E0930 release. | integer(int32) | |
enableIPM | Whether intelligent power management is enabled. 0: disabled, 1: enabled. New attribute in the E0930 release. | integer(int32) | |
enableSLB | Whether storage resource DRS is enabled. 0: disabled, 1: enabled. New attribute in the E0930 release. | integer(int32) | |
description | Cluster description. New attribute in the E0930 release. | string | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"name": "cluster",
"id": 34,
"hostNum": 1,
"vmTotal": 15,
"runningNum": 10,
"shutoffNum": 5,
"otherNum": 0,
"summary": "10/5/0",
"vmDensity": 15,
"cpuNum": 16,
"memory": 64044,
"diskProgress": 5,
"availableStorage": "5.00GB",
"cpuRate": "93.75%",
"cpuAllocRatio": 93.75,
"memRate": "23.18%",
"memAllocRatio": 23.18,
"shareFileStorage": "26.72GB/50.00GB",
"lunNum": 1,
"haStatus": null,
"lbStatus": null,
"slbStatus": null,
"cpuProgress": 6.4,
"memProgress": 37.57,
"monthAvgMem": 35.58,
"monthAvgCpu": 7.81,
"storage": "1.28TB",
"storageRate": "9.8%",
"storageAllocRatio": 9.8,
"allocatedCpu": 1,
"allocatedMem": "1.23GB",
"sensitivity": 1,
"enableHA": 0,
"enableLB": 0,
"enableIPM": 0,
"enableSLB": 0,
"description": null
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.4 Query Host Resource Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/host-resource
API description
Query host resource statistics.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when sortField is not empty. | query | false | integer(int32) | |
sortField | Sort field. Supported fields: name. | query | false | string | |
hostId | Host ID. | query | false | integer(int64) | |
hostName | Host name. Supports fuzzy query. | query | false | string | |
clusterId | Cluster ID. | query | false | integer(int64) | |
hostPoolId | Data center ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiHostResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiHostResourceVO | ApiPagingListResultApiHostResourceVO |
data | Host resource statistics information entity. | array | ApiHostResourceVO |
id | Host ID. | integer(int64) | |
clusterId | Cluster ID. | integer(int64) | |
name | Host name. | string | |
ipAddr | Host IP address. | string | |
status | Host status. (0: abnormal, 1: normal, 2: not in HA, 3 and 4: maintenance mode (4 is local storage fault), 5: isolation mode, 6: storage network isolation) | integer(int32) | |
storage | Local disk capacity. (Unit: MB) | integer(int64) | |
platform | Host platform version. | string | |
cpu | Number of CPU cores. | integer(int32) | |
memory | Memory capacity. (Unit: MB) | integer(int64) | |
provider | Host model. | string | |
cpuModel | CPU model. | string | |
runningNum | Number of running VMs. | integer(int32) | |
shutoffNum | Number of powered-off VMs. | integer(int32) | |
otherNum | Number of VMs in other states. | integer(int32) | |
summary | Sum of running and powered-off VMs. | integer(int32) | |
memRunningVm | Sum of memory across running VMs. (Unit: MB) | integer(int32) | |
cpuRate | Average CPU utilization over the last hour. (Unit: %) | number(double) | |
memRate | Average memory utilization over the last hour. (Unit: %) | number(double) | |
systemTime | System uptime. Example: 24 days 1 hour 47 minutes 9 seconds. | string | |
diskRate | Host storage utilization statistics. (vms partition, unit: %) | number(double) | |
topCpuRate | Peak CPU utilization over the last hour. (Unit: %) | number(double) | |
topMemRate | Peak memory utilization over the last hour. (Unit: %) | number(double) | |
monthAvgCpu | Average CPU utilization over the last month. (Unit: %) | number(double) | |
monthAvgMem | Average memory utilization over the last month. (Unit: %) | number(double) | |
monthTopCpu | Peak CPU utilization over the last month. (Unit: %) | number(double) | |
monthTopMem | Peak memory utilization over the last month. (Unit: %) | number(double) | |
cpuAlloc | Number of CPU cores allocated to VMs. | integer(int64) | |
memAlloc | Memory capacity allocated to VMs. (Unit: MB) | integer(int64) | |
memAllocRatio | Memory allocation ratio. (Unit: %) | number(double) | |
cpuAllocRatio | CPU allocation ratio. (Unit: %) | number(double) | |
devName | Storage device name. | string | |
iops | Storage device I/O throughput. (Unit: KBps) | string | |
mac | MAC address information. | string | |
portFlow | Network throughput. (Unit: Mbps) | string | |
hostType | Expressed in hexadecimal. The rightmost digit indicates the CPU architecture: 0: x86, 1: ARM. The second digit indicates the operating system: 0: Ubuntu, 1: CentOS, 2: NingOS, 3: TOS. | integer(int32) | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"id": 1,
"clusterId": 34,
"name": "node62186",
"ipAddr": "192.0.2.196",
"status": 1,
"storage": 227714,
"platform": "CVK 9.0 (E0920)",
"cpu": 16,
"memory": 64044,
"provider": "QEMU Standard PC (i440FX + PIIX, 1996)",
"cpuModel": "Intel(R) Xeon(R) Silver 4214 CPU @ 2.20GHz",
"runningNum": 10,
"shutoffNum": 5,
"otherNum": 0,
"summary": 15,
"memRunningVm": 10240,
"cpuRate": 10.43,
"memRate": 37.22,
"systemTime": null,
"diskRate": 41,
"topCpuRate": 26.94,
"topMemRate": 37.92,
"monthAvgCpu": 7.83,
"monthAvgMem": 35.64,
"monthTopCpu": 64.19,
"monthTopMem": 38.5,
"cpuAlloc": 15,
"memAlloc": 14848,
"memAllocRatio": 23.18,
"cpuAllocRatio": 93.75,
"devName": "share_xx \nvda \n",
"iops": "share_xx-read:26,share_xx-write:0 \nvda-read:0,vda-write:14 \n",
"mac": "0c:da:41:1d:03:34 \n",
"portFlow": "0c:da:41:1d:03:34-rx:0.89,0c:da:41:1d:03:34-tx:0.12 \n",
"hostType": 32
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.5 Query Host Status Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/host-status
API description
Query host status statistics.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
hpId | Data center ID. | query | false | integer(int64) | |
clusterId | Cluster ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiHostStatusCountVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiHostStatusCountVO | ApiHostStatusCountVO |
total | Total number of hosts. | integer(int32) | |
normal | Number of hosts in normal state. | integer(int32) | |
closed | Number of hosts in abnormal state. | integer(int32) | |
maintain | Number of hosts in maintenance state. | integer(int32) | |
quarantine | Number of hosts in isolation state. | integer(int32) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"total": null,
"normal": null,
"closed": null,
"maintain": null,
"quarantine": null
}
}
2.5.6 Query IP Allocation Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/ip
API description
Query IP allocation statistics.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when sortField is not empty. | query | false | integer(int32) | |
sortField | Sort field. Supported fields: title, desc, mac, ip. | query | false | string | |
title | VM display name. Supports fuzzy query. | query | false | string | |
hostId | Host ID. | query | false | integer(int64) | |
clusterId | Cluster ID. | query | false | integer(int64) | |
hostPoolId | Data center ID. | query | false | integer(int64) | |
ip | IP address. Supports fuzzy query. | query | false | string |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiIpResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiIpResourceVO | ApiPagingListResultApiIpResourceVO |
data | IP resource statistics information entity. | array | ApiIpResourceVO |
id | VM ID. | integer(int64) | |
title | VM display name. | string | |
desc | VM description. | string | |
os | VM operating system. | string | |
tools | NSpheretool status. 0: not running, 1: running. | integer(int32) | |
mac | MAC address. | string | |
ip | IP address. | string | |
toolsVersion | NSpheretool version. | string | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"id": 58,
"title": "centos_6",
"desc": "desc info",
"os": "CentOS release 6.4 (Final)",
"tools": 1,
"mac": "0c:da:41:1d:03:57",
"ip": "1.1.1.24",
"toolsVersion": "9.2.0.0.0.0"
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.7 Query Private VLAN Allocation Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/pvlan
API description
Query private VLAN allocation statistics.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when sortField is not empty. | query | false | integer(int32) | |
sortField | Sort field. Supported fields: title, desc, mac, ip. | query | false | string | |
vlanId | Private VLAN ID | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiPvlanResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiPvlanResourceVO | ApiPagingListResultApiPvlanResourceVO |
data | Private VLAN resource statistics information entity. | array | ApiPvlanResourceVO |
id | VM ID. | integer(int64) | |
domainName | VM name. | string | |
title | VM display name. | string | |
desc | VM description. | string | |
os | VM operating system. | string | |
mac | MAC address. | string | |
pvlanRule | Private VLAN rule details. | string | |
ip | IP address. | string | |
toolsVersion | NSpheretool version. | string | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"id": 3,
"domainName": "backup-test-001",
"title": "backup_test_001",
"desc": null,
"os": "CentOS release 6.4 (Final)",
"mac": "0c:da:41:1d:03:57",
"pvlanRule": null,
"ip": "1.1.1.24",
"toolsVersion": "9.2.0.0.0.0"
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.8 Query Shared File System Resource Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/share-storage-resource
API description
Query shared file system resource statistics. New response attributes added in the E0930 release.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when sortField is not empty. | query | false | integer(int32) | |
sortField | Supported fields only: title, storageType, targetPath. | query | false | string | |
hostPoolId | Data center ID. | query | false | integer(int64) | |
clusterId | Cluster ID. | query | false | integer(int64) | |
hostId | Host ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiShareStorageResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiShareStorageResourceVO | ApiPagingListResultApiShareStorageResourceVO |
data | Shared file system resource statistics information entity. | array | ApiShareStorageResourceVO |
usedCapacity | Allocated capacity. (Unit: MB) | string | |
actualAvailCapacity | Actual available capacity. (Unit: MB) | string | |
targetPath | Target path. | string | |
storageType | Type. 1: iSCSI shared file system, 2: FC shared file system, 3: NVMe-oF shared file system, 5: iSER shared file system. | string | |
utilization | Disk utilization. (Unit: %) | number(double) | |
id | Shared file system ID. | string | |
title | Display name. | string | |
capacity | Total capacity. (Unit: MB) | string | |
rdReq | Read IOPS (unit: ops/sec). New attribute in the E0930 release. | number(double) | |
wrReq | Write IOPS (unit: ops/sec). New attribute in the E0930 release. | number(double) | |
rdStat | Read throughput (unit: KBps). New attribute in the E0930 release. | number(double) | |
wrStat | Write throughput (unit: KBps). New attribute in the E0930 release. | number(double) | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"usedCapacity": 85059,
"actualAvailCapacity": 27356,
"targetPath": "/vms/share_xx",
"storageType": 1,
"utilization": 46.57,
"id": 1,
"title": "share_xx",
"capacity": 51200,
"rdReq": 50,
"wrReq": 0,
"rdStat": 204.21,
"wrStat": 0
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.9 Query Virtualized Resource Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/virtualized-resource
API description
Query virtualized resource statistics
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
clusterId | Cluster ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiVirtualizedResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiVirtualizedResourceVO | ApiVirtualizedResourceVO |
cpuCount | Total host CPU cores. | integer(int64) | |
memCount | Total host memory capacity. (Formatted, with unit) | string | |
countMemoryPic | Total host memory capacity. (Formatted, without unit) | string | |
vmCpuCount | Number of CPU cores used by VMs. | integer(int64) | |
vmMemCount | Memory capacity allocated to VMs. (Formatted, with unit) | string | |
cpuRate | Ratio of CPU cores allocated to VMs to total host CPU cores. (Unit: %) | string | |
memRate | Ratio of memory capacity allocated to VMs to total host memory. (Unit: %) | string | |
countStoragePic | Total shared storage capacity. (Formatted, without unit) | string | |
totalStorage | Total shared storage capacity. (Formatted, with unit) | string | |
usedStorage | Used shared storage capacity. (Formatted, with unit) | string | |
remainStorage | Available shared storage capacity. (Formatted, with unit) | string | |
storageRate | Ratio of allocated shared storage capacity to total capacity. (Unit: %) | string | |
cpuUsedRate | Ratio of CPU cores actually in use to total CPU cores. (Unit: %) | string | |
memUsedRate | Ratio of memory actually in use to total memory. (Unit: %) | string | |
storageUsedRate | Ratio of actually used shared storage to total shared storage. (Unit: %) | string |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"cpuCount": 384,
"memCount": "2.21TB",
"countMemoryPic": 2.21,
"vmCpuCount": 6,
"vmMemCount": "11.00GB",
"cpuRate": 1.56,
"memRate": 0.49,
"countStoragePic": 1.64,
"totalStorage": "1.64TB",
"usedStorage": "41.86GB",
"remainStorage": "1.60TB",
"storageRate": 3.27,
"cpuUsedRate": 2.63,
"memUsedRate": 12.87,
"storageUsedRate": 2.49
}
}
2.5.10 Query VLAN Allocation Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/vlan
API description
Query VLAN allocation statistics. New parameters added in the E0930 release.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. 0 means query all records. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when limit is 0 and sortField is not empty. New parameter in the E0930 release. | query | false | integer(int32) | |
sortField | Sort field. Supported fields: domainName, title, desc, os, mac, vlanId, ip, toolsVersion. New parameter in the E0930 release. | query | false | string | |
vlanId | VLAN ID. | query | false | integer(int32) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiVlanResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiVlanResourceVO | ApiPagingListResultApiVlanResourceVO |
data | VLAN resource statistics information entity. | array | ApiVlanResourceVO |
id | VM ID. | integer(int64) | |
domainName | VM name. | string | |
title | VM display name. | string | |
desc | VM description. | string | |
os | VM operating system. | string | |
mac | MAC address. | string | |
vlanId | VLAN ID. | integer(int32) | |
ip | IP address. | string | |
toolsVersion | NSpheretool version. | string | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"id": 3,
"domainName": "backup-test-001",
"title": "backup_test_001",
"desc": null,
"os": "CentOS release 6.4 (Final)",
"mac": "0c:da:41:1d:03:57",
"vlanId": 1,
"ip": "1.1.1.24",
"toolsVersion": "9.2.0.0.0.0"
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.11 Query VM Disk Resource Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/vm-disk-resource
API description
Query VM disk resource statistics.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when sortField is not empty. | query | false | integer(int32) | |
sortField | Sort field. Supported fields: domainTitle, status, hostName, capacity. | query | false | string | |
domainTitle | VM display name. Supports fuzzy query. | query | false | string | |
hostPoolId | Data center ID. | query | false | integer(int64) | |
clusterId | Cluster ID. | query | false | integer(int64) | |
hostId | Host ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiVmDiskResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiVmDiskResourceVO | ApiPagingListResultApiVmDiskResourceVO |
data | VM disk resource statistics information entity. | array | ApiVmDiskResourceVO |
id | Disk ID. | integer(int64) | |
devName | Disk name. | string | |
fileName | Disk path. | string | |
poolPath | Storage path. | string | |
domainId | VM ID. | integer(int64) | |
domainName | VM name. | string | |
domainTitle | VM display name. | string | |
status | VM state. shutOff: powered off, unknown: unknown, ha_exception: HA exception, running: running, paused: paused, sleeping: sleeping. | string | |
hostId | Host ID. | integer(int64) | |
hostName | Host name. | string | |
capacity | Disk capacity. (Unit: MB) | number(double) | |
capacityStr | Disk capacity, converted to string. (Unit: MB) | string | |
availableStr | Available disk capacity. (Unit: MB) | string | |
utilizationStr | Disk utilization. (Unit: %) | number(double) | |
backingFileName | Base image path. | string | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"id": 3,
"devName": "vda",
"fileName": "/vms/share_xx/dfdfd",
"poolPath": "/vms/share_xx",
"domainId": 3,
"domainName": "backup-test-001",
"domainTitle": "backup_test_001",
"status": "running",
"hostId": 1,
"hostName": "node62186",
"capacity": 1024,
"capacityStr": 1024,
"availableStr": 1023.2832,
"utilizationStr": 0.07,
"backingFileName": "/vms/share_xx/dfdfd_base_1"
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.12 Query VM Resource Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/vm-resource
API description
Query VM resource statistics.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when sortField is not empty. | query | false | integer(int32) | |
sortField | Sort field. Supported fields: title. | query | false | string | |
title | VM display name. Supports fuzzy query. | query | false | string | |
hostId | Host ID. | query | false | integer(int64) | |
clusterId | Cluster ID. | query | false | integer(int64) | |
hostPoolId | Data center ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiVmResourceVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiVmResourceVO | ApiPagingListResultApiVmResourceVO |
data | VM resource statistics information entity. | array | ApiVmResourceVO |
id | VM ID. | integer(int64) | |
name | VM name. | string | |
host | Host name. | string | |
title | VM display name. | string | |
computerName | Computer name. | string | |
desc | VM description. | string | |
hostId | Host ID. | integer(int64) | |
clusterId | Cluster ID. | integer(int64) | |
clusterName | Cluster name. | string | |
hostPoolId | Data center ID. | integer(int64) | |
templateId | Template ID for VMs deployed from a template. | integer(int64) | |
enable | VM type. 1: VM, 2: template, 3: deleted VM, 4: being created, 5: OVF template. | integer(int32) | |
hostBinding | Host binding status. 0: normal VM. 1: VM bound to a host, such as a Hillstone VM. | integer(int32) | |
status | VM state. shutOff: powered off, unknown: unknown, ha_exception: HA exception, running: running, paused: paused, sleeping: sleeping. | string | |
cpuRate | CPU utilization. (Unit: %) | number(double) | |
memRate | Memory utilization. (Unit: %) | number(double) | |
cpu | Number of CPU cores. | integer(int32) | |
mem | Memory capacity. (Unit: MB) | integer(int64) | |
system | VM operating system. | string | |
sysInt | VM installed operating system. 0: Windows, 1: Linux, 2: BSD. | integer(int32) | |
haStatus | HA status. 0: normal, 1: not joined to HA, 2: joined to HA but configuration file not synchronized. | integer(int32) | |
haManage | VM HA management status. 0: not managed by HA, 1: managed by HA. | integer(int32) | |
uuid | VM UUID. | string | |
protectModel | Whether the VM has protection mode enabled. 1: enabled, 0: not enabled. | integer(int32) | |
nspheretools | NSpheretool status, combined with VM state. noRunning: not running, running: running, --: unknown. | string | |
nspheretoolsStatus | NSpheretool status. 0: not running, 1: running. | integer(int32) | |
nspheretoolsVersion | NSpheretool version. | string | |
uptime | VM uptime, in minutes. -1 means unknown. | integer(int32) | |
vmType | The low 2 bytes represent the VM category: default is 1. 1: normal VM. 101–200: reserved for VDI customization. The high 2 bytes represent the VM type: bits are numbered 0 to 31 from low to high, the high 2 bytes cover bits 16 to 31, only bits 17 and 16 are used: 00 normal VM (shown in the UI as "normal VM"), 01 disaster-recovery VM, 10 disaster-recovery restore VM; other bits are unused. | integer(int32) | |
lastOffTime | Last power-off time. | integer(int64) | |
antivirusConfig | Whether the VM has antivirus configuration enabled. 1: enabled, 0: not enabled. | integer(int32) | |
createTime | Creation time. | string(date-time) | |
enableUltra | Whether the VM has Ultra mode enabled. 1: enabled; 0 or empty: not enabled. | integer(int32) | |
ipData | Key is the MAC address; value is the specific network information. | ApiIpData | ApiIpData |
mac | MAC address. | string | |
ipAddr | IP address. | string | |
mask | Netmask. | string | |
ipv6Data | Key is the MAC address; value is the specific network information. | ApiIpv6Data | ApiIpv6Data |
mac | MAC address. | string | |
ipAddr | IP address. | string | |
mask | Netmask. | string | |
mac | MAC address information. | string | |
ipv6 | IPv6 information. | string | |
ipv4 | IPv4 information. | string | |
ipv4Attributes | First IPv4 address. | string | |
ipv6Attributes | First IPv6 address. | string | |
diskInfo | Disk device name. If the disk is empty, "-" is used; " \n" is used as separator. | string | |
capacity | Disk capacity, with unit. If the disk is empty, "-" is used; " \n" is used as separator. | string | |
useage | Disk utilization, with unit. If the disk is empty, "-" is used; " \n" is used as separator. | string | |
autoMemStatus | Memory overcommit status. 0: disabled, 1: enabled. | integer(int32) | |
haRealStatus | Actual HA status, computed from the cluster HA status and the VM's HA management status. 0: disabled, 1: enabled. | integer(int32) | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"id": 3,
"name": "backup-test-001",
"host": "node62186",
"title": "backup_test_001",
"computerName": null,
"desc": null,
"hostId": 1,
"clusterId": 34,
"clusterName": "cluster",
"hostPoolId": 1,
"templateId": 2,
"enable": 1,
"hostBinding": 0,
"status": "running",
"cpuRate": 1,
"memRate": 7.19,
"cpu": 8,
"mem": 1024,
"system": "Red Hat Enterprise Linux 8(64-bit)",
"sysInt": 1,
"haStatus": 0,
"haManage": 1,
"uuid": "a76b426c-f44a-45c3-8dc6-1e02261b8605",
"protectModel": 0,
"nspheretools": "noRunning",
"nspheretoolsStatus": 0,
"nspheretoolsVersion": "9.2.0.0.0.0",
"uptime": -1,
"vmType": 1,
"lastOffTime": 0,
"antivirusConfig": 0,
"createTime": "2025-11-13T08:37:49.000+00:00",
"enableUltra": 0,
"ipData": {
"additionalProperties1": [
{
"mac": "0c:da:41:1d:03:30",
"ipAddr": "20.2.1.1",
"mask": "255.255.0.0"
}
]
},
"ipv6Data": {
"additionalProperties1": [
{
"mac": "0c:da:41:1d:03:30",
"ipAddr": "20::1",
"mask": 64
}
]
},
"mac": "0c:da:41:1d:f2:7b \n\n0c:da:41:1d:a6:cc \n\n0c:da:41:1d:bf:20",
"ipv6": "172:20::3a:252 \n\n",
"ipv4": "20.3.1.1 \n\n\n20.2.1.1 \n\n\n20.1.1.1 \n\n\n",
"ipv4Attributes": "20.3.1.1",
"ipv6Attributes": "172:20::3a:252",
"diskInfo": "vda \n",
"capacity": "1.00GB \n",
"useage": "11.87% \n",
"autoMemStatus": 0,
"haRealStatus": 1
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.13 Query VM Power-Off Time Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/vm-shutdown-time
API description
Query VM power-off time statistics
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
offset | Offset. Specifies the record number from which to start returning. | query | false | integer(int32) | |
limit | Maximum number of records returned per page. | query | false | integer(int32) | |
sortDir | Sort direction. 0: no sorting, 1: ascending, 2: descending. Effective when sortField is not empty. | query | false | integer(int32) | |
sortField | Supported fields only: sumTime. | query | false | string | |
startTime | Start time of the statistics period. If end time is set, it must not be greater than the start time. | query | false | string | |
endTime | End time of the statistics period. If start time is set, it must not be less than the start time. | query | false | string |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiPagingListResultApiVmOffTimeVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiPagingListResultApiVmOffTimeVO | ApiPagingListResultApiVmOffTimeVO |
data | VM power-off time statistics information entity. | array | ApiVmOffTimeVO |
id | VM power-off time ID. | integer(int64) | |
vmId | VM ID. | integer(int64) | |
vmName | VM name. | string | |
vmTitle | VM display name. | string | |
hostId | Host ID. | integer(int64) | |
hostName | Host name. | string | |
osDesc | Operating system. | string | |
vmStatus | VM state. shutOff: powered off, unknown: unknown, ha_exception: HA exception, running: running, paused: paused, sleeping: sleeping. | string | |
offTime | Power-off time. Unix timestamp in milliseconds. | integer(int64) | |
runningTime | Power-on time. Unix timestamp in milliseconds. | integer(int64) | |
offPeriod | Power-off duration. Unit: milliseconds. | integer(int64) | |
sumTime | Total power-off duration. Unit: milliseconds. | integer(int64) | |
offset | Offset. Specifies the record number from which to start returning. | integer(int32) | |
size | Number of records currently returned. | integer(int32) | |
total | Total data count | integer(int64) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"data": [
{
"id": 3,
"vmId": 3,
"vmName": "backup-test-001",
"vmTitle": "backup_test_001",
"hostId": 1,
"hostName": "node62186",
"osDesc": "Red Hat Enterprise Linux 8(64-bit)",
"vmStatus": "running",
"offTime": 1765782240004,
"runningTime": 1765782240004,
"offPeriod": 1303044633,
"sumTime": 1303044633
}
],
"offset": null,
"size": null,
"total": null
}
}
2.5.14 Query VM Status Statistics
API endpoint
GET /NSphere/api/dc-resource/statistics/vm-status
API description
Query VM status statistics.
Request Content-Type
application/x-www-form-urlencoded
Response Content-Type
application/json
Request parameters
Parameter name | Description | Location | Required | Type | schema |
hpId | Data center ID. | query | false | integer(int64) | |
clusterId | Cluster ID. | query | false | integer(int64) | |
hostId | Host ID. | query | false | integer(int64) |
Response status
Status code | Description | schema |
200 | OK | ApiResponseApiVmStatusCountVO |
Response parameters
Parameter name | Description | Type | schema |
state | Status code. 0: success, 1: failure, 2: partial success | integer(int32) | integer(int32) |
errorCode | Error code. Non-zero indicates a business error occurred. | integer(int32) | integer(int32) |
successMessage | Success message | string | |
failureMessage | Error message. Valid on failure or partial success. | string | |
data | Response data. If the status code is 0, normal data is returned; if non-zero and non-empty, it contains data necessary to explain the exception. | ApiVmStatusCountVO | ApiVmStatusCountVO |
total | Total number of VMs. | integer(int32) | |
running | Number of VMs in normal state. | integer(int32) | |
shutOff | Number of VMs in powered-off state. | integer(int32) | |
unknown | Number of VMs in abnormal state. | integer(int32) |
Response example
{
"state": 0,
"errorCode": 0,
"successMessage": null,
"failureMessage": null,
"data": {
"total": null,
"running": null,
"shutOff": null,
"unknown": null
}
}