管理ユーティリティをスクリプトから使用する
管理ユーティリティのいくつかのコマンドは、スクリプト ファイルから実行できます。これは、管理ユーティリティや Management Console でコマンドを手動で実行する代わりに、スクリプトを使用して管理上のアクションを自動化または規格化したい場合に便利です。
例: データフローをステージングから実稼働に移動する
Deduplication、AddressValidation、および DrivingDirections の 3 つのデータフローがあります。これらのデータフローに修正を加え、テストするためのステージング サーバーと、データフローを実行可能にする実稼働環境があります。これらのデータフローをステージング サーバーから実稼働ササーバーに移動する作業に一貫性を与え、自動化する必要があるため、管理ユーティリティ スクリプトを利用することにしました。使用するスクリプトは、次のような内容です。
// Connect to the staging server
connect --h stagingserver:8080 --u allan12 --p something123
// Export from staging
dataflow export --d "Deduplication" --e true --o exported
dataflow export --d "AddressValidation" --e true --o exported
dataflow export --d "DrivingDirections" --e true --o exported
// Close connection to the staging server
close
// Connect to the production server
connect --h productionserver:8080 --u allan12 --p something123
// Import to production
dataflow import --f exported\Deduplication.df
dataflow import --f exported\AddressValidation.df
dataflow import --f exported\DrivingDirections.df
// Close the connection to the production server
close