Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for VM import via REST API #2

Open
ddemlow opened this issue Aug 22, 2020 · 0 comments
Open

Example for VM import via REST API #2

ddemlow opened this issue Aug 22, 2020 · 0 comments

Comments

@ddemlow
Copy link
Member

ddemlow commented Aug 22, 2020

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"
         }
 }
@ddemlow ddemlow changed the title Provide example for VM import via REST API Example for VM import via REST API Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant