1.5

Table Of Contents
n
Verify that your organization has defined an LDAP service to use.
Procedure
1 Create a Group element that identifies the LDAP group to import.
The name attribute of the Group element must match the LDAP group name, as specified in the organization's
LDAP properties. You must include a Role element in the request body. The role specified in this element
is assigned to all group members during the import.
2 POST the Group element to the organization's groups URL.
The server matches the value of the name attribute in the request body with the value of the LDAP attribute
that the organization specified in the value of the GroupName element in the GroupAttributes of its
OrgLdapSettings. The LDAP cn attribute is a common choice here. The server imports that group and all of its
users from organization's LDAP service, and returns an updated Group element to the client.
Example: Import a Group from an LDAP Database
This example imports a group to the organization created in “Example: Create an Organization,” on
page 113. 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>
vCloud API Programming Guide
152 VMware, Inc.