プロパティー・ファイルと wsadmin スクリプトによる、サーバー、クラスター、アプリケーション、または許可グループ・オブジェクトの作成
このトピックでは、構成用の新規サーバー、クラスター、アプリケーション、または許可グループのオブジェクトを作成します。
このタスクについて
AdminTask オブジェクトの PropertiesBasedConfiguration コマンド・グループを使用すると、プロパティー・ファイルを使用して、ご使用の環境に構成オブジェクトを作成することができます。

手順
- wsadmin スクリプト・ツールを開始します。
- プロパティー・ファイル・テンプレートを作成します。 新規サーバー、クラスター、アプリケーション、または許可グループのオブジェクトの作成に使用するプロパティー・ファイル・テンプレートを作成します。 以下のガイドラインを参考に、-configType パラメーターで、作成するテンプレートのタイプを指定します。
- サーバー・タイプのプロパティー・ファイル・テンプレートを作成する場合は、Server を指定します。
- サーバー・クラスター・タイプのプロパティー・ファイル・テンプレートを作成する場合は、ServerCluster を指定します。
- アプリケーション・タイプのプロパティー・ファイル・テンプレートを作成する場合は、Application を指定します。
- 許可グループ・タイプのプロパティー・ファイル・テンプレートを作成する場合は、AuthorizationGroup を指定します。
次の Jython 例では、createPropertiesFileTemplates コマンドを使用して、 新しい AuthorizationGroup オブジェクト・テンプレートが作成されます。AdminTask.createPropertiesFileTemplates('[-propertiesFileName authorizationGroup.template -configType AuthorizationGroup]')
このコマンドにより、以下のサンプル・テンプレートのような テンプレート・ファイルが生成されます。# # Create parameters # Replace the line `SKIP=true` with 'SKIP=false' under each section that is needed # Set necessary parameters under each command or step sections # Invoke applyConfigProperties command using this properties file. # ResourceType=AuthorizationGroup ImplementingResourceType=AuthorizationGroup ResourceId=AuthorizationGroup= SKIP=true CreateDeleteCommandProperties=true # # #Properties # authorizationGroupName=authorizationGroupName #String,required commandName=createAuthorizationGroup
- この新規テンプレート・ファイルを変更します。
必須パラメーターを設定して、 新しい AuthorizationGroup テンプレート・ファイルを変更します。 オプション・パラメーターも 変更できますが、必須パラメーターは必ず変更してください。 必須プロパティー SKIP の 値を SKIP=true から SKIP=false に変更すると、 システムは、プロパティー・ファイルの特定セクションのプロパティーを 構成に適用します。プロパティー・ファイルの特定セクションを無視するには、 SKIP プロパティーを SKIP=true に設定してください。
# # Create parameters # Replace the line `SKIP=true` with 'SKIP=false' under each section that is needed # Set necessary parameters under each command or step sections # Invoke applyConfigProperties command using this properties file. # ResourceType=AuthorizationGroup ImplementingResourceType=AuthorizationGroup ResourceId=AuthorizationGroup= SKIP=false CreateDeleteCommandProperties=true # # #Properties # authorizationGroupName=ag1 #String,required commandName=createAuthorizationGroup
- 変更されたプロパティーを構成に適用します。 以下の Jython 例に示すように、applyConfigProperties コマンドを使用してプロパティー・ファイルを構成に適用します。
AdminTask.applyConfigProperties('[-propertiesFileName authorizationGroup.template]')
このコマンドは、構成内に ag1 許可グループを作成します。
- 構成の変更を保存します。 以下のコマンド例を使用して、構成変更を保存します。
AdminConfig.save()
関連タスク:


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_7propobjects
ファイル名:txml_7propobjects.html