跳到主要内容

主机

2.11.1增加主机

接口地址

POST  /NSphere/api/host-resource

接口描述

请求数据类型

application/json

响应数据类型

application/json

请求示例

{

"ip": "",

"pwd": "",

"clusterId": null,

"secretLevel": null,

"hostPoolId": 0,

"enableHA": 0,

"ignore": true

}

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

apiAddHostDTO

ApiAddHostDTO

body

true

ApiAddHostDTO

ApiAddHostDTO

ip

主机IP地址

true

string

pwd

访问主机的密码

true

string

clusterId

集群ID

false

integer(int64)

secretLevel

密级级别,默认值为1(1:内部公开,2:秘密,3:机密,4:绝密),如果开启了保密模式,在安全区域内增加主机时不允许设置为1。

false

integer(int32)

hostPoolId

数据中心ID

true

integer(int64)

enableHA

是否启用HA 0:不启用HA 1:启用HA

true

integer(int32)

ignore

是否忽略重复管理。false:主机已被其他系统管理时,无法被添加。true:主机已被其他系统管理时,仍然可以被添加。

true

boolean

响应状态

状态码

说明

schema

200

OK

ApiResponseApiTaskMsgVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiTaskMsgVO

ApiTaskMsgVO

msgId

消息ID,可用于查询任务进度。

integer(int64)

targetId

任务执行对象ID

integer(int64)

targetName

任务执行对象名称

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"msgId": 0,

"targetId": null,

"targetName": null

}

}

2.11.2修改主机密码

接口地址

PUT  /NSphere/api/host-resource/{id}

接口描述

请求数据类型

application/json

响应数据类型

application/json

请求示例

{

"pwd": ""

}

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

id

主机ID

path

true

integer(int64)

apiModifyHostDTO

ApiModifyHostDTO

body

true

ApiModifyHostDTO

ApiModifyHostDTO

pwd

