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": [] }
Note: In                     the preceding sample, both systemTags and userTags are optional.                     These two fields can be included in the body structure.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"   } }| Name | Type | Description | Starting Version | 
|---|---|---|---|
| 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 | 
| 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 | 
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/bb39998d05004cd9aa5bf816cc308ed1Queryable 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.