Skip to content

Example for VM import via REST API #2

Open
@ddemlow

Description

@ddemlow

This example worked for me using REST API Docs "try it" for import of a specific export location

curl -X POST "https://10.205.15.70/rest/v1/VirDomain/import" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"source\":{\"pathURI\":\"smb://t4lab.local;administrator:[email protected]/exports/win2003legacy-emptydisk\",\"definitionFileName\":\"win2003legacy-emptydisk.xml\"},\"template\":{\"name\":\"rest-api-import\"}}"

the json body used which specifies the smb path and credentials used to access the exported VM. Note that for import to work - the folder /export-example here must match the definition file name base. Generally this would be the VM name for both if the export was triggered from the HC3 UI but that is not required. As shown here the imported vm name can be anything.

{ 
	 "source": { 
		 "pathURI": "smb://t4lab.local;administrator:[email protected]/exports/win2003legacy-emptydisk", 
		 "definitionFileName": "win2003legacy-emptydisk.xml"
		 				 },

	 "template": {

           "name": "rest-api-import"
         }
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions