The VMware Management feature is provided in a separate module. Before you can use this feature, you need to purchase the Plus License of VMware Management, in addition to the Base License.
POST zstack/v1/vcenters
Authorization: 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
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
username | String | body (contained in the params structure) | The user name used to log in to the vCenter. | 0.6 | |
password | String | body (contained in the params structure) | The password used to log in to the vCenter. | 0.6 | |
zoneUuid | String | body (contained in the params structure) | The UUID of the zone to which the vCenter is added. | 0.6 | |
name | String | body (contained in the params structure) | The name of the vCenter. | 0.6 | |
https | boolean | body (contained in the params structure) | Optional. Whether to enable HTTPS login. By default, HTTPS login is enabled. | 0.6 | |
domainName | String | body (contained in the params structure) | The domain name of the vCenter. | 0.6 | |
description | String | body (contained in the params structure) | Optional. The detailed description of the vCenter. | 0.6 | |
resourceUuid | String | body (contained in the params structure) | Optional. The vCenter UUID. If specified, the VM instance will use the specified value as the UUID. | 0.6 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 | |
port | Integer | body (contained in the params structure) | Optional. | 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" } ] } }
Name | Type | Description | Starting Version |
---|---|---|---|
success | boolean | 4.5.3 | |
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
inventory | VCenterInventory | See inventory. | 0.6 |
skippedResources | SkippedResources | For more information, see skippedResources. | 4.5.3 |
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
description | String | The brief description of the error. | 0.6 |
details | String | The details about the error. | 0.6 |
elaboration | String | The reserved field. Default value: null. | 0.6 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 0.6 |
name | String | The resource name. | 0.6 |
description | String | The detailed description of the resource. | 0.6 |
domainName | String | 0.6 | |
port | Integer | 0.6 | |
userName | String | 0.6 | |
zoneUuid | String | The zone UUID. | 0.6 |
https | Boolean | 0.6 | |
state | String | 0.6 | |
status | String | 0.6 | |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
Name | Type | Description | Starting Version |
---|---|---|---|
vmInstances | Set | For more information, see vmInstances. | 4.5.3 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 4.5.3 |
name | String | The resource name. | 4.5.3 |
description | String | The detailed description of the resource. | 4.5.3 |
zoneUuid | String | The zone UUID. | 4.5.3 |
clusterUuid | String | The cluster UUID. | 4.5.3 |
imageUuid | String | The image UUID. | 4.5.3 |
hostUuid | String | The host UUID. | 4.5.3 |
lastHostUuid | String | 4.5.3 | |
instanceOfferingUuid | String | The instance offering UUID. | 4.5.3 |
rootVolumeUuid | String | The root volume UUID. | 4.5.3 |
platform | String | 4.5.3 | |
architecture | String | The architecture type. | 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 | The creation time. | 4.5.3 |
lastOpDate | Timestamp | The last operation time. | 4.5.3 |
state | String | 4.5.3 | |
guestOsType | String | The operating system type. | 4.5.3 |
vmNics | List | For more information, see vmNics. | 4.5.3 |
allVolumes | List | For more information, see allVolumes. | 4.5.3 |
vmCdRoms | List | For more information, see vmCdRoms. | 4.5.3 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 4.5.3 |
vmInstanceUuid | String | The VM instance UUID. | 4.5.3 |
l3NetworkUuid | String | The L3 network UUID. | 4.5.3 |
ip | String | The IP address. | 4.5.3 |
mac | String | The MAC address. | 4.5.3 |
hypervisorType | String | The hypervisor type. | 4.5.3 |
netmask | String | The sub network mask. | 4.5.3 |
gateway | String | The gateway. | 4.5.3 |
metaData | String | 4.5.3 | |
ipVersion | Integer | The IP address. | 4.5.3 |
deviceId | Integer | The device ID. | 4.5.3 |
type | String | The NIC type. | 4.5.3 |
createDate | Timestamp | The creation time. | 4.5.3 |
lastOpDate | Timestamp | The last operation time. | 4.5.3 |
usedIps | List | For more information, see usedIps. | 4.5.3 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 4.5.3 |
ipRangeUuid | String | The IP range UUID. | 4.5.3 |
l3NetworkUuid | String | The L3 network UUID. | 4.5.3 |
ipVersion | Integer | The IP version. | 4.5.3 |
ip | String | The IP address. | 4.5.3 |
netmask | String | The network mask. | 4.5.3 |
gateway | String | The gateway address | 4.5.3 |
usedFor | String | 4.5.3 | |
ipInLong | long | 4.5.3 | |
vmNicUuid | String | The UUID of the VM instance NIC. | 4.5.3 |
createDate | Timestamp | The creation time. | 4.5.3 |
lastOpDate | Timestamp | The last operation time. | 4.5.3 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 4.5.3 |
name | String | The resource name. | 4.5.3 |
description | String | The detailed description of the resource. | 4.5.3 |
primaryStorageUuid | String | The primary storage UUID. | 4.5.3 |
vmInstanceUuid | String | The VM instance UUID. | 4.5.3 |
diskOfferingUuid | String | The disk offering UUID. | 4.5.3 |
rootImageUuid | String | The root image UUID. | 4.5.3 |
installPath | String | The mount path of the volume on the primary storage. | 4.5.3 |
type | String | The volume type, including data volume and root volume. | 4.5.3 |
format | String | The volume format. | 4.5.3 |
size | Long | The volume size. | 4.5.3 |
actualSize | Long | The volume actual size. | 4.5.3 |
deviceId | Integer | 4.5.3 | |
state | String | The running state of the volume. | 4.5.3 |
status | String | The ready status of the volume. | 4.5.3 |
createDate | Timestamp | The creation time. | 4.5.3 |
lastOpDate | Timestamp | The last operation time. | 4.5.3 |
isShareable | Boolean | The sharing mode of the volume. | 4.5.3 |
volumeQos | String | The volume QoS. Syntax sample: total=1048576 | 4.5.3 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 4.5.3 |
vmInstanceUuid | String | The VM instance UUID. | 4.5.3 |
deviceId | Integer | The drive sequence number. | 4.5.3 |
isoUuid | String | The ISO image UUID. | 4.5.3 |
isoInstallPath | String | The mount path of the ISO image. | 4.5.3 |
name | String | The resource name. | 4.5.3 |
description | String | The detailed description of the resource. | 4.5.3 |
createDate | Timestamp | The creation time. | 4.5.3 |
lastOpDate | Timestamp | The last operation time. | 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-uuid
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth e46c3ba50f324bcbabda6c40d11d1e33" \ -X GET http://localhost:8080/zstack/v1/vcenters?q=uuid=7e580c2f8b6c4e31aff447c45c72c3bb
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth d0552ed3feb243a1b87fcff421388964" \ -X GET http://localhost:8080/zstack/v1/vcenters/bb39998d05004cd9aa5bf816cc308ed1
Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryVCenter
, and pressing the Tab key.
{ "inventories": [ { "uuid": "b84429ea486d3e878afd4175bff667e0", "name": "vc1", "domainName": "vsphere-local.net", "userName": "admin@vsphere-local.net", "version": "6.0.0", "https": true, "state": "Enabled", "status": "Connected" } ] }
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.9.0 |
inventories | List | See inventories. | 3.9.0 |
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.9.0 |
description | String | The brief description of the error. | 3.9.0 |
details | String | The details about the error. | 3.9.0 |
elaboration | String | The reserved field. Default value: null. | 3.9.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 3.9.0 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.9.0 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 3.9.0 |
name | String | The resource name. | 3.9.0 |
description | String | The detailed description of the resource. | 3.9.0 |
domainName | String | 3.9.0 | |
port | Integer | 3.9.0 | |
userName | String | 3.9.0 | |
zoneUuid | String | The zone UUID. | 3.9.0 |
version | String | The vCenter version. | 3.9.0 |
https | Boolean | 3.9.0 | |
state | String | 3.9.0 | |
status | String | 3.9.0 | |
createDate | Timestamp | The creation date. | 3.9.0 |
lastOpDate | Timestamp | The last operation date. | 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()
Back to Top
Email Us
contact@zstack.ioEmail Us
contact@zstack.ioEmail Us
contact@zstack.ioThe download link is sent to your email address.
If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.Thank you for using ZStack products and services.
Submit successfully.
We'll connect soon.Thank you for using ZStack products and services.