5.5

Table Of Contents
Example: Import a Group from an LDAP Database
This example imports a group to the organization created in “Example: Create an Organization,” on
page 153. The response is a Group element, most of which does not appear in the example. The response
includes a link that an administrator can use to edit group metadata such as name and description, and a
UsersList element that includes a UserReference element for each user in the group. The response also
includes a NameInSource element, which contains the group's name as stored by the LDAP server, using the
server's native encoding.
Request:
POST https://vcloud.example.com/api/admin/org/26/groups
Content-Type: application/vnd.vmware.admin.group+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<Group
name="Engineering"
xmlns="http://www.vmware.com/vcloud/v1.5">
<Role
href="https://vcloud.example.com/api/admin/role/102"/>
</Group>
Response:
201 Created
Content-Type: application/vnd.vmware.admin.group+xml
...
<Group
xmlns="http://www.vmware.com/vcloud/v1.5"
name="Engineering"
id="urn:vcloud:group:44"
type="application/vnd.vmware.admin.group+xml"
href="https://vcloud.example.com/api/admin/group/44" ...>
<Role
type="application/vnd.vmware.admin.role+xml"
name="vApp Wrangler"
href="https://vcloud.example.com/api/admin/role/102" />
</Group>
Until the import is complete, the Group element contains only partial information. After the import is
complete, the element includes a list of users and other information.
<Group
xmlns="http://www.vmware.com/vcloud/v1.5"
name="Engineering"
id="urn:vcloud:group:44"
type="application/vnd.vmware.admin.group+xml"
href="https://vcloud.example.com/api/admin/group/44" ...>
<Link
rel="edit"
type="application/vnd.vmware.admin.group+xml"
href="https://vcloud.example.com/api/admin/group/44" />
<Link
rel="remove"
href="https://vcloud.example.com/api/admin/group/44" />
<Description>Research and development</Description>
<NameInSource>\C5\AF\B9\D4\9E\B5\32\40\AD\C5\E3\8E\17\4C\0D\28</NameInSource>
vCloud API Programming Guide
224 VMware, Inc.