VMware管理以单独的功能模块形式提供,需提前购买VMware管理模块许可证,且需在购买云平台许可证基础上使用,不可单独使用。
POST zstack/v1/vcentersAuthorization: OAuth the-session-uuid{ "params": { "username": "admin@vsphere-local.net", "password": "test-pass", "zoneUuid": "25b9e68b1cc43836a79f1a35e3108880", "name": "vc1", "https": true, "domainName": "vsphere-local.net" }, "systemTags": [], "userTags": [] }curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"username":"admin@vsphere-local.net","password":"test-pass","zoneUuid":"25b9e68b1cc43836a79f1a35e3108880","name":"vc1","https":true,"domainName":"vsphere-local.net"}}' \ http://localhost:8080/zstack/v1/vcenters| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| username | String | body(包含在params结构中) | 登录 vCenter 用户名 | 0.6 | |
| password | String | body(包含在params结构中) | 登录 vCenter 用户密码 | 0.6 | |
| zoneUuid | String | body(包含在params结构中) | vCenter 将要添加至的目标区域UUID | 0.6 | |
| name | String | body(包含在params结构中) | vCenter 的名称 | 0.6 | |
| https (可选) | boolean | body(包含在params结构中) | 是否启用 HTTPS 登录(默认开启) | 0.6 | |
| domainName | String | body(包含在params结构中) | vCenter 域名 | 0.6 | |
| description (可选) | String | body(包含在params结构中) | vCenter 的详细描述 | 0.6 | |
| resourceUuid (可选) | String | body(包含在params结构中) | vCenter 的UUID。若指定,云主机会使用该字段值作为UUID。 | 0.6 | |
| systemTags (可选) | List | body | 系统标签 | 0.6 | |
| userTags (可选) | List | body | 用户标签 | 0.6 | |
| port (可选) | Integer | body(包含在params结构中) | 0.6 |
{ "inventory": { "uuid": "1497ae9206ea3f82bb13c34c307299b9", "name": "vc1", "domainName": "vsphere-local.net", "userName": "admin@vsphere-local.net", "https": true, "state": "Enabled", "status": "Connected" }, "skippedResources": { "vmInstances": [ { "uuid": "example", "name": "exampleVm" } ] } }| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 4.5.3 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
| inventory | VCenterInventory | 详情参考inventory | 0.6 |
| skippedResources | SkippedResources | 详情参考skippedResources | 4.5.3 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| name | String | 资源名称 | 0.6 |
| description | String | 资源的详细描述 | 0.6 |
| domainName | String | 0.6 | |
| port | Integer | 0.6 | |
| userName | String | 0.6 | |
| zoneUuid | String | 区域UUID | 0.6 |
| https | Boolean | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| vmInstances | Set | 详情参考vmInstances | 4.5.3 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 4.5.3 |
| name | String | 资源名称 | 4.5.3 |
| description | String | 资源的详细描述 | 4.5.3 |
| zoneUuid | String | 区域UUID | 4.5.3 |
| clusterUuid | String | 集群UUID | 4.5.3 |
| imageUuid | String | 镜像UUID | 4.5.3 |
| hostUuid | String | 物理机UUID | 4.5.3 |
| lastHostUuid | String | 4.5.3 | |
| instanceOfferingUuid | String | 计算规格UUID | 4.5.3 |
| rootVolumeUuid | String | 根云盘UUID | 4.5.3 |
| platform | String | 4.5.3 | |
| architecture | String | 架构类型 | 4.5.3 |
| defaultL3NetworkUuid | String | 4.5.3 | |
| type | String | 4.5.3 | |
| hypervisorType | String | 4.5.3 | |
| memorySize | Long | 4.5.3 | |
| cpuNum | Integer | 4.5.3 | |
| cpuSpeed | Long | 4.5.3 | |
| allocatorStrategy | String | 4.5.3 | |
| createDate | Timestamp | 创建时间 | 4.5.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 4.5.3 |
| state | String | 4.5.3 | |
| guestOsType | String | 操作系统类型 | 4.5.3 |
| vmNics | List | 详情参考vmNics | 4.5.3 |
| allVolumes | List | 详情参考allVolumes | 4.5.3 |
| vmCdRoms | List | 详情参考vmCdRoms | 4.5.3 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 4.5.3 |
| vmInstanceUuid | String | 云主机UUID | 4.5.3 |
| l3NetworkUuid | String | 三层网络UUID | 4.5.3 |
| ip | String | IP地址 | 4.5.3 |
| mac | String | MAC地址 | 4.5.3 |
| hypervisorType | String | 虚拟化类型 | 4.5.3 |
| netmask | String | 子网掩码 | 4.5.3 |
| gateway | String | 网关 | 4.5.3 |
| metaData | String | 4.5.3 | |
| ipVersion | Integer | IP地址版本 | 4.5.3 |
| deviceId | Integer | 设备ID | 4.5.3 |
| type | String | 网卡类型 | 4.5.3 |
| createDate | Timestamp | 创建时间 | 4.5.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 4.5.3 |
| usedIps | List | 详情参考usedIps | 4.5.3 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 4.5.3 |
| ipRangeUuid | String | IP段UUID | 4.5.3 |
| l3NetworkUuid | String | 三层网络UUID | 4.5.3 |
| ipVersion | Integer | IP协议号 | 4.5.3 |
| ip | String | IP地址 | 4.5.3 |
| netmask | String | 网络掩码 | 4.5.3 |
| gateway | String | 网关地址 | 4.5.3 |
| usedFor | String | 4.5.3 | |
| ipInLong | long | 4.5.3 | |
| vmNicUuid | String | 云主机网卡UUID | 4.5.3 |
| createDate | Timestamp | 创建时间 | 4.5.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 4.5.3 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 4.5.3 |
| name | String | 资源名称 | 4.5.3 |
| description | String | 资源的详细描述 | 4.5.3 |
| primaryStorageUuid | String | 主存储UUID | 4.5.3 |
| vmInstanceUuid | String | 云主机UUID | 4.5.3 |
| diskOfferingUuid | String | 云盘规格UUID | 4.5.3 |
| rootImageUuid | String | 云盘根镜像UUID | 4.5.3 |
| installPath | String | 云盘在主存储上的路径 | 4.5.3 |
| type | String | 云盘类型,数据云盘/根云盘 | 4.5.3 |
| format | String | 云盘格式 | 4.5.3 |
| size | Long | 云盘大小 | 4.5.3 |
| actualSize | Long | 云盘真实大小 | 4.5.3 |
| deviceId | Integer | 4.5.3 | |
| state | String | 云盘是否开启 | 4.5.3 |
| status | String | 云盘状态 | 4.5.3 |
| createDate | Timestamp | 创建时间 | 4.5.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 4.5.3 |
| isShareable | Boolean | 是否共享云盘 | 4.5.3 |
| volumeQos | String | 云盘QoS,格式如total=1048576 | 4.5.3 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 4.5.3 |
| vmInstanceUuid | String | 云主机UUID | 4.5.3 |
| deviceId | Integer | 光驱顺序号 | 4.5.3 |
| isoUuid | String | ISO镜像UUID | 4.5.3 |
| isoInstallPath | String | ISO镜像挂载路径 | 4.5.3 |
| name | String | 资源名称 | 4.5.3 |
| description | String | 资源的详细描述 | 4.5.3 |
| createDate | Timestamp | 创建时间 | 4.5.3 |
| lastOpDate | Timestamp | 最后一次修改时间 | 4.5.3 |
AddVCenterAction action = new AddVCenterAction(); action.username = "admin@vsphere-local.net"; action.password = "test-pass"; action.zoneUuid = "25b9e68b1cc43836a79f1a35e3108880"; action.name = "vc1"; action.https = true; action.domainName = "vsphere-local.net"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; AddVCenterAction.Result res = action.call();AddVCenterAction action = AddVCenterAction() action.username = "admin@vsphere-local.net" action.password = "test-pass" action.zoneUuid = "25b9e68b1cc43836a79f1a35e3108880" action.name = "vc1" action.https = true action.domainName = "vsphere-local.net" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" AddVCenterAction.Result res = action.call()GET zstack/v1/vcenters GET zstack/v1/vcenters/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth e46c3ba50f324bcbabda6c40d11d1e33" \ -X GET http://localhost:8080/zstack/v1/vcenters?q=uuid=7e580c2f8b6c4e31aff447c45c72c3bbcurl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth d0552ed3feb243a1b87fcff421388964" \ -X GET http://localhost:8080/zstack/v1/vcenters/bb39998d05004cd9aa5bf816cc308ed1可查询字段
运行CLI命令行工具,输入QueryVCenter并按Tab键查看所有可查询字段以及可跨表查询的资源名。
{ "inventories": [ { "uuid": "b84429ea486d3e878afd4175bff667e0", "name": "vc1", "domainName": "vsphere-local.net", "userName": "admin@vsphere-local.net", "version": "6.0.0", "https": true, "state": "Enabled", "status": "Connected" } ] }| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.9.0 |
| inventories | List | 详情参考inventories | 3.9.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.9.0 |
| description | String | 错误的概要描述 | 3.9.0 |
| details | String | 错误的详细信息 | 3.9.0 |
| elaboration | String | 保留字段,默认为null | 3.9.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.9.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.9.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.9.0 |
| name | String | 资源名称 | 3.9.0 |
| description | String | 资源的详细描述 | 3.9.0 |
| domainName | String | 3.9.0 | |
| port | Integer | 3.9.0 | |
| userName | String | 3.9.0 | |
| zoneUuid | String | 区域UUID | 3.9.0 |
| version | String | vCenter版本 | 3.9.0 |
| https | Boolean | 3.9.0 | |
| state | String | 3.9.0 | |
| status | String | 3.9.0 | |
| createDate | Timestamp | 创建时间 | 3.9.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.9.0 |
QueryVCenterAction action = new QueryVCenterAction(); action.conditions = asList("uuid=70118e1db5084255a0e44c7af24d57b7"); action.sessionId = "10dbde6695b74150878bec7cbe97eda5"; QueryVCenterAction.Result res = action.call();QueryVCenterAction action = QueryVCenterAction() action.conditions = ["uuid=4e5f668c85be4bb4a1b5990611ad806b"] action.sessionId = "708e5e17b29a4527a8480faadd49fdbc" QueryVCenterAction.Result res = action.call()学习路径
ZStack Cloud 产品学习路径
快速梳理文档,点击相应文本链接,快速跳转到相应文档的页面,学习 ZStack Cloud 产品。
业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1ZStack学院:
training@zstack.io业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io业务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io下载链接已发送至您的邮箱。
如未收到,请查看您的垃圾邮件、订阅邮件、广告邮件。 当您收到电子邮件后,请点击 URL 链接,以完成下载。感谢您使用 ZStack 产品和服务。
成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。
信息提交成功。
我们将安排工作人员尽快与您取得联系,请保持电话畅通。感谢您使用 ZStack 产品和服务。
商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。