N1 Service Provisioning System 4.1 リファレンスガイド

出力書式の変換

ファイルに渡したコマンドの出力書式を変換する場合は、reformat.util コマンドを使用できます。

util.reformat コマンドは、指定した出力ファイルからデータを読み取り、そのデータの書式をユーザーが選択した出力書式に変更します。

たとえば、ホストを作成して、hdb.h.add コマンドからの出力を 直列化書式で hostFile というファイルに格納しているとします。


cr_cli -cmd hdb.h.add -o serialized -u [user] 
-p [password] -name myhost -tID NM:roxhost > hostFile

前のコマンドの出力に対して util.reformat を実行し、 「それぞれの CLI 引数へのデータの受け渡し」 に説明のある file: オプションでデータを hostFile に渡して、detail 書式を使用するように指示できます。


cr_cli -cmd util.reformat -u [user] -p [password] 
-o hdb.detail -self file:hostFile

これにより、以下が返されます。


ID: 010010000204-1027365659275-00170-1199101891
Name: myhost
Description: 
Virtual: false
Hidden: false
Type ID: 010010001024-0000000000000-00001-0000000004
Attributes:
<Table is empty>
Applications:
<Table is empty>