VM Related Interfaces

Parse OVF Template Information

POST/zstack/v1/ovf/parse

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "xmlBase64": "Base64 encoded ovf file content."
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.

Curl Example

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

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
xmlBase64Stringbody (included in params structure)Base64 encoded OVF file content 4.4.6
systemTags (optional)ListbodySystem tags 4.4.6
userTags (optional)ListbodyUser tags 4.4.6

API Response

Response Example

{
  "ovfInfo": {
    "disks": [
      {
        "index": 0.0,
        "diskId": "system",
        "fileRef": "file1",
        "fileName": "system.vmdk",
        "format": "vmdk",
        "populatedSize": 1688600576.0,
        "capacity": 64424509440.0
      }
    ],
    "networks": [
      {
        "name": "red-net"
      }
    ],
    "cpu": {
      "instanceId": "2",
      "quantity": 4.0,
      "coresPerSocket": 4.0
    },
    "memory": {
      "instanceId": "3",
      "quantity": 4294967296.0
    },
    "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"
      }
    ]
  }
}
NameTypeDescriptionStarting Version
successboolean 4.4.6
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See error for details.4.4.6
ovfInfoOvfInfoSee ovfInfo for details.4.4.6

error

NameTypeDescriptionStarting Version
codeStringError code. A globally unique identifier for the error, for example SYS.1000, HOST.10014.4.6
descriptionStringBrief description of the error4.4.6
detailsStringDetailed error information4.4.6
elaborationStringReserved field, defaults to null4.4.6
opaqueLinkedHashMapReserved field, defaults to null4.4.6
causeErrorCodeRoot error. The error that caused this error. If there is no original error, this field is null4.4.6

ovfInfo

NameTypeDescriptionStarting Version
vmNameStringVM name4.4.6
disksListSee disks for details.4.4.6
networksListSee networks for details.4.4.6
cpuOvfCpuInfoSee cpu for details.4.4.6
memoryOvfMemoryInfoSee memory for details.4.4.6
osOvfOSInfoSee os for details.4.4.6
systemInfoOvfSystemInfoSee systemInfo for details.4.4.6
nicsListSee nics for details.4.4.6
cdDriversListSee cdDrivers for details.4.4.6
volumesListSee volumes for details.4.4.6

disks

NameTypeDescriptionStarting Version
indexintDisk index4.4.6
diskIdStringDisk ID4.4.6
fileRefStringFile reference name4.4.6
fileNameStringImage file name4.4.6
formatStringImage file format4.4.6
populatedSizeLongImage file size4.4.6
capacityLongDisk capacity in bytes4.4.6

networks

NameTypeDescriptionStarting Version
nameStringNetwork name4.4.6

cpu

NameTypeDescriptionStarting Version
instanceIdStringHardware ID4.4.6
quantityIntegerNumber of CPU cores4.4.6
coresPerSocketIntegerCores per socket4.4.6

memory

NameTypeDescriptionStarting Version
instanceIdStringHardware ID4.4.6
quantityLongMemory capacity in bytes4.4.6

os

NameTypeDescriptionStarting Version
idIntegerOperating system ID4.4.6
versionStringOperating system version4.4.6
osTypeStringOperating system type4.4.6
descriptionStringOperating system description4.4.6

systemInfo

NameTypeDescriptionStarting Version
virtualSystemTypeStringHardware system type4.4.6
firmwareTypeStringFirmware type4.4.6

nics

NameTypeDescriptionStarting Version
networkNameStringNetwork name4.4.6
nicModelStringNIC model4.4.6
nicNameStringNIC name4.4.6
autoAllocationBooleanWhether to auto-allocate4.4.6

cdDrivers

NameTypeDescriptionStarting Version
autoAllocationBooleanWhether to auto-allocate4.4.6
driverTypeStringCD drive controller type4.4.6
subTypeStringSub type4.4.6
nameStringCD drive name4.4.6

volumes

NameTypeDescriptionStarting Version
nameStringDisk name4.4.6
diskIdStringDisk ID4.4.6
driverTypeStringDisk driver type4.4.6

SDK Examples

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()