39 データ管理REST APIを使用したディレクトリ・データの管理
Oracle Unified Directoryデータ管理REST APIを使用して、ディレクトリ・サーバー内のデータを追加、変更、削除および検索したり、ユーザーおよびグループを管理したりできます。
39.1 データ管理REST APIの構成
Oracle Unified Directoryデータ管理REST APIを使用するには、OUD環境を構成する必要があります。
OUDインスタンスの設定時の接続ハンドラの構成
Oracle Unified Directoryサーバー・インスタンスの作成中に、コマンド行からoud-setupユーティリティをhttpPortおよびhttpsPortパラメータとともに実行し、データ管理REST APIインタフェースを構成します。
oud-setup --cli \ --adminConnectorPort 1444 \ --httpAdminConnectorPort 1888 \ --rootUserDN cn=Directory\ Manager \ --rootUserPasswordFile password.file \ --ldapPort 1389 \ --ldapsPort 1636 \ --httpPort 1080 \ --httpsPort 1081 \ --generateSelfSignedCertificate \ --baseDN dc=example,dc=com \ --sampleData 200 \ --serverTuning jvm-default \ --offlineToolsTuning jvm-default \ --no-prompt \ --noPropertiesFile
既存のOUDインスタンスの接続ハンドラの構成
- 次のように、
dsconfigコマンドライン・ユーティリティをcreate-connection-handlerサブコマンドを指定して実行し、接続ハンドラを作成します:ノート:
OUDインスタンス用のHTTP/HTTPS接続ハンドラをすでに作成している場合は、dsconfigコマンドライン・ユーティリティをset-connection-handler-propサブコマンドを指定して実行し、既存の接続ハンドラを更新できます。HTTPポートの設定:
dsconfig create-connection-handler \ --handler-name "HTTP Connection Handler" \ --type http \ --set enabled:true \ --set listen-port:1080 \ --hostname localhost \ --port 1444 \ --portProtocol LDAP \ --bindDN "cn=Directory Manager" \ --bindPasswordFile /home/oracle/pwd.txt \ --no-promptHTTPSポートの設定:
dsconfig create-connection-handler \ --handler-name "HTTPS Connection Handler" \ --type http \ --set enabled:true \ --set listen-port:1081 \ --set use-ssl:true \ --set trust-manager-provider:JKS \ --set key-manager-provider:JKS \ --hostname localhost \ --port 1444 \ --portProtocol LDAP \ --bindDN "cn=Directory Manager" \ --bindPasswordFile /home/oracle/pwd.txt \ --no-prompt - 次のように、RESTエンドポイントを構成します:
-
REST Server拡張機能を有効にします。dsconfig set-extension-prop \ --Extension-name 'REST Server' \ --set enabled:true \ --hostname localhost \ --port 1444 \ --portProtocol LDAP \ --trustAll \ --bindDN "cn=Directory Manager" \ --bindPasswordFile /home/oracle/pwd.txt \ --no-prompt - ディレクトリ・エンドポイントを有効にします。
dsconfig set-directory-end-point-prop \ --set enabled:true \ --hostname localhost \ --port 1444 \ --portProtocol LDAP \ --trustAll \ --bindDN "cn=Directory Manager" \ --bindPasswordFile /home/oracle/pwd.txt \ --no-prompt
-
- OUDインスタンスを再起動します。
ノート:
OUDインスタンスに対してLDAPS接続ハンドラが構成されていない場合、HTTPS接続ハンドラを設定する前に、cn=JKS,cn=Key Manager Providers,cn=configおよびcn=JKS,cn=Trust Manager Providers,cn=configを構成する必要があります。「JKSキー・マネージャ・プロバイダの使用」および「JKS信頼マネージャ・プロバイダの使用」を参照してください39.2 データ管理REST APIの使用
データ管理REST APIを使用すると、Oracle Unified Directory内のディレクトリ・データを表示、追加、検索、変更または削除できます。
シナリオ例については、「Oracle Unified Directoryデータ管理のRest API」を参照してください。