Table of Contents [expand]
最終更新日 2024年08月01日(木)
Heroku CLI 用の Heroku Connect CLI プラグインを使用すると、Heroku Connect を設定および管理できます。
このプラグインは実験的なものであり、公式にはサポートされていません。
このプラグインは、Heroku Connect API を使用してコマンドを実行します。この CLI プラグインを使用して Heroku Connect を管理するスクリプトを作成する場合は、API の制限を確認してスロットリングを防いでください。
Heroku CLI のインストール
Heroku Connect CLI プラグインを追加する前に、Heroku CLI がインストールされている必要があります。手順については、「Heroku CLI」を参照してください。
Heroku Connect CLI プラグインをインストールする
次の Heroku CLI コマンドを実行して、Heroku Connect CLI プラグインをインストールします。
$ heroku plugins:install @heroku-cli/heroku-connect-plugin
Heroku Connect CLI コマンド
これらは、プラグインの各コマンドのヘルプテキストです。ヘルプテキストは、heroku connect --help や heroku:connect:COMMAND --help を使用してターミナルでも表示できます。
これらのコマンドの --resource オプションは、herokuconnect-twisted-123 などの特定の接続リソース名 (アドオン名) を指します。通常はオプションですが、アプリに複数の Heroku Connect アドオンがアタッチされている場合は、リソース名を指定する必要があります。
heroku connect:db:set
このコマンドは、データベースパラメータを設定します。
DESCRIPTION
  Set a connection's database config var and schema name.
USAGE
  $ heroku connect:db:set
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --db=db              Database config var name
  --resource=resource  specific connection resource name
  --schema=schema      Database schema name
heroku connect:diagnose
このコマンドは、接続に関する診断情報を表示します。
USAGE
  $ heroku connect:diagnose
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  -v, --verbose        display passed and skipped check information as well
  --resource=resource  specific connection resource name
DESCRIPTION
  Checks a connection for common configuration errors.
heroku connect:export
このコマンドは、接続から設定をエクスポートします。
USAGE
  $ heroku connect:export
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --resource=resource  specific connection resource name
DESCRIPTION
  Exports the mapping configuration from a connection as a json file
heroku connect:import
このコマンドは、接続から設定をインポートします。
USAGE
  $ heroku connect:import FILE
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --resource=resource  specific connection resource name
DESCRIPTION
  Imports the mapping configuration from a json export file
heroku connect:info
このコマンドは、接続情報を表示します。
  $ heroku connect:info
OPTIONS
  -a, --app=app        (required) app to run command against
  -c, --check-for-new  check for access to any new connections
  -r, --remote=remote  git remote of app to use
  --resource=resource  specific connection resource name
DESCRIPTION
  display connection information
heroku connect:mapping
このコマンドを使用してマッピングを管理します。
manage mappings on a Heroku Connect addon
USAGE
  $ heroku connect:mapping:COMMAND
COMMANDS
  connect:mapping:delete        Delete an existing mapping
  connect:mapping:diagnose      Display diagnostic information about a mapping
  connect:mapping:reload        Reload a mapping's data from Salesforce
  connect:mapping:state         return a mapping state
  connect:mapping:write-errors  Display the last 24 hours of write errors on
                                this mapping
heroku connect:mapping:delete
このコマンドは、指定されたマッピングを削除します。
USAGE
  $ heroku connect:mapping:delete MAPPING
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --confirm=confirm
  --resource=resource  specific connection resource name
DESCRIPTION
  Delete an existing mapping
heroku connect:mapping:diagnose
このコマンドは、マッピングに関する診断情報を表示します。これは、無効なマッピング設定のトラブルシューティングに役立ちます。
USAGE
  $ heroku connect:mapping:diagnose MAPPING
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  -v, --verbose        display passed and skipped check information as well
  --resource=resource  specific connection resource name
DESCRIPTION
  Checks a mapping for common configuration errors.
heroku connect:mapping:reload
このコマンドは、マッピングのデータを Salesforce からリロードします。
USAGE
  $ heroku connect:mapping:reload MAPPING
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --resource=resource  specific connection resource name
DESCRIPTION
  Reload a mapping's data from Salesforce
heroku connect:mapping:state
このコマンドは、マッピングの状態を返します。
USAGE
  $ heroku connect:mapping:state MAPPING
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --resource=resource  specific connection resource name
DESCRIPTION
  return a mapping state
heroku connect:mapping:write-errors
このコマンドは、このマッピングの過去 24 時間の書き込みエラーを表示します。
USAGE
  $ heroku connect:mapping:write-errors NAME
ARGUMENTS
  NAME  Name of the mapping to retrieve errors for
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --json               print errors as styled JSON
  --resource=resource  specific connection resource name
EXAMPLE
  $ heroku connect:mapping:write-errors -a myapp --resource
  herokuconnect-twisted-123 Account
heroku connect:pause
このコマンドは、接続を一時停止します。
USAGE
  $ heroku connect:pause
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --resource=resource  specific connection resource name
DESCRIPTION
  Pauses an active connection
heroku connect:recover
このコマンドは、接続の回復を試みます。
USAGE
  $ heroku connect:recover
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --resource=resource  specific connection resource name
DESCRIPTION
  Clears errors and attempts to resume sync operations
ALIASES
  $ heroku connect:restart
heroku connect:resume
このコマンドは、一時停止した接続を再開します。
USAGE
  $ heroku connect:resume
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --resource=resource  specific connection resource name
DESCRIPTION
  Resumes a paused connection
heroku connect:sf:auth
このコマンドは、接続のための Salesforce へのアクセスを承認します。
USAGE
  $ heroku connect:sf:auth
OPTIONS
  -a, --app=app                  (required) app to run command against
  -c, --callback=callback        final callback URL
  -d, --domain=domain            specify a custom login domain (if using a
                                 "custom" environment)
  -e, --environment=environment  "production", "sandbox", or "custom" [defaults
                                 to "production"]
  -r, --remote=remote            git remote of app to use
  --resource=resource            specific connection resource name
DESCRIPTION
  Opens a browser to authorize a connection to a Salesforce Org
heroku connect:state
このコマンドは、接続状態を返します。
USAGE
  $ heroku connect:state
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --json               print output as json
  --resource=resource  specific connection resource name
DESCRIPTION
  returns the state key of the selected connections
heroku connect:write-errors
このコマンドは、接続の過去 24 時間の書き込みエラーを表示します。
USAGE
  $ heroku connect:write-errors
OPTIONS
  -a, --app=app        (required) app to run command against
  -r, --remote=remote  git remote of app to use
  --json               print errors as styled JSON
  --resource=resource  specific connection resource name
EXAMPLE
  $ heroku connect:write-errors -a myapp --resource herokuconnect-twisted-123