Command Line Console (CLC) の使用
Command Line Console (CLC) では、管理者がコマンド ラインを使用して、ソリューション定義 (SPD) および インストール パッケージ (IP) に対して GAX の特定の機能を実行できます。 たとえば、CLC を使用して、ダイアログを表示せずにリモート ホストに SPD をデプロイメントすることができます。
CLC を使用するには、オペレーティング システムのコマンド ライン インタフェースにアクセスする必要があります。 GAX ホスト以外のマシンを使用する場合は、そのローカル マシンに CLC ツール (gaxclc.jar ) がインストールされていなければなりません。
CLC のヘルプ ファイルを表示するには、次のいずれかのコマンドを実行します。
java –jar gaxclc.jar help
重要
CLC でコマンドを実行すると、ツールを実行したのと同じ場所にログ ファイルが生成されます。
構造
CLC では次の構造を使用するコマンドがサポートされます。
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> <function> <operation> <args>
フラグの意味は次のとおりです。
-u:user は、Configuration Server にログインするためのユーザー名です。
-p:password は、Configuration Server にログインするためのパスワードです。 このフラグに値を指定しない場合、CLC はパスワードが存在しないと見なします。
-s は、セキュアな https 接続を使用して GAX サーバーに接続するよう CLC に指示します。 このフラグを指定しない場合、CLC は http を使用します。
-h:<host>:<port> は、GAX サーバーのホストとポートを指定します。 このフラグを指定しない場合、CLC は -h:localhost:8080 の値を使用します。
<function> の値は、ip と spd のいずれかです。
<operation> は、実行する操作を指定します。 このフラグの有効値は、前の手順で指定した function の値 (ip または spd ) によって異なります。
<args> は、操作の引数を指定します。 このフラグの有効値は、この前の手順で指定した <function> および <operation> のパラメーター値によって異なります。
次は CLC コマンドの一例です。
java -jar gaxclc.jar -u:default -p:password -h:localhost:8080 spd execute 10054 1 "C:/GAX/input.txt"
SPD
CLC では SPD に対して次の操作を実行できます。
add
query
querybyid
execute
delete
encrypt (「execute 」タブを参照)
add
概要
この操作は、GAX データベースに SPD を追加します。 SPD XML にある名前とバージョンにより SPD が既に存在すると判断された場合には、この操作で既存の SPD が置換されます。
操作に成功した場合、追加された SPD の ID が返されます。
フォーマット
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> spd add "file path"
"file path" —XML ファイルへのパス。
例
java -jar gaxclc.jar -u:default -p:password spd add "c:\GAX\newSpd.xml"
query
概要
すべての SPD を照会し、各 SPD について次の情報をテーブルに一覧表示します。
次に例を示します。
10054 gvp 8.1.5 1
10060 genesysOne 8.1.5 1
10060 eServices 8.1.5 1
フォーマット
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> spd query
例
java -jar gaxclc.jar -u:default -p:password -s -h:132.45.43.45:443 spd query
querybyid
概要
この操作は SPD を ID で照会します。 該当する SPD が存在しない場合、操作は失敗します。
照会に成功した場合、SPD に関する次の詳細情報がテーブルに一覧表示されます。
以下に例を示します。
フォーマット
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> spd query SPDID
例
java -jar gaxclc.jar -u:default -p:password -h:132.45.43.45:8080 spd query 4374
execute
概要
この操作は SPD を実行します。
フォーマット
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> spd execute SPDID profileName|-profileID:profileID|-profileName:profileName -encrypted "input file"
SPDID —実行する SPD の ID。
profileName|-profileID:profileID|-profileName:profileName —実行する SPD プロファイル。
重要
フラグを指定しない場合、実行する SPD プロファイルとして
profileName が使用されます。
-encrypted —このフラグを指定すると、入力ファイルが暗号化されます。
[+] 使用方法を表示する
CLC では、パスワードなどの機密データを含むファイルの暗号化機能を使用できます。
フォーマット:
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> spd encrypt "input file path" "encrypted output file path"
暗号化した入力ファイルは、"encrypted output file path" (暗号化出力ファイル パス) で指定した場所に保存されます。 この場所に同じファイルが既に存在する場合、既存のファイルが上書きされます。
例:
java -jar gaxclc.jar -u:default -p:password spd -encrypted "c:\GAX\input.txt" "c:\GAX\encrypted.txt"
java -jar gaxclc.jar -u:default -p:password spd -encrypted "input.txt" "encrypted.txt"
"input file" —SPD パラメーターを含む入力ファイルを指定します。 -encrypted を指定した場合、入力ファイルが暗号化されます。
入力ファイルは JSONObject フォーマットを使用し、該当するプロファイルの SPD パラメーターを含める必要があります。 ファイルは UTF-8 フォーマットでエンコードされていなければなりません。
[+] 使用方法を表示する
The input file must be in JSONObject format and include SPD parameters for a specific profile. The file must be encoded in UTF-8 format.
The input structure for a string type is described below:
{
"Dialog name" : {
"Input name" : "string"
}
}
Example
SPD Profile
<profile name="Install">
<dialog step="Step1">
<input name="NAME_PARAM1" title="PERSON NAME" default="birit" type="string" required="true">
<description>Please enter the person name</description>
</input>
</dialog>
<dialog step="Step2">
<input name="NAME_PARAM2" title="PERSON NAME" default="birit" type="string" required="true">
<description>Please enter the person name</description>
</input>
</dialog>
<execution>
<script>
log('string test' );
</script>
</execution>
</profile>
Input File for Install Profile
{
"Step1" : {
"NAME_PARAM1" : "Kate"
},
"Step2" : {
"NAME_PARAM2" : "John"
}
}
The input structure for a boolean type is described below:
{
"Dialog name" : {
"Input name" : true/false
}
}
Example
SPD Profile
<profile name="Install">
<dialog step="Step1">
<input name="STATUS" title="status" type="boolean" required="true">
<description>status field</description>
</input>
</dialog>
<execution>
<script>
log('boolean test');
</script>
</execution>
</profile>
Input File for Install Profile
{
"Step1" : {
"STATUS" : true
}
}
The input structure for an integer type is described below:
{
"Dialog name" : {
"Input name" : <integer>
}
}
Example
SPD Profile
<profile name="Install">
<dialog step="Step1">
<input name="NUMBER" title="number" type="integer" required="true">
<description>number field</description>
</input>
</dialog>
<execution>
<script>
log('number test');
</script>
</execution>
</profile>
Input File for Install Profile
{
"Step1" : {
"NUMBER" : 132
}
}
The input structure for a password type is described below:
{
"Dialog name" : {
"Input name" : "password"
}
}
重要
Input files that include sensitive data such as passwords should be encrypted using the SPD encrypt operation.
Example
SPD Profile
<profile name="Install">
<dialog step="Step1">
<input name="PASSWORD" title="password" type="password" required="true">
<description>password field</description>
</input>
</dialog>
<execution>
<script>
log('password test');
</script>
</execution>
</profile>
Input File for Install Profile
{
"Step1" : {
"PASSWORD" : "xyz9846gdkjg"
}
}
The input structure for a selectOne type with an <objectselect> tag is described bellow:
{
"Dialog name" : {
"Input name" : {
"objectselect" : {
"filter" : [{
"value" : "filter value",
"name" : "filter name"
}
]
}
}
}
}
重要
CLC intersects (
AND ) filters defined in the SPD file and input file for a
selectOne input. The filter criteria should be different in an SPD input file and filter names should differ in the same filter definition.
Example
SPD Profile
<profile name="Install">
<dialog step="Step1">
<input name="APP_OBJ_SELECT_ONE" title="Application Name" hidden="false" type="selectOne" default="">
<description>select application</description>
<objectselect>
<filter value="CfgApplication" name="type"/>
</objectselect>
</input>
</dialog>
<execution>
<script>
log('test select one' );
</script>
</execution>
Input File for Install Profile
{
"Step1" : {
"APP_OBJ_SELECT_ONE" : {
"objectselect" : {
"filter" : [{
"value" : "SIP_lrm26",
"name" : "name"
}
]
}
}
}
}
The input structure for a selectMultiple type with <objectselect> tag is described below:
{
"Dialog name" : {
"Input name" : {
"objectselect" : {
"filter" : [{
"value" : "filter value",
"name" : "filter name"
}
]
}
}
}
}
Filters defined in an SPD input file are joined in union (OR ) and then intersect (AND ) with filters defined in an SPD file for a selectMultiple input.
Example
SPD Profile
<profile name="Install">
<dialog step="Step1">
<input name="APP_OBJ_SELECT_MULTIPLE" title="Application Name" hidden="false" type="selectMultiple" default="">
<description>select application</description>
<objectselect>
<filter value="CfgApplication" name="type"/>
</objectselect>
</input>
</dialog>
<execution>
<script>
log('test select multiple' );
</script>
</execution>
Input File for Install Profile
{
"Step1" : {
"APP_OBJ_SELECT_MULTIPLE" : {
"objectselect" : {
"filter" : [{
"value" : "SIP_lrm26",
"name" : "name"
},{
"value" : "SIP_lrm27",
"name" : "name"
}
]
}
}
}
}
The operation returns two applications named SIP_lrm26 and SIP_lrm27 .
The input structure for a selectOne/selectMultiple/boolean type with <selection> tag is described below:
{
"Dialog name" : {
"Input name" : {
"selection" : {
"option" : [{
"value" : "option value assigned to the input parameter",
"name" : "option name is displayed in UI"
}
]
}
}
}
}
CLC selects options defined in the SPD input file. Multiple options can be specified only for the selectMultiple input type.
Example
SPD Profile
<profile name="Install">
<dialog step="Application Parameters">
<input name="DATA_MODEL" title="Binary Version (32-bit or 64-bit)" default="64" type="selectOne" required="true">
<description>This parameter defines the 32-bit or the 64-bit version of the binary to be deployed. </description>
<selection>
<option name="32" value="32"/>
<option name="64" value="64"/>
</selection>
</input>
</dialog>
<execution>
<script>
log('test selection support' );
</script>
</execution>
Input File for Install Profile
{
"Application Parameters" : {
"DATA_MODEL" : {
"selection" : {
"option" : [{
"value" : "64",
"name" : "64"
}
]
}
}
}
}
重要
If the input file does not specify a value for a SPD parameter, the value defined in the default attribute of the input element will be used.
If an SPD input element has the required attribute set to true , but there is no corresponding input value that is supplied in either the SPD (as a default) or in the input file, then the SPD execution fails.
If an SPD input element has the readonly attribute value set to true , then the value in the default attribute value is used for the execution, if defined.
If the readonly attribute value is set to true, required is set to false , and the default attribute is not defined, then the following logic is used for input value determination:
For the boolean input type, the input value is set to false .
For the string and password input types, the input value is set to "" .
For the integer input type, the input is not propagated.
If a dialog cond attribute value evaluates to false, the dialog is skipped by the CLC tool.
Example:
<dialog step="Role input" cond="false">
<input name="ROLE" title="Role" hidden="false" type="selectOne" required="true">
<description>Please indicate the role</description>
<objectselect>
<filter value="CfgRole" name="type"/>
</objectselect>
</input>
</dialog>
例
java -jar gaxclc.jar -u:default -p:password -s -h:localhost:8080 spd execute 10054 -profileID:1 "C:/GAX/input.txt"
java -jar gaxclc.jar -u:default -p:password -h:localhost:8080 spd execute 10054 -profileName:"Install profile" "C:/GAX/input.txt"
java -jar gaxclc.jar -u:default -p:password -s -h:localhost:8080 spd execute 10054 1 -encrypted "C:/GAX/encryptedinput.txt"
delete
概要
この操作は SPD を削除します。 SPD が存在しない場合、操作は失敗します。
フォーマット
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> spd delete SPDID
例
java -jar gaxclc.jar -u:default -p:password spd delete 5436
IP
CLC では ip 機能として次の操作を実行できます。
add
query
querybyid
delete
add
概要
この操作は IP (.zip ファイルにパッケージ化されたもの) を GAX データベースに追加します。 同じ IP が既に存在する場合、既存の IP が置換されます。
操作に成功した場合、追加された IP が表示されます。
重要
.zip ファイルには IP とその IP のテンプレート フォルダーが含まれている必要があります。
フォーマット
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> ip add "path to IP zip file"
例
java -jar gaxclc.jar -u:default -p:password ip add "C:\GAX\TESTS\zippedIpUpload\PRODUCTION\IP_TSrvSIP64_18100079b1_ENU_windows.zip"
query
概要
この操作はすべての IP を照会し、各 IP について次の詳細情報をテーブルに一覧表示します。
ID 番号
名前
バージョン
OS
ロケール
状況
フォーマット
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> ip query
例
java -jar gaxclc.jar -u:default -p:password -s -h:132.45.43.45:443 ip query
querybyid
概要
この操作は IP を ID により照会し、次の詳細情報をテーブルに一覧表示します。
ID 番号
名前
バージョン
OS
ロケール
状況
フォーマット
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> ip query IPID
例
java -jar gaxclc.jar -u:default -p:password -h:132.45.43.45:8080 ip query 543
delete
概要
この操作は IP を削除します。
フォーマット
java –jar gaxclc.jar -u:user -p:password -s -h:<host>:<port> ip delete IPID
例
java -jar gaxclc.jar -u:default -p:password ip delete 547