跳到主要内容

数据中心

2.7.1查询数据中心详情

接口地址

GET  /NSphere/api/hostpool-resource

接口描述

id和hostpoolName两个参数必须要传其中一个,如果两个参数都传,则以id为准。

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

id

数据中心ID。

query

false

integer(int64)

hostpoolName

数据中心名称。(已废弃,建议使用‘title’)

query

false

string

title

数据中心名称。

query

false

string

响应状态

状态码

说明

schema

200

OK

ApiResponseApiGetHostpoolDetailVO

响应参数

参数名称

参数说明

类型

schema

state

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

integer(int32)

integer(int32)

errorCode

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

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

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

string

data

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

ApiGetHostpoolDetailVO

ApiGetHostpoolDetailVO

summary

ApiGetHostpoolSummaryVO

ApiGetHostpoolSummaryVO

hostNum

主机数量

string

cpuNum

CPU总核数

string

memTotal

总内存

string

storageTotal

本地总存储

string

avaiStorageTotal

本地总可用存储

string

domainNum

虚拟机数量

string

runDomainNum

运行的虚拟机数量

string

shutoffDomainNum

关闭的虚拟机数量

string

memSuperRatio

内存分配比(%)

string

cpuSuperRatio

CPU分配比(%)

string

storageSuperRatio

共享存储分配比 (%)

string

cpuUsed

CPU利用率(%)

string

memoryUsed

内存利用率(%)

string

storageUsed

存储利用率(%)

string

clusterNum

集群数量

string

domainDensity

虚拟机密度

string

info

ApiGetHostpoolVO

ApiGetHostpoolVO

id

数据中心ID。

integer(int64)

name

数据中心名称。 数据中心名称。(已废弃,建议使用‘title’)

string

title

数据中心显示名称。

string

operatorGroupId

操作员分组ID。

integer(int64)

operatorGroupCode

操作员分组编码。

string

publicCloudId

外部云资源ID

integer(int64)

storageIp

存储网IP。

string

storageMask

存储网掩码。

string

childNum

数据中心直接子节点数量。数据中心下一级的主机和集群数量。

integer(int32)

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": {

"summary": {

"hostNum": null,

"cpuNum": null,

"memTotal": null,

"storageTotal": null,

"avaiStorageTotal": null,

"domainNum": null,

"runDomainNum": null,

"shutoffDomainNum": null,

"memSuperRatio": null,

"cpuSuperRatio": null,

"storageSuperRatio": null,

"cpuUsed": null,

"memoryUsed": null,

"storageUsed": null,

"clusterNum": null,

"domainDensity": null

},

"info": {

"id": null,

"name": null,

"title": null,

"operatorGroupId": null,

"operatorGroupCode": null,

"publicCloudId": null,

"storageIp": null,

"storageMask": null,

"childNum": null

}

}

}

2.7.2增加数据中心

接口地址

POST  /NSphere/api/hostpool-resource

接口描述

如果执行成功,返回数据为新增数据中心ID。

请求数据类型

application/json

响应数据类型

application/json

请求示例

{

"title": ""

}

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

apiAddHostpoolDTO

ApiAddHostpoolDTO

body

true

ApiAddHostpoolDTO

ApiAddHostpoolDTO

title

数据中心名称。最小长度为1,最大长度为32。只允许输入汉字、字母、数字、减号、下划线及点,首字符不能为减号和点,且不允许全部是数字。

true

string

响应状态

状态码

说明

schema

200

OK

ApiResponseLong

响应参数

参数名称

参数说明

类型

schema

state

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

integer(int32)

integer(int32)

errorCode

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

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

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

string

data

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

integer(int64)

integer(int64)

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": null

}

2.7.3修改数据中心

接口地址

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

接口描述

请求数据类型

application/json

响应数据类型

application/json

请求示例

{

"title": ""

}

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

id

数据中心ID。

path

true

integer(int64)

apiModifyHostpoolDTO

ApiModifyHostpoolDTO

body

true

ApiModifyHostpoolDTO

ApiModifyHostpoolDTO

title

数据中心名称。 最大长度为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.7.4删除数据中心

接口地址

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

接口描述

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

id

数据中心ID。

path

true

integer(int64)

响应状态

状态码

说明

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.7.5查询数据中心列表

接口地址

GET  /NSphere/api/hostpool-resource/list

接口描述

请求数据类型

application/x-www-form-urlencoded

响应数据类型

application/json

请求参数

参数名称

参数说明

请求类型

必须

数据类型

schema

ids

数据中心ID列表。不传默认查所有。

query

false

array

integer

响应状态

状态码

说明

schema

200

OK

ApiResponseListApiGetHostpoolVO

响应参数

参数名称

参数说明

类型

schema

state

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

integer(int32)

integer(int32)

errorCode

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

integer(int32)

integer(int32)

successMessage

成功消息

string

failureMessage

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

string

data

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

array

ApiGetHostpoolVO

id

数据中心ID。

integer(int64)

name

数据中心名称。 数据中心名称。(已废弃,建议使用‘title’)

string

title

数据中心显示名称。

string

operatorGroupId

操作员分组ID。

integer(int64)

operatorGroupCode

操作员分组编码。

string

publicCloudId

外部云资源ID

integer(int64)

storageIp

存储网IP。

string

storageMask

存储网掩码。

string

childNum

数据中心直接子节点数量。数据中心下一级的主机和集群数量。

integer(int32)

响应示例

{

"state": 0,

"errorCode": 0,

"successMessage": null,

"failureMessage": null,

"data": [

{

"id": null,

"name": null,

"title": null,

"operatorGroupId": null,

"operatorGroupCode": null,

"publicCloudId": null,

"storageIp": null,

"storageMask": null,

"childNum": null

}

]

}