Document navigation

ParseOvf

API Request

URLs
POST zstack/v1/ovf/parse
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "xmlBase64": "Base64 encoded ovf file content."
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, the userTags field is optional. This field can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
--X POST -d '{"params":{"xmlBase64":"Base64 encoded ovf file content."}}' http://localhost:8080/zstack/v1/ovf/parse
Parameters
Name Type Location Description Optional Value Starting Version
xmlBase64 String body(contained in the paramsstructure) The Base64-encoded OVF file. 4.4.6
systemTags List body Optional. The system tags. 4.4.6
userTags List body Optional. The user tags. 4.4.6

API Response

Sample Response
{
  "ovfInfo": {
    "disks": [
      {
        "index": 0.0,
        "diskId": "system",
        "fileRef": "file1",
        "fileName": "system.vmdk",
        "format": "vmdk",
        "populatedSize": 1.688600576E9,
        "capacity": 6.442450944E10
      }
    ],
    "networks": [
      {
        "name": "red-net"
      }
    ],
    "cpu": {
      "instanceId": "2",
      "quantity": 4.0,
      "coresPerSocket": 4.0
    },
    "memory": {
      "instanceId": "3",
      "quantity": 4.294967296E9
    },
    "vmName": "VM-1",
    "os": {
      "id": 107.0,
      "version": "7",
      "osType": "centos",
      "description": "CentOS 7"
    },
    "systemInfo": {
      "virtualSystemType": "vmx-18"
    },
    "nics": [
      {
        "networkName": "red-net",
        "nicModel": "E1000",
        "nicName": "nic-1",
        "autoAllocation": true
      }
    ],
    "cdDrivers": [
      {
        "autoAllocation": true,
        "driverType": "SATA",
        "subType": "vmware.cdrom.remotepassthrough",
        "name": "CD"
      }
    ],
    "volumes": [
      {
        "name": "System Volume",
        "diskId": "system",
        "driverType": "IDE"
      }
    ]
  }
}
Name Type Description Starting Version
success boolean 4.4.6
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.4.6
ovfInfo OvfInfo See ovfInfo. 4.4.6
#error
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. 4.4.6
description String The brief description of the error. 4.4.6
details String The details about the error. 4.4.6
elaboration String The reserved field. Default value: null. 4.4.6
opaque LinkedHashMap The reserved field. Default value: null. 4.4.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. 4.4.6
#ovfInfo
Name Type Description Starting Version
vmName String The VM name. 4.4.6
disks List See disks. 4.4.6
networks List See networks. 4.4.6
cpu OvfCpuInfo See cpu. 4.4.6
memory OvfMemoryInfo See memory. 4.4.6
os OvfOSInfo See os. 4.4.6
systemInfo OvfSystemInfo See systemInfo. 4.4.6
nics List See nics. 4.4.6
cdDrivers List See cdDrivers. 4.4.6
volumes List See volumes. 4.4.6
#disks
Name Type Description Starting Version
index int The disk number. 4.4.6
diskId String The disk ID. 4.4.6
fileRef String The file reference. 4.4.6
fileName String The image file name. 4.4.6
format String The image file format. 4.4.6
populatedSize Long The image file size. 4.4.6
capacity Long The disk capacity. Unit: byte. 4.4.6
#networks
Name Type Description Starting Version
name String The network name. 4.4.6
#cpu
Name Type Description Starting Version
instanceId String The instance ID. 4.4.6
quantity Integer The number of CPU cores. 4.4.6
coresPerSocket Integer The number of cores per CPU. 4.4.6
#memory
Name Type Description Starting Version
instanceId String The instance ID. 4.4.6
quantity Long The memory size. Unit: byte. 4.4.6
#os
Name Type Description Starting Version
id Integer The OS ID. 4.4.6
version String The OS version. 4.4.6
osType String The OS type. 4.4.6
description String The OS description. 4.4.6
#systemInfo
Name Type Description Starting Version
virtualSystemType String The system type. 4.4.6
firmwareType String The firmware type. 4.4.6
#nics
Name Type Description Starting Version
networkName String The network name. 4.4.6
nicModel String The NIC model. 4.4.6
nicName String The NIC name. 4.4.6
autoAllocation Boolean Indicates whether the NIC is auto allocated. 4.4.6
#cdDrivers
Name Type Description Starting Version
autoAllocation Boolean Indicates whether the CD driver is auto allocated. 4.4.6
driverType String The driver type. 4.4.6
subType String The sub-type. 4.4.6
name String The driver name. 4.4.6
#volumes
Name Type Description Starting Version
name String The disk name. 4.4.6
diskId String The disk ID. 4.4.6
driverType String The disk driver type. 4.4.6

SDK Sample

Java SDK
ParseOvfAction action = new ParseOvfAction();
action.xmlBase64 = "Base64 encoded ovf file content.";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ParseOvfAction.Result res = action.call();
Python SDK
ParseOvfAction action = ParseOvfAction()
action.xmlBase64 = "Base64 encoded ovf file content."
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ParseOvfAction.Result res = action.call()
API Reference | 5.5.30 | ZStack Cloud · ZCF | ZStack Resource Center