REST API - create

vcenter ovf export session: create

Creates a new export session for a virtual machine or virtual appliance.

The state of the new export session is EXPORT_PREPARING.

This operation is idempotent. Two calls with the same client token will receive the same export session object.

Request:

HTTP request

POST https://{server}/rest/com/vmware/vcenter/ovf/export-session

Request Body Structure:

{
    "client_token""string",
    "create_spec"{
        "@class""com.vmware.vcenter.ovf.export_session.create_spec",
        "export_flags"[
            "string",
            "string"
        ],
        "content_library""obj-103",
        "target_type""DOWNLOAD_TARGET",
        "name""string",
        "content_library_item""obj-103",
        "description""string",
        "target_content_type""OVF_TARGET"
    },
    "source"{
        "vm_id""obj-103",
        "vapp_id""obj-103"
    }
}

Request Body Parameters:

Name Type Description
bold = required
client_token string Optional. The client token that ensures idempotency. The client token must be a valid UUID.
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.

create_spec.target_type string The download target type.

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.

create_spec.target_content_type string The download target content type. Default is OVF_TARGET.

Defines the target content types of export session. This only applies to DOWNLOAD_TARGET. Value is one of:
OVF_TARGET: Export the OVF package as a set of files.
OVA_TARGET: Export the OVF package as a single OVA file.Optional. It is only relevant when target_type has value DOWNLOAD_TARGET. Only used if vcenter.ovf.export_session.vcenter.ovf.export_session.create-input.target_type is DOWNLOAD_TARGET.

create_spec.export_flags string[] List of selected export flags. The supported flags are:
  • BIOS_UUID: Include BIOS UUIDs.
  • IP: Include IP settings.
  • CDROM: Include attached CDROM media.
  • Other supported flags can be obtained using list.

Optional. Default is no flags.

create_spec.name string If non-empty, this specifies the name in the OVF descriptor.

Optional. Default is to use current name.

create_spec.description string If non-empty, this specifies the description to put in the OVF descriptor.

Optional. Default is to use current description.

create_spec.content_library string The identifier of the content library.

Optional. It is only relevant when target_type has value CONTENT_LIBRARY_TARGET. Only used if vcenter.ovf.export_session.vcenter.ovf.export_session.create-input.target_type is CONTENT_LIBRARY_TARGET.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.content.Library. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.content.Library.

create_spec.content_library_item string The identifier of the content library item to update. If omitted, a new item will be created.

Optional. Default is to add new item. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.content.library.Item. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.content.library.Item.

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

Response:

HTTP Status Code: 200

Representation:

{
    "value""obj-103"
}

Response Type:

Name Type Description
bold = required
value string Reference to the created export session.

Errors:

HTTP Status Code Type Description
404 not_found if the specified virtual machine or virtual appliance does not exist.
400 invalid_argument if the arguments are invalid. For example, no virtual machine or virtual appliance is specified or both are set.
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, or if the virtual appliance is running.
500 resource_inaccessible if there was an error accessing one of the virtual machine files.
500 resource_busy if the specified virtual appliance or virtual machine is busy.