【VMware Cloud Director】GUIとAPIでのLDAP設定の差異

GUIにてLDAPを設定する際は「ベースの識別子名」が1つしか表示されず、ユーザーとグループにて共通の「ベースの識別子名」しか設定できない

しかし、APIから設定する際はユーザーとグループに対して個別の「ベースの識別子名」を設定できる

利用API

PUT /admin/org/{id}/settings/ldap

VMware Cloud Director API - VMware API Explorer

VMware Cloud Director API - PUT-OrgLdapSettings

"IsGroupSearchBaseEnabled"をtrueに設定し、"GroupSearchBase"にて指定することで、グループ用の設定が可能となる

(例)リクエストbody

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OrgLdapSettings xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:common="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:ns9="http://www.vmware.com/vcloud/versions" href="https://172.16.20.20/api/admin/org/4b756104-e74e-4143-a622-6e4f5e0ea789/settings/ldap" type="application/vnd.vmware.admin.organizationLdapSettings+xml">
    <OrgLdapMode>CUSTOM</OrgLdapMode>
    <CustomOrgLdapSettings>
        <HostName>172.16.20.1</HostName>
        <Port>389</Port>
        <IsSsl>false</IsSsl>
        <SearchBase>OU=users,DC=env,DC=lab</SearchBase>
        <UserName>administrator@env.lab</UserName>
        <AuthenticationMechanism>SIMPLE</AuthenticationMechanism>
        <GroupSearchBase>OU=groups,DC=env,DC=lab</GroupSearchBase>
        <IsGroupSearchBaseEnabled>true</IsGroupSearchBaseEnabled>
        <ConnectorType>ACTIVE_DIRECTORY</ConnectorType>
        <UserAttributes>
            <ObjectClass>user</ObjectClass>
            <ObjectIdentifier>objectGuid</ObjectIdentifier>
            <UserName>sAMAccountName</UserName>
            <Email>mail</Email>
            <FullName>displayName</FullName>
            <GivenName>givenName</GivenName>
            <Surname>sn</Surname>
            <Telephone>telephoneNumber</Telephone>
            <GroupMembershipIdentifier>dn</GroupMembershipIdentifier>
            <GroupBackLinkIdentifier>tokenGroups</GroupBackLinkIdentifier>
        </UserAttributes>
        <GroupAttributes>
            <ObjectClass>group</ObjectClass>
            <ObjectIdentifier>objectGuid</ObjectIdentifier>
            <GroupName>cn</GroupName>
            <Membership>member</Membership>
            <MembershipIdentifier>dn</MembershipIdentifier>
            <BackLinkIdentifier>objectSid</BackLinkIdentifier>
        </GroupAttributes>
    </CustomOrgLdapSettings>
</OrgLdapSettings>'

以下の順序で行うとリクエストbodyを作成するのが楽になる

GUIから設定を投入

②"GET /admin/org/{id}/settings/ldap"にて設定を取得

https://developer.vmware.com/apis/1245/doc/operations/GET-OrgLdapSettings.html

③②で取得した内容のうちグループ用箇所のみ変更

④”PUT /admin/org/{id}/settings/ldap”にて設定変更