访问主机后台的新密码,密码必须同时包含大写字母、小写字母、数字和特殊字符,并且不能包含连续自然数、&/|`;$()<>\、空格、中文、英文单引号、英文双引号。新密码最小长度为12,最大长度为32。

true

string

响应状态

状态码

说明

schema

200

OK

ApiResponseVoid

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {}

}

2.11.3删除主机

接口地址

DELETE  /NSphere/api/host-resource/{id}

接口描述

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

id

主机ID

path

true

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseApiTaskMsgVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiTaskMsgVO

ApiTaskMsgVO

msgId

消息ID,可用于查询任务进度。

integer(int64)

targetId

任务执行对象ID

integer(int64)

targetName

任务执行对象名称

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"msgId": 0,

"targetId": null,

"targetName": null

}

}

2.11.4连接主机

接口地址

PUT  /NSphere/api/host-resource/connect/{id}

接口描述

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

id

主机ID

path

true

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseApiTaskMsgVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiTaskMsgVO

ApiTaskMsgVO

msgId

消息ID,可用于查询任务进度。

integer(int64)

targetId

任务执行对象ID

integer(int64)

targetName

任务执行对象名称

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"msgId": 0,

"targetId": null,

"targetName": null

}

}

2.11.5查询CVK信息

接口地址

GET  /NSphere/api/host-resource/cvk/info

接口描述

查询CVK信息。E0930版本新增接口。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

hpId

数据中心ID。

query

false

integer(int64)

clusterId

集群ID。

query

false

integer(int64)

hostId

主机ID。

query

false

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseListApiCvkInfoVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

array

ApiCvkInfoVO

ntpStatus

NTP状态(running-运行种,not running-未运行)。

string

id

主机ID。

integer(int64)

name

主机名称。

string

hostProcess

主机进程信息。

ApiHostProcessVO

ApiHostProcessVO

ovsdbServerNum

ovsdb服务器进程数。

string

nsphereserverNum

Nsphereserver进程数。

string

ovsVswitchdNum

Ovs-vswitchd进程数。

string

libvirtNum

Libvirt进程数。

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": [

{

"ntpStatus": null,

"id": null,

"name": null,

"hostProcess": {

"ovsdbServerNum": null,

"nsphereserverNum": null,

"ovsVswitchdNum": null,

"libvirtNum": null

}

}

]

}

2.11.6查询管理平台信息

接口地址

GET  /NSphere/api/host-resource/cvm/info

接口描述

查询管理平台信息。E0930版本新增接口。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

暂无

响应状态

状态码

说明

schema

200

OK

ApiResponseApiCvmInfoVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiCvmInfoVO

ApiCvmInfoVO

failOverStatus

双机状态(normal-正常,offline-下线,syncing-同步中,abnormal-异常,error-未知错误,non failover config-无双机配置)。

string

cvmHaNum

管理平台HA进程数。

string

ntpStatus

NTP状态(running-运行中,not running-未运行)。

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"failOverStatus": null,

"cvmHaNum": null,

"ntpStatus": null

}

}

2.11.7获取主机详情

接口地址

GET  /NSphere/api/host-resource/detail/{id}

接口描述

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

id

主机ID

path

true

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseApiGetHostDetailVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiGetHostDetailVO

ApiGetHostDetailVO

id

主机ID

integer(int64)

user

用户名

string

hostPoolId

数据中心ID

integer(int64)

clusterId

集群ID

integer(int64)

name

主机名称

string

clusterName

集群名称

string

type

主机支持的Hypervisor类型(kvm,xen,esx)。

string

ip

主机IP地址

string

mask

主机子网掩码

string

model

主机型号

string

vendor

主机厂商

string

cpuCount

CPU总个数

integer(int32)

cpuModel

CPU型号

string

hostType

以16进制表示,右边第一位表示CPU架构,0:x86,1:ARM;第二位表示操作系统,0:Ubuntu,1:CentOS,2:NingOS,3:TOS。

integer(int32)

cpuFrequence

CPU频率(单位:MHz)

integer(int32)

diskSize

本地存储大小(单位:MB)

integer(int64)

vmNum

虚拟机数量

integer(int32)

cpuRate

主机CPU利用率(单位:%)

number(double)

memRate

主机内存利用率(单位:%)

number(double)

status

主机状态, 0:不正常,1:正常。

integer(int32)

runTime

运行时间

string

version

版本

string

cpuFrequenceGhz

CPU频率(GHz)

string

memory

内存大小(单位:MB)

integer(int64)

freeMemory

可用内存

string

storage

本地存储(单位:MB)

integer(int64)

freeStorage

本地空闲存储

string

ipAddr

主机IP地址

string

cpuSockets

CPU个数

integer(int32)

cpuCores

CPU核心数

integer(int32)

platForm

CVK版本号

string

enableBackupNetwork

是否有备份网络,并且下发备份网络。

boolean

nvmeNodeName

NVMe-oF存储适配器标识符

string

pnicList

array

ApiPhysicalNICVO

name

网卡名称

string

description

描述

string

status

状态。取值:1-活动;0-不活动 -1未知。

integer(int32)

macAddr

MAC地址

string

maintainMode

维护模式状态。0:不处于维护模式。1:处于维护模式。2:存储故障进入维护模式。

integer(int32)

quarantineMode

隔离模式状态(0:未进入隔离模式;1:界面进入的隔离模式;2:主动HA进入的隔离模式;12:既有主动HA进入的隔离模式,又有界面进入的隔离模式)

integer(int32)

vswitch0AsBusinessNet

vSwitch0作为业务网络

boolean

wakeCategory

唤醒类别(0:网络唤醒,1:IPMI唤醒)

integer(int32)

ipmiIpaddr

IPMI IP地址

string

ipmiUser

IPMI用户名

string

haEnable

是否启用高可靠性。0:非HA。1:在HA中。

integer(int32)

serialNumber

序列号

string

provider

主机供应商

string

occRate

主机存储使用率统计/vms分区信息(单位:%)

number(double)

topCpuRate

主机CPU利用率一个小时峰值(单位:%)

number(double)

topMemRate

主机内存利用率一个小时峰值(单位:%)

number(double)

monthAvgCpu

主机CPU月平均利用率(单位:%)

number(double)

monthAvgMem

主机内存月平均利用率(单位:%)

number(double)

monthTopCpu

主机CPU月峰值(单位:%)

number(double)

monthTopMem

主机内存月峰值(单位:%)

number(double)

cpuAllocRatio

CPU分配比(单位:%)

number(double)

memAllocRatio

内存分配比(单位:%)

number(double)

clusterDrsGroupId

集群DRS组ID

integer(int64)

cpuProvider

CPU供应商

string

allocation

已分配的存储空间(单位:MB)

integer(int64)

available

可用的存储空间(单位:MB)

integer(int64)

runningNum

主机上运行着的虚拟机个数(运行和暂停都算)。

integer(int32)

shutoffNum

主机上处于关闭状态的虚拟机个数。

integer(int32)

diskRate

磁盘利用率(单位:%)

number(double)

haRole

主机高可用角色/UIS界面的主机角色(NORMAL:普通节点,MASTER:主节点,SLAVE:备节点,ARBITRATOR:仲裁节点,UNKNOWN:未知节点) 可用值:NORMAL,MASTER,SLAVE,ARBITRATOR,UNKNOWN

string

businessRole

主机角色:0:计算型 1:融合型 2:存储型 -1:不承担任务计算、存储业务(纯管理)

integer(int32)

lowVer

是否是低版本主机(E0730/E0760)(true:是低版本主机,false:不是低版本主机)

boolean

hasPerm

当前操作员对该主机节点是否拥有权限

boolean

secretLevel

主机密级绝密(4)、机密(3)、秘密(2)、内部公开(1)

integer(int32)

cvkMaintain

CVK是否是维护模式。0:非维护模式。1:维护模式。

integer(int32)

iscsiNodeName

Open-iSCSI存储适配器标识符

string

cvkVersion

CVK版本

string

addTime

添加时间

string(date-time)

haResource

主机是否为HA故障切换主机:0,不是,1:是。

integer(int32)

ilos

主机iLO地址,多个用;分割。

string

storageIp

存储IP

string

patchVersions

补丁版本

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"id": null,

"user": null,

"hostPoolId": null,

"clusterId": null,

"name": null,

"clusterName": null,

"type": null,

"ip": null,

"mask": null,

"model": null,

"vendor": null,

"cpuCount": null,

"cpuModel": null,

"hostType": null,

"cpuFrequence": null,

"diskSize": null,

"vmNum": null,

"cpuRate": null,

"memRate": null,

"status": null,

"runTime": null,

"version": null,

"cpuFrequenceGhz": null,

"memory": null,

"freeMemory": null,

"storage": null,

"freeStorage": null,

"ipAddr": null,

"cpuSockets": null,

"cpuCores": null,

"platForm": null,

"enableBackupNetwork": true,

"nvmeNodeName": null,

"pnicList": [

{

"name": null,

"description": null,

"status": null,

"macAddr": null

}

],

"maintainMode": null,

"quarantineMode": null,

"vswitch0AsBusinessNet": true,

"wakeCategory": null,

"ipmiIpaddr": null,

"ipmiUser": null,

"haEnable": null,

"serialNumber": null,

"provider": null,

"occRate": null,

"topCpuRate": null,

"topMemRate": null,

"monthAvgCpu": null,

"monthAvgMem": null,

"monthTopCpu": null,

"monthTopMem": null,

"cpuAllocRatio": null,

"memAllocRatio": null,

"clusterDrsGroupId": null,

"cpuProvider": null,

"allocation": null,

"available": null,

"runningNum": null,

"shutoffNum": null,

"diskRate": null,

"haRole": null,

"businessRole": null,

"lowVer": true,

"hasPerm": true,

"secretLevel": null,

"cvkMaintain": null,

"iscsiNodeName": null,

"cvkVersion": null,

"addTime": null,

"haResource": null,

"ilos": null,

"storageIp": null,

"patchVersions": null

}

}

2.11.8主机进入维护模式

接口地址

PUT  /NSphere/api/host-resource/enter-maintenance

接口描述

请求数据类型

application/json

响应数据类型

application/json

请求示例

{

"id": 0,

"maintainMode": null

}

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

apiIntoMaintainDTO

ApiIntoMaintainDTO

body

true

ApiIntoMaintainDTO

ApiIntoMaintainDTO

id

主机ID

true

integer(int64)

maintainMode

默认值为0。进入维护模式对虚拟机的处理方式 0:不处理 1:自动迁移主机上运行或暂停的虚拟机到其它的主机。 2:自动迁移主机中处于关闭状态的虚拟机到其它的主机。 3:自动迁移主机上运行或暂停的虚拟机到其它的主机,并且自动迁移主机中处于关闭状态的虚拟机到其它的主机。

false

integer(int32)

响应状态

状态码

说明

schema

200

OK

ApiResponseApiTaskMsgVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiTaskMsgVO

ApiTaskMsgVO

msgId

消息ID,可用于查询任务进度。

integer(int64)

targetId

任务执行对象ID

integer(int64)

targetName

任务执行对象名称

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"msgId": 0,

"targetId": null,

"targetName": null

}

}

2.11.9主机退出维护模式

接口地址

PUT  /NSphere/api/host-resource/exit-maintenance

接口描述

请求数据类型

application/json

响应数据类型

application/json

请求示例

{

"id": 0

}

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

apiExitMaintainDTO

ApiExitMaintainDTO

body

true

ApiExitMaintainDTO

ApiExitMaintainDTO

id

主机ID

true

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseApiTaskMsgVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiTaskMsgVO

ApiTaskMsgVO

msgId

消息ID,可用于查询任务进度。

integer(int64)

targetId

任务执行对象ID

integer(int64)

targetName

任务执行对象名称

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"msgId": 0,

"targetId": null,

"targetName": null

}

}

2.11.10查询主机HBA信息

接口地址

GET  /NSphere/api/host-resource/hba/list

接口描述

查询主机HBA信息。唯一性指标:wwn;若wwn无数据则代表主机本地存储适配器,可用hostName, name组合。E0930版本新增接口。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

hpId

数据中心ID。

query

false

integer(int64)

clusterId

集群ID。

query

false

integer(int64)

hostId

主机ID。

query

false

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseApiStorageAdapterVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiStorageAdapterVO

ApiStorageAdapterVO

storageAdapters

存储适配器实体。

array

ApiAdapterVO

name

存储适配器名称。

string

model

存储型号 (NVMe-oF Software Adapter, iSCSI Software Adapter, Local SCSI)。

string

type

存储类型 (NVMe-oF,iSCSI,SCSI,FC)。

string

status

状态(Online表示在线/活动,其他为不活动)。

string

wwn

卡标识符,除本地外全局唯一。

string

speed

速率:Mbps。没有速率为空串,非活动状态为unknow。

string

hostName

主机名称。

string

software_fcoe

FCOE类型,1为软件FCOE,0为硬件FCOE。

integer(int32)

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"storageAdapters": [

{

"name": null,

"model": null,

"type": null,

"status": null,

"wwn": null,

"speed": null,

"hostName": null,

"software_fcoe": null

}

]

}

}

2.11.11查询主机列表

接口地址

GET  /NSphere/api/host-resource/list

接口描述

查询主机列表。E0930版本接口新增返回属性。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

clusterId

集群ID

query

false

integer(int64)

hpId

数据中心ID

query

false

integer(int64)

ids

主机ID列表,多个值用英文逗号分隔,如:1,2,3

query

false

array

integer

notinIds

查询非该组id的其他主机,多个值用英文逗号分隔,如:1,2,3

query

false

array

integer

status

主机状态, 0:不正常,1:正常。

query

false

integer(int32)

ipAddr

主机IP地址

query

false

string

operatorGroupCode

操作员分组编码

query

false

string

offset

偏移量。指定从第几条记录开始返回。

query

false

integer(int32)

limit

每页返回的最大记录数。

query

false

integer(int32)

sortDir

排序类型,0:不排序,1:升序,2:降序,sortField不为空时默认不排序。

query

false

integer(int32)

sortField

排序字段。支持字段:name。

query

false

string

响应状态

状态码

说明

schema

200

OK

ApiResponseApiPagingListResultApiGetHostVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiPagingListResultApiGetHostVO

ApiPagingListResultApiGetHostVO

data

array

ApiGetHostVO

id

主机ID

integer(int64)

user

用户名

string

hostPoolId

数据中心ID

integer(int64)

clusterId

集群ID

integer(int64)

name

主机名称

string

ip

主机IP地址

string

cpuCount

CPU总个数

integer(int32)

cpuModel

CPU型号

string

hostType

以16进制表示,右边第一位表示CPU架构,0:x86,1:ARM;第二位表示操作系统,0:Ubuntu,1:CentOS,2:NingOS,3:TOS。

integer(int32)

memorySize

内存大小,单位为MB

integer(int64)

vmNum

虚拟机数量

integer(int32)

vmRunCount

主机下运行的虚拟机数量

integer(int32)

vmShutoff

主机下关闭的虚拟机数量

integer(int32)

cpuRate

主机CPU利用率(单位:%)

number(double)

memRate

主机内存利用率(单位:%)

number(double)

status

主机状态, 0:不正常,1:正常。

integer(int32)

runTime

运行时间

string

version

版本

string

storageCapacity

主机本地存储容量(MB)

integer(int64)

enableHA

是否启用高可用

integer(int32)

mcNetAddr

管理网络地址

string

cpuSockets

CPU个数

integer(int32)

cpuCores

CPU核心数

integer(int32)

platForm

CVK版本号

string

enableStorNode

是否启用存储节点

boolean

enableBackupNetwork

是否有备份网络,并且下发备份网络。

boolean

nvmeNodeName

NVMe-oF存储适配器标识符

string

maintainMode

维护模式状态。0:不处于维护模式。1:处于维护模式。2:存储故障进入维护模式。

integer(int32)

quarantineMode

隔离模式状态(0:未进入隔离模式;1:界面进入的隔离模式;2:主动HA进入的隔离模式;12:既有主动HA进入的隔离模式,又有界面进入的隔离模式)

integer(int32)

vswitch0AsBusinessNet

vSwitch0作为业务网络

boolean

wakeCategory

唤醒类别(0:网络唤醒,1:IPMI唤醒)

integer(int32)

ipmiIpaddr

IPMI IP地址

string

ipmiUser

IPMI用户名

string

haEnable

是否启用高可靠性。0:非HA。1:在HA中。

integer(int32)

serialNumber

序列号

string

provider

主机供应商

string

otherNum

未知状态的虚拟机数量

integer(int32)

occRate

主机存储使用率统计/vms分区信息(单位:%)

number(double)

topCpuRate

主机CPU利用率一个小时峰值(单位:%)

number(double)

topMemRate

主机内存利用率一个小时峰值(单位:%)

number(double)

monthAvgCpu

主机CPU月平均利用率(单位:%)

number(double)

monthAvgMem

主机内存月平均利用率(单位:%)

number(double)

monthTopCpu

主机CPU月峰值(单位:%)

number(double)

monthTopMem

主机内存月峰值(单位:%)

number(double)

cpuAllocRatio

CPU分配比(单位:%)

number(double)

memAllocRatio

内存分配比(单位:%)

number(double)

clusterDrsGroupId

集群DRS组ID

integer(int64)

frequency

CPU频率(MHz)

integer(int32)

cpuProvider

CPU供应商

string

detail

CPU型号

string

allocation

已分配的存储空间(单位:MB)

integer(int64)

available

可用的存储空间(单位:MB)

integer(int64)

cvkMaintain

CVK是否是维护模式。0:非维护模式。1:维护模式。

integer(int32)

iscsiNodeName

Open-iSCSI存储适配器标识符

string

cvkVersion

CVK版本

string

addTime

添加时间

string(date-time)

haResource

主机是否为HA故障切换主机:0,不是,1:是。

integer(int32)

ilos

主机iLO地址,多个用;分割。

string

storageIp

存储IP

string

hypervisorType

主机支持的虚拟化管理程序类型类型(kvm,xen,esx) E0930版本新增属性。

string

diskSizeFormat

主机本地存储大小的格式化展示,会自动根据本地存储大小匹配单位,如:20.1GB、10.12MB、50.08TB。 E0930版本新增属性。

string

storageRate

存储使用率(单位:%)。 E0930版本新增属性。

string

offset

偏移量。指定从第几条记录开始返回。

integer(int32)

size

当前返回的记录数。

integer(int32)

total

数据总量

integer(int64)

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"data": [

{

"id": null,

"user": null,

"hostPoolId": null,

"clusterId": null,

"name": null,

"ip": null,

"cpuCount": null,

"cpuModel": null,

"hostType": null,

"memorySize": null,

"vmNum": null,

"vmRunCount": null,

"vmShutoff": null,

"cpuRate": null,

"memRate": null,

"status": null,

"runTime": null,

"version": null,

"storageCapacity": null,

"enableHA": null,

"mcNetAddr": null,

"cpuSockets": null,

"cpuCores": null,

"platForm": null,

"enableStorNode": true,

"enableBackupNetwork": true,

"nvmeNodeName": null,

"maintainMode": null,

"quarantineMode": null,

"vswitch0AsBusinessNet": true,

"wakeCategory": null,

"ipmiIpaddr": null,

"ipmiUser": null,

"haEnable": null,

"serialNumber": null,

"provider": null,

"otherNum": null,

"occRate": null,

"topCpuRate": null,

"topMemRate": null,

"monthAvgCpu": null,

"monthAvgMem": null,

"monthTopCpu": null,

"monthTopMem": null,

"cpuAllocRatio": null,

"memAllocRatio": null,

"clusterDrsGroupId": null,

"frequency": null,

"cpuProvider": null,

"detail": null,

"allocation": null,

"available": null,

"cvkMaintain": null,

"iscsiNodeName": null,

"cvkVersion": null,

"addTime": null,

"haResource": null,

"ilos": null,

"storageIp": null,

"hypervisorType": null,

"diskSizeFormat": null,

"storageRate": null

}

],

"offset": null,

"size": null,

"total": null

}

}

2.11.12查询主机物理网卡信息

接口地址

GET  /NSphere/api/host-resource/nics

接口描述

根据hpId/clusterId/hostId查询主机物理网卡信息,不传默认查所有主机。若同时传多个参数优先使用hostId查询,若没有传hostId将使用hpId和clusterId组合查询。E0930版本新增接口。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

clusterId

集群ID

query

false

integer(int64)

hpId

数据中心ID

query

false

integer(int64)

hostId

主机ID

query

false

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseListApiHostPhysicalNICVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

array

ApiHostPhysicalNICVO

name

网卡名称

string

description

描述

string

status

状态。取值:1-活动;0-不活动 -1未知。

integer(int32)

macAddr

MAC地址

string

speed

速度(Mbps)

string

duplex

双工模式,full:全双工,half:半双工,unknown:未知

string

carrier

载波状态,off:关闭,on:启用

string

mtu

最大传输单元,一次能传输的最大数据包大小,单位为字节。

string

rxFlow

接收流量(单位:Mbp)

number(double)

txFlow

发送流量(单位:Mbp)

number(double)

hostId

主机ID

integer(int64)

hostName

主机名称

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": [

{

"name": null,

"description": null,

"status": null,

"macAddr": null,

"speed": null,

"duplex": null,

"carrier": null,

"mtu": null,

"rxFlow": null,

"txFlow": null,

"hostId": null,

"hostName": null

}

]

}

2.11.13查询主机分区

接口地址

GET  /NSphere/api/host-resource/partitions

接口描述

查询主机分区信息。如果同时传入了主机ID、集群ID和数据中心ID,系统将以主机ID为准。E0930版本新增接口。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

hpId

数据中心ID

query

false

integer(int64)

clusterId

集群ID

query

false

integer(int64)

hostId

主机ID

query

false

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseListApiHostPartitionVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

array

ApiHostPartitionVO

hostId

主机ID

integer(int64)

hostName

主机名称

string

clusterId

集群ID

integer(int64)

hostPoolId

数据中心ID

integer(int64)

partitionName

分区名称

string

utilization

分区占用率(单位:%)

number(double)

size

分区容量

string

used

分区已使用空间

string

partitionType

分区类型

string

mountedDir

分区挂载目录

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": [

{

"hostId": null,

"hostName": null,

"clusterId": null,

"hostPoolId": null,

"partitionName": null,

"utilization": null,

"size": null,

"used": null,

"partitionType": null,

"mountedDir": null

}

]

}

2.11.14查询管理平台版本号

接口地址

GET  /NSphere/api/host-resource/query-version

接口描述

查询管理平台版本号。返回值中的data是由三个字符串组成的数组,分别代表:管理平台版本号、版本类型、内部版本号。E0930版本新增接口。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

暂无

响应状态

状态码

说明

schema

200

OK

ApiResponseListString

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

array

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": []

}

2.11.15查询CVK外挂存储信息

接口地址

GET  /NSphere/api/host-resource/shareFile/stat

接口描述

查询CVK外挂存储信息。只查询共享文件系统。如果同时传入了主机ID、集群ID和数据中心ID,系统将以主机ID为准。E0930版本新增接口。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

hpId

数据中心ID。

query

false

integer(int64)

clusterId

集群ID。

query

false

integer(int64)

hostId

主机ID。

query

false

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseListApiStorageStatVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

array

ApiStorageStatVO

name

存储名称。

string

hostName

主机名称。

string

clusterId

集群Id。

integer(int64)

rdStat

读速率:KBps。

number(double)

wrStat

写速率:KBps。

number(double)

rdReq

IPOS读请求(每秒)。

number(double)

wrReq

IPOS写请求(每秒)。

number(double)

rdLatency

读延迟速率:ms。

number(double)

wrLatency

写延迟速率:ms。

number(double)

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": [

{

"name": null,

"hostName": null,

"clusterId": null,

"rdStat": null,

"wrStat": null,

"rdReq": null,

"wrReq": null,

"rdLatency": null,

"wrLatency": null

}

]

}

2.11.16获取主机概览信息

接口地址

GET  /NSphere/api/host-resource/summary/{id}

接口描述

获取主机概览信息。E0930版本接口新增返回属性。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

id

主机ID

path

true

integer(int64)

响应状态

状态码

说明

schema

200

OK

ApiResponseApiGetHostSummaryVO

响应参数

参数名称

参数说明

类型

schema

state

状态码 0: 成功, 1: 失败, 2: 部分成功

integer(int32)

integer(int32)

errorCode

错误码 当不为0表示业务发生错误

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

错误消息,失败或者部分成功时有效.

string

data

响应数据,如果状态码为0表示正常的数据返回,如果非0且非空则代表引起异常的必要数据

ApiGetHostSummaryVO

ApiGetHostSummaryVO

id

主机ID

integer(int64)

hostpoolId

数据中心ID

integer(int64)

clusterId

集群ID

integer(int64)

name

主机名称

string

occRate

主机存储使用率统计/vms分区信息(单位:%)

number(double)

memorySuperRatio

内存超分比(单位:%)

number(double)

cpuSuperRatio

CPU超分比(单位:%)

number(double)

freeStorage

本地空闲存储

string

freeMemory

可用内存

string

memory

内存大小(单位:MB)

integer(int64)

cpuFrequenceGhz

CPU频率(GHz)

string

cpuNum

CPU数量

string

model

主机型号

string

vendor

主机厂商

string

cpuFrequence

CPU频率(单位:MHz)

integer(int32)

diskSize

本地存储大小(单位:MB)

integer(int64)

version

版本

string

isSafeArea

是否为安全区域

boolean

systemTime

系统时间

string

runTime

运行时间

string

vmShutoff

主机下关闭的虚拟机数量

integer(int32)

vmRunCount

主机下运行的虚拟机数量

integer(int32)

vmNum

虚拟机数量

integer(int32)

ipAddr

主机IP地址

string

user

用户名

string

secretLevel

主机密级绝密(4)、机密(3)、秘密(2)、内部公开(1)

integer(int32)

cpu

CPU总个数

integer(int32)

cpuCores

CPU核心数

integer(int32)

cpuSockets

CPU个数

integer(int32)

storage

本地存储(单位:MB)

integer(int64)

status

主机状态, 0:不正常,1:正常。

integer(int32)

maintain

维护模式状态。0:不处于维护模式。1:处于维护模式。2:存储故障进入维护模式。

integer(int32)

cvkMaintain

CVK是否是维护模式。0:非维护模式。1:维护模式。

integer(int32)

haEnable

是否启用高可靠性。0:非HA。1:在HA中。

integer(int32)

cpuProvider

CPU供应商

string

detail

CPU型号

string

provider

主机供应商

string

operatorGroupId

操作员分组ID

integer(int64)

operatorGroupCode

操作员分组编码

string

iscsiNodeName

Open-iSCSI存储适配器标识符

string

mac

主机MAC地址

string

cvkVersion

CVK版本

string

addTime

添加时间

string(date-time)

storageIp

存储IP

string

ilos

主机iLO地址,多个用;分割。

string

syncMark

同步状态 0:未同步 1:已同步

integer(int32)

nvmeNodeName

NVMe-oF存储适配器标识符

string

businessRole

主机类型。0:计算型。1:融合型。2:存储型。-1:管理型。 E0930版本新增属性。

integer(int32)

mode

主机角色。NORMAL:普通节点。MASTER:主节点。SLAVE:备节点。ARBITRATOR:仲裁节点。UNKNOWN:未知节点。 E0930版本新增属性。

string

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"id": null,

"hostpoolId": null,

"clusterId": null,

"name": null,

"occRate": null,

"memorySuperRatio": null,

"cpuSuperRatio": null,

"freeStorage": null,

"freeMemory": null,

"memory": null,

"cpuFrequenceGhz": null,

"cpuNum": null,

"model": null,

"vendor": null,

"cpuFrequence": null,

"diskSize": null,

"version": null,

"isSafeArea": true,

"systemTime": null,

"runTime": null,

"vmShutoff": null,

"vmRunCount": null,

"vmNum": null,

"ipAddr": null,

"user": null,

"secretLevel": null,

"cpu": null,

"cpuCores": null,

"cpuSockets": null,

"storage": null,

"status": null,

"maintain": null,

"cvkMaintain": null,

"haEnable": null,

"cpuProvider": null,

"detail": null,

"provider": null,

"operatorGroupId": null,

"operatorGroupCode": null,

"iscsiNodeName": null,

"mac": null,

"cvkVersion": null,

"addTime": null,

"storageIp": null,

"ilos": null,

"syncMark": null,

"nvmeNodeName": null,

"businessRole": null,

"mode": null

}

}