Change VS Owner

To reassign a VS to another user, use the following request:

POST /virtual_machines/:virtual_machine_id/change_owner.xml
POST /virtual_machines/:virtual_machine_id/change_owner.json

XML Request Example

curl -i -X POST -u user:userpass --url http://onapp.test/virtual_machines/19/change_owner.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<user_id>2</user_id><custom_recipes_action>null</custom_recipes_action><backups_action>null</backups_action>'

JSON Request Example

curl -i -X POST -u user:userpass --url http://onapp.test/virtual_machines/19/change_owner.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"user_id": 2, "custom_recipes_action": null, "backups_action": null}'

Where:

user_id* – input ID of a new VS owner

custom_recipes_action - select one of the following options for virtual server's recipes:

  • null - recipes owner will not be changed
  • move - recipes owner will be changed
  • copy - recipes will be copied to new virtual servers owner

backups_action - select one of the following options for virtual server's backups:

  • null - backup owner will not be changed
  • move - backup owner will be changed

  • Instead of virtual server ID (:virtual_machine_id) you may use virtual server identifier (:virtual_machine_identifier).
  • If VS can not be reassigned to another user, you will get an error message:
    "Errors: New owner has reached his backup creation limit or doesn't have enough disk space."