You can view the owner of a VApp, VAppTemplate, Disk, or Media object by making a GET request to the object's owner link. If you have adequate rights, you can change the owner of a Disk, VApp object, or VAppTemplate, but not that of a Media object.

The initial owner of a VApp, VAppTemplate, Catalog, Disk, or Media object is the user who created it. Ownership is expressed in an Owner element that the object representation contains. This element includes a User element that references the owner. Object-specific rights to change ownership are included in several predefined roles. See Predefined VMware Cloud Director Roles and Their Rights. See the VMware Knowledgebase article Understanding user roles within VMware vCloud Air (2053484).

Starting with VMware Cloud Director API 31.0, you can change the owner of a vAppTemplate object.

Prerequisites

  • To change the owner of a Disk, VApp, or Catalog object, you must be a system administrator or an organization administrator.

  • To change the owner of a vAppTemplate object, you must be a system administrator, organization administrator, or Catalog Author.

To change the owner of a Disk, VApp, or Catalog object, you must be a Virtual Infrastructure Administrator.

Procedure

  1. Retrieve the Owner element from the object.
    This element includes a reference to the current owner and an edit URL you can use to change the owner. This request retrieves the owner of a vApp.
    GET https://vcloud.example.com/api/vApp/vapp-7/owner
  2. Modify the Owner element to specify a different User.
    The user must be a member of the organization that contains the object.
    Note: You cannot modify the Owner of a Media object.
  3. To change the owner, make a PUT request to the Owner element's rel="edit" URL and supply an Owner element in the request body.
    The User element in the Owner element references the new owner. See Change the Owner of a vApp Template or vApp.

Example: Change the Owner of a vApp Template or vApp

  • Request for changing the owner of a vApp template:
    PUT https://vcloud.example.com/api/vAppTemplate/vappTemplate-44/owner
    Content-type: application/vnd.vmware.vcloud.owner+xml;version=31.0
    ...
    <?xml version="1.0" encoding="UTF-8"?>
    <Owner
       xmlns="http://www.vmware.com/vcloud/v1.5">
       <User
          type="application/vnd.vmware.admin.user+xml"
          href="https://vcloud.example.com/api/admin/user/120" />
    </Owner>
  • Request for changing the owner of a vApp:
    PUT https://vcloud.example.com/api/vApp/vapp-7/owner
    Content-type: application/vnd.vmware.vcloud.owner+xml
    ...
    <?xml version="1.0" encoding="UTF-8"?>
    <Owner
       xmlns="http://www.vmware.com/vcloud/v1.5">
       <User
          type="application/vnd.vmware.admin.user+xml"
          href="https://vcloud.example.com/api/admin/user/120" />
    </Owner>
Response:
204 No Content