Import vCenter VS

To import a vCenter virtual server into OnApp, use the following request:

POST /settings/hypervisors/:hypervisor_id/virtual_machines.xml
POST /settings/hypervisors/:hypervisor_id/virtual_machines.json

XML Request Example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<virtual_machine><vm_moref>vm-1381</vm_moref><user_id>1</user_id></virtual_machine>' --url http://onapp.test/settings/hypervisors/47/virtual_machines.xml

JSON Request Example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"vm_moref":"vm-1381","user_id":"1"}}' --url http://onapp.test/settings/hypervisors/47/virtual_machines.json

Where:

vm_moref* - moref of the virtual server on vCenter
user_id* - the ID of a new owner in OnApp