REST API - preview

vcenter ovf export session: preview

Do a preview of an export for a virtual machine of virtual appliance. This can be used to get an overview of the files that will need to be transferred during the actual export.

Request:

HTTP request

POST https://{server}/rest/com/vmware/vcenter/ovf/export-session?~action=preview

Request Body Structure:

{
    "preview_spec"{
        "@class""com.vmware.vcenter.ovf.export_session.preview_spec",
        "export_flags"[
            "string",
            "string"
        ],
        "target_type""DOWNLOAD_TARGET"
    },
    "source"{
        "vm_id""obj-103",
        "vapp_id""obj-103"
    }
}

Request Body Parameters:

Name Type Description
bold = required
source source_info The entity to export.
source.vapp_id string The identifier of the virtual appliance to export.

Optional. It is not required if vcenter.ovf.export_session.source_info.vm_id is specified.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: VirtualApp. When operations return a value of this structure as a result, the field will be an identifier for the resource type: VirtualApp.

source.vm_id string The identifier of the virtual machine to export.

Optional. It is not required if vcenter.ovf.export_session.source_info.vapp_id is specified.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: VirtualMachine. When operations return a value of this structure as a result, the field will be an identifier for the resource type: VirtualMachine.

preview_spec.export_flags string[] List of selected export flags. These are the same as when creating an export session.

Optional. Default is no flags.

preview_spec.target_type string The expected target type, the default type is DOWNLOAD_TARGET.

Defines the target types of export session. If vcenter.ovf.export_session.vcenter.ovf.export_session.create-input.content_library is provided, the OVF is exported to a local content library. Value is one of:
DOWNLOAD_TARGET: A set of URLs are published where the files can be downloaded from.
CONTENT_LIBRARY_TARGET: The OVF package is directly transferred to a content library.Optional. Default is DOWNLOAD_TARGET.

preview_spec object Creation spec containing a set of parameters to control the behavior of the export preview.

Response:

HTTP Status Code: 200

Representation:

{
    "value"{
        "files"[
            {
                "name""string"
            },
            {
                "name""string"
            }
        ]
    }
}

Response Type:

Name Type Description
bold = required
value preview The preview of what the export would do.
value.files preview_file[] The files that will need to be transferred during the export. This includes disks, CD images, and the descriptor itself.

value.files[].name string The name of the file.

Errors:

HTTP Status Code Type Description
404 not_found if the specified virtual machine or virtual appliance does not exist.
400 not_allowed_in_current_state if the operation cannot be performed because of the specified virtual appliance or virtual machine's current state. For example, if the virtual machine configuration information is not available.
500 resource_inaccessible if there was an error accessing one of the virtual machine files.