Appearance
cdm connection
cdm connection サブコマンドで、ワークスペースに登録されたコネクションの情報を取得します。
cdm connection <subcommand> [options]| サブコマンド | 用途 |
|---|---|
connection list | コネクションの一覧を取得 |
コネクション一覧の取得
cdm connection list
--profile <name> 利用する profile を指定
-f, --format <fmt> 出力形式: text | json(既定: text)ワークスペース内のコネクション一覧を取得します。
- 各コネクションには、利用中の profile が持つ操作権限が
permissionsに配列として付与されます。値はread(閲覧)とexecute(実行) とedit_annotation(アノテーション編集)ですexecuteの有無によりcdm sql runやcdm notebook runでSQLを実行できるかを事前に判断できますedit_annotationの有無によりcdm catalog annotation pushでカタログのアノテーションを編集できるかを事前に判断できます
- 取得に失敗した場合、エラーメッセージを出力して
exit 1で終了します - コネクションが 0 件の場合、text では
No connections foundを表示します(json では"connections": []) - 閲覧権限が付与されているコネクションのみが一覧に表示されます
text 出力例:
Id Name Type Permissions
671ef14b0d08cf6c657df7da Analytics DWH BIGQUERY read,execute,edit_annotation
671ef14b0d08cf6c657df7db Product DB (Prod) SNOWFLAKE readjson 出力例:
json
{
"connections": [
{
"id": "671ef14b0d08cf6c657df7da",
"name": "Analytics DWH",
"type": "BIGQUERY",
"permissions": ["read", "execute", "edit_annotation"]
},
{
"id": "671ef14b0d08cf6c657df7db",
"name": "Product DB (Prod)",
"type": "SNOWFLAKE",
"permissions": ["read"]
}
]
